From 2d587478a1094969fbb44bde29b34b034868db70 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Mon, 22 Dec 2014 20:06:37 +0100 Subject: fix different bugs with shift types --- includes/model/Shifts_model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'includes/model/Shifts_model.php') diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php index eca0d141..ee9c3773 100644 --- a/includes/model/Shifts_model.php +++ b/includes/model/Shifts_model.php @@ -20,7 +20,7 @@ function Shift_delete($shift_id) { * Update a shift. */ function Shift_update($shift) { - $old_shift = Shift($shift['SID']); + $shift['name'] = ShiftType($shift['shifttype_id'])['name']; mail_shift_change(Shift($shift['SID']), $shift); return sql_query("UPDATE `Shifts` SET @@ -43,7 +43,7 @@ function Shift_update_by_psid($shift) { return false; if (count($shift_source) == 0) return null; - $shift['SID'] = $shift_source['SID']; + $shift['SID'] = $shift_source[0]['SID']; return Shift_update($shift); } @@ -146,6 +146,7 @@ function Shift($id) { $result = $shifts_source[0]; $result['ShiftEntry'] = $shiftsEntry_source; + $result['NeedAngels'] = []; $temp = NeededAngelTypes_by_shift($id); foreach ($temp as $e) { -- cgit v1.2.3-54-g00ecf