summaryrefslogtreecommitdiff
path: root/includes/model/ShiftEntry_model.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/model/ShiftEntry_model.php')
-rw-r--r--includes/model/ShiftEntry_model.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/model/ShiftEntry_model.php b/includes/model/ShiftEntry_model.php
index c8ca5ef4..593e40b2 100644
--- a/includes/model/ShiftEntry_model.php
+++ b/includes/model/ShiftEntry_model.php
@@ -77,7 +77,6 @@ function ShiftEntry_create($shift_entry)
{
$user = User::find($shift_entry['UID']);
$shift = Shift($shift_entry['SID']);
- mail_shift_assign($user, $shift);
$result = DB::insert('
INSERT INTO `ShiftEntry` (
`SID`,
@@ -104,6 +103,7 @@ function ShiftEntry_create($shift_entry)
. ' from ' . date('Y-m-d H:i', $shift['start'])
. ' to ' . date('Y-m-d H:i', $shift['end'])
);
+ mail_shift_assign($user, $shift);
return $result;
}
@@ -151,7 +151,6 @@ function ShiftEntry($shift_entry_id)
*/
function ShiftEntry_delete($shiftEntry)
{
- mail_shift_removed(User::find($shiftEntry['UID']), Shift($shiftEntry['SID']));
DB::delete('DELETE FROM `ShiftEntry` WHERE `id` = ?', [$shiftEntry['id']]);
$signout_user = User::find($shiftEntry['UID']);
@@ -167,6 +166,8 @@ function ShiftEntry_delete($shiftEntry)
. ' to ' . date('Y-m-d H:i', $shift['end'])
. ' as ' . $angeltype['name']
);
+
+ mail_shift_removed(User::find($shiftEntry['UID']), Shift($shiftEntry['SID']));
}
/**