summaryrefslogtreecommitdiff
path: root/includes/model/Shifts_model.php
diff options
context:
space:
mode:
authorjwacalex <aboehm@dompfaffenweg.de>2016-11-30 23:23:49 +0100
committerjwacalex <aboehm@dompfaffenweg.de>2016-11-30 23:23:49 +0100
commit45cda10479a16c237f917b69dc24ab3f31bffa89 (patch)
tree5aa98a6504d7558b56b7777f04b87a3b976bbedf /includes/model/Shifts_model.php
parent79b9f9448e4f3ad7abb8d795c1404b3221c95bf9 (diff)
parent53e12065c76af4e5a0a2690e92e6724eed9f2895 (diff)
merged master and issue
Diffstat (limited to 'includes/model/Shifts_model.php')
-rw-r--r--includes/model/Shifts_model.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index 6a29c540..1e1bd97d 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -263,9 +263,12 @@ function Shift_create($shift) {
/**
* Return users shifts.
*/
-function Shifts_by_user($user) {
+function Shifts_by_user($user, $include_freeload_comments = false) {
$result = sql_select("
- SELECT `ShiftTypes`.`id` as `shifttype_id`, `ShiftTypes`.`name`, `ShiftEntry`.*, `Shifts`.*, `Room`.*
+ SELECT `ShiftTypes`.`id` as `shifttype_id`, `ShiftTypes`.`name`,
+ `ShiftEntry`.`id`, `ShiftEntry`.`SID`, `ShiftEntry`.`TID`, `ShiftEntry`.`UID`, `ShiftEntry`.`freeloaded`, `ShiftEntry`.`Comment`,
+ " . ($include_freeload_comments ? "`ShiftEntry`.`freeload_comment`, " : "") . "
+ `Shifts`.*, `Room`.*
FROM `ShiftEntry`
JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`)
JOIN `ShiftTypes` ON (`ShiftTypes`.`id` = `Shifts`.`shifttype_id`)