From 42150cc6e9acdeba2c2b39dbde3fa69c69a29e49 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 14 Aug 2015 09:28:32 +0200 Subject: add log entry for deleting own shift entries --- includes/pages/user_myshifts.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'includes/pages') diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php index 4a6a1838..ee3cf1be 100644 --- a/includes/pages/user_myshifts.php +++ b/includes/pages/user_myshifts.php @@ -79,7 +79,7 @@ function user_myshifts() { } elseif (isset($_REQUEST['cancel']) && preg_match("/^[0-9]*$/", $_REQUEST['cancel'])) { $id = $_REQUEST['cancel']; $shift = sql_select(" - SELECT `Shifts`.`start` + SELECT * FROM `Shifts` INNER JOIN `ShiftEntry` USING (`SID`) WHERE `ShiftEntry`.`id`='" . sql_escape($id) . "' AND `UID`='" . sql_escape($shifts_user['UID']) . "'"); @@ -89,6 +89,11 @@ function user_myshifts() { $result = ShiftEntry_delete($id); if ($result === false) engelsystem_error('Unable to delete shift entry.'); + $room = Room($shift['RID']); + $angeltype = AngelType($shift['TID']); + $shifttype = ShiftType($shift['shifttype_id']); + + engelsystem_log("Deleted own 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']); success(_("You have been signed off from the shift.")); } else error(_("It's too late to sign yourself off the shift. If neccessary, ask the dispatcher to do so.")); -- cgit v1.2.3-54-g00ecf