From afd7c59d1d1e07c61099e3cf6a4c66af883c3302 Mon Sep 17 00:00:00 2001 From: msquare Date: Tue, 19 Dec 2017 22:24:06 +0100 Subject: fix shift entry delete --- includes/controller/shift_entries_controller.php | 2 +- includes/model/ShiftEntry_model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/controller/shift_entries_controller.php b/includes/controller/shift_entries_controller.php index 0b37be6c..e9590321 100644 --- a/includes/controller/shift_entries_controller.php +++ b/includes/controller/shift_entries_controller.php @@ -255,7 +255,7 @@ function shift_entry_load() { */ function shift_entry_delete_controller() { - global $privileges, $user; + global $user; $request = request(); $shiftEntry = shift_entry_load(); diff --git a/includes/model/ShiftEntry_model.php b/includes/model/ShiftEntry_model.php index 01b2369e..4ff5675d 100644 --- a/includes/model/ShiftEntry_model.php +++ b/includes/model/ShiftEntry_model.php @@ -139,7 +139,7 @@ function ShiftEntry($shift_entry_id) function ShiftEntry_delete($shiftEntry) { mail_shift_removed(User($shiftEntry['UID']), Shift($shiftEntry['SID'])); - DB::delete('DELETE FROM `ShiftEntry` WHERE `id` = ?', [$shift_entry_id]); + DB::delete('DELETE FROM `ShiftEntry` WHERE `id` = ?', [$shiftEntry['id']]); $signout_user = User($shiftEntry['UID']); $shift = Shift($shiftEntry['SID']); -- cgit v1.2.3-70-g09d2