summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Favre <gnomus@gnomus.de>2014-12-07 19:44:59 +0100
committerFelix Favre <gnomus@gnomus.de>2014-12-07 19:44:59 +0100
commit07b9de84c5c28631173c848fe701f4cd9468ba81 (patch)
treea92519928d6a21794d5e746aa932be46dbbb0a2a
parent8f918422f4fd61509f6ce2ca03feddd77328dc7c (diff)
use mail helpers for shift delete and shift change
-rw-r--r--includes/model/Shifts_model.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index 28f84c26..43ff0c91 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -11,6 +11,9 @@ function Shift_delete_by_psid($shift_psid) {
* Delete a shift.
*/
function Shift_delete($shift_id) {
+
+ mail_shift_delete(Shift($shift_id));
+
return sql_query("DELETE FROM `Shifts` WHERE `SID`=" . sql_escape($shift_id));
}
@@ -18,6 +21,10 @@ function Shift_delete($shift_id) {
* Update a shift.
*/
function Shift_update($shift) {
+
+ $old_shift = Shift($shift['SID']);
+ mail_shift_change(Shift($shift['SID']), $shift);
+
return sql_query("UPDATE `Shifts` SET
`start`=" . sql_escape($shift['start']) . ",
`end`=" . sql_escape($shift['end']) . ",
@@ -173,4 +180,4 @@ function Shifts() {
return $shifts_source;
}
-?> \ No newline at end of file
+?>