add log entry for deleting own shift entries

This commit is contained in:
Philip Häusler 2015-08-14 09:28:32 +02:00
parent 3d7e378b67
commit 42150cc6e9
1 changed files with 6 additions and 1 deletions

View File

@ -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."));