From 4e09ee3eb255160c88a378375d69123a3e000497 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Thu, 11 Oct 2018 01:26:34 +0200 Subject: Replaced more user related stuff (Contains some buggy stuff too...) --- includes/model/ShiftEntry_model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'includes/model/ShiftEntry_model.php') 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'])); } /** -- cgit v1.2.3-54-g00ecf