From fd85034e7f2277730f4ea4de49dade6d125832dd Mon Sep 17 00:00:00 2001 From: msquare Date: Tue, 19 Dec 2017 20:58:01 +0100 Subject: redo shift signoff and icons for delete/confirm/acknowledgment questions --- includes/model/ShiftEntry_model.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'includes/model/ShiftEntry_model.php') diff --git a/includes/model/ShiftEntry_model.php b/includes/model/ShiftEntry_model.php index bcc28f05..01b2369e 100644 --- a/includes/model/ShiftEntry_model.php +++ b/includes/model/ShiftEntry_model.php @@ -134,13 +134,26 @@ function ShiftEntry($shift_entry_id) /** * Delete a shift entry. * - * @param int $shift_entry_id + * @param array $shiftEntry */ -function ShiftEntry_delete($shift_entry_id) +function ShiftEntry_delete($shiftEntry) { - $shift_entry = ShiftEntry($shift_entry_id); - mail_shift_removed(User($shift_entry['UID']), Shift($shift_entry['SID'])); + mail_shift_removed(User($shiftEntry['UID']), Shift($shiftEntry['SID'])); DB::delete('DELETE FROM `ShiftEntry` WHERE `id` = ?', [$shift_entry_id]); + + $signout_user = User($shiftEntry['UID']); + $shift = Shift($shiftEntry['SID']); + $shifttype = ShiftType($shift['shifttype_id']); + $room = Room($shift['RID']); + $angeltype = AngelType($shiftEntry['TID']); + + engelsystem_log( + 'Shift signout: '. User_Nick_render($signout_user) . ' from shift ' . $shifttype['name'] + . ' at ' . $room['Name'] + . ' from ' . date('Y-m-d H:i', $shift['start']) + . ' to ' . date('Y-m-d H:i', $shift['end']) + . ' as ' . $angeltype['name'] + ); } /** -- cgit v1.2.3-54-g00ecf