summaryrefslogtreecommitdiff
path: root/includes/model
diff options
context:
space:
mode:
Diffstat (limited to 'includes/model')
-rw-r--r--includes/model/NeededAngelTypes_model.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/includes/model/NeededAngelTypes_model.php b/includes/model/NeededAngelTypes_model.php
index 76796869..3bd3660f 100644
--- a/includes/model/NeededAngelTypes_model.php
+++ b/includes/model/NeededAngelTypes_model.php
@@ -87,14 +87,15 @@ function NeededAngelTypes_by_shift($shiftId) {
$shift_entries = ShiftEntries_by_shift($shiftId);
$needed_angeltypes = [];
foreach ($needed_angeltypes_source as $angeltype) {
+ $angeltype['shift_entries'] = [];
$angeltype['taken'] = 0;
- foreach($shift_entries as $shift_entry) {
- if($shift_entry['TID']==$angeltype['id'] && $shift_entry['freeloaded'] == 0) {
- $angeltype['taken']++;
+ foreach ($shift_entries as $shift_entry) {
+ if ($shift_entry['TID'] == $angeltype['angel_type_id'] && $shift_entry['freeloaded'] == 0) {
+ $angeltype['taken'] ++;
+ $angeltype['shift_entries'][] = $shift_entry;
}
}
- $angeltype['shift_entries'] = $shift_entries;
$needed_angeltypes[] = $angeltype;
}