summaryrefslogtreecommitdiff
path: root/includes/pages
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-12-29 17:19:27 +0100
committermsquare <msquare@notrademark.de>2017-12-29 17:19:27 +0100
commit86a38a3372557bd72db309e7b24b4a4a95544397 (patch)
treeb2349773367b95bc1aa78b2f78cfcda6cd277916 /includes/pages
parente7b0e9934d2df55a7971eaac42cc6b27a9733a32 (diff)
add user work log entries feature
Diffstat (limited to 'includes/pages')
-rw-r--r--includes/pages/admin_active.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php
index 576cdc49..18553159 100644
--- a/includes/pages/admin_active.php
+++ b/includes/pages/admin_active.php
@@ -58,7 +58,9 @@ function admin_active()
SELECT
`User`.*,
COUNT(`ShiftEntry`.`id`) AS `shift_count`,
- %s AS `shift_length`
+ (%s + (
+ SELECT SUM(`work_hours`) * 3600 FROM `UserWorkLog` WHERE `user_id`=`User`.`UID`
+ )) AS `shift_length`
FROM `User`
LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID`
LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID`
@@ -140,7 +142,9 @@ function admin_active()
SELECT
`User`.*,
COUNT(`ShiftEntry`.`id`) AS `shift_count`,
- %s AS `shift_length`
+ (%s + (
+ SELECT SUM(`work_hours`) * 3600 FROM `UserWorkLog` WHERE `user_id`=`User`.`UID`
+ )) AS `shift_length`
FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID`
LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID` '
. ($show_all_shifts ? '' : 'AND (`Shifts`.`end` < ' . time() . " OR `Shifts`.`end` IS NULL)") . '