summaryrefslogtreecommitdiff
path: root/includes/model
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-12-22 20:06:37 +0100
committerPhilip Häusler <msquare@notrademark.de>2014-12-22 20:06:37 +0100
commit2d587478a1094969fbb44bde29b34b034868db70 (patch)
treededbfa93c2ac88170e91306b4907f4a7d14ee221 /includes/model
parent702047de5391b968137966077103cbb6d0a24dd8 (diff)
fix different bugs with shift types
Diffstat (limited to 'includes/model')
-rw-r--r--includes/model/Shifts_model.php5
1 files changed, 3 insertions, 2 deletions
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) {