summaryrefslogtreecommitdiff
path: root/includes/model/ShiftEntry_model.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-12-20 00:42:58 +0100
committermsquare <msquare@notrademark.de>2017-12-20 00:42:58 +0100
commit1289101f6e4b729018dba64e92b4c9397db67f2d (patch)
tree9b63d1174807af762050275062a20dbaf7d761d7 /includes/model/ShiftEntry_model.php
parentafd7c59d1d1e07c61099e3cf6a4c66af883c3302 (diff)
rewrite controller for creating shift entries
Diffstat (limited to 'includes/model/ShiftEntry_model.php')
-rw-r--r--includes/model/ShiftEntry_model.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/includes/model/ShiftEntry_model.php b/includes/model/ShiftEntry_model.php
index 4ff5675d..38db5959 100644
--- a/includes/model/ShiftEntry_model.php
+++ b/includes/model/ShiftEntry_model.php
@@ -74,8 +74,10 @@ function ShiftEntries_by_shift($shift_id)
*/
function ShiftEntry_create($shift_entry)
{
- mail_shift_assign(User($shift_entry['UID']), Shift($shift_entry['SID']));
- return DB::insert('
+ $user = User($shift_entry['UID']);
+ $shift = Shift($shift_entry['SID']);
+ mail_shift_assign($user, $shift);
+ $result = DB::insert('
INSERT INTO `ShiftEntry` (
`SID`,
`TID`,
@@ -95,6 +97,13 @@ function ShiftEntry_create($shift_entry)
(int)$shift_entry['freeloaded'],
]
);
+ engelsystem_log(
+ 'User ' . User_Nick_render($user)
+ . ' signed up for shift ' . $shift['name']
+ . ' from ' . date('Y-m-d H:i', $shift['start'])
+ . ' to ' . date('Y-m-d H:i', $shift['end'])
+ );
+ return $result;
}
/**