summaryrefslogtreecommitdiff
path: root/includes/pages/user_myshifts.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-12-07 17:07:19 +0100
committerPhilip Häusler <msquare@notrademark.de>2014-12-07 17:07:19 +0100
commit0a74ab94a8ebc93a7624e0bef90dfd7d8024deaa (patch)
tree1225951d1094987212311b61b94482fb8f2b31e1 /includes/pages/user_myshifts.php
parent514d2aca641f2c6fd9262e575153824e2cf977f1 (diff)
add shift entry delete model
Diffstat (limited to 'includes/pages/user_myshifts.php')
-rw-r--r--includes/pages/user_myshifts.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php
index d1c60dd6..41ea9381 100644
--- a/includes/pages/user_myshifts.php
+++ b/includes/pages/user_myshifts.php
@@ -77,15 +77,16 @@ function user_myshifts() {
if (count($shift) > 0) {
$shift = $shift[0];
if (($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges)) {
- sql_query("DELETE FROM `ShiftEntry` WHERE `id`=" . sql_escape($id) . " LIMIT 1");
- $msg .= success(_("You have been signed off from the shift."), true);
+ $result = ShiftEntry_delete($id);
+ if ($result === false)
+ engelsystem_error('Unable to delete shift entry.');
+ success(_("You have been signed off from the shift."));
} else
- $msg .= error(_("It's too late to sign yourself off the shift. If neccessary, ask the dispatcher to do so."), true);
+ error(_("It's too late to sign yourself off the shift. If neccessary, ask the dispatcher to do so."));
} else
redirect(page_link_to('user_myshifts'));
}
- msg();
redirect(page_link_to('users') . '&action=view');
}
?>