summaryrefslogtreecommitdiff
path: root/includes/pages/user_myshifts.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2015-08-14 09:28:32 +0200
committerPhilip Häusler <msquare@notrademark.de>2015-08-14 09:28:32 +0200
commit42150cc6e9acdeba2c2b39dbde3fa69c69a29e49 (patch)
treed23c59c3ee6336113416631ca2d0ee83db797025 /includes/pages/user_myshifts.php
parent3d7e378b67807fe50bf893eed9de040dfdc7add3 (diff)
add log entry for deleting own shift entries
Diffstat (limited to 'includes/pages/user_myshifts.php')
-rw-r--r--includes/pages/user_myshifts.php7
1 files changed, 6 insertions, 1 deletions
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."));