$bugfixes

This commit is contained in:
Igor Scheller 2018-08-29 23:10:05 +02:00
parent e8f8fc7f5f
commit 5456fea503
2 changed files with 10 additions and 1 deletions

View File

@ -293,7 +293,9 @@ function Shift_free_entries($needed_angeltype, $shift_entries)
$taken++; $taken++;
} }
} }
return max(0, $needed_angeltype['count'] - $taken);
$neededAngels = !empty($needed_angeltype) ? $needed_angeltype['count'] : 0;
return max(0, $neededAngels - $taken);
} }
/** /**

View File

@ -39,6 +39,10 @@ function User_tshirt_score($user)
$user['UID'], $user['UID'],
time() time()
]); ]);
if (!isset($result_shifts['tshirt_score'])) {
$result_shifts = ['tshirt_score' => 0];
}
$result_worklog = DB::selectOne(' $result_worklog = DB::selectOne('
SELECT SUM(`work_hours`) AS `tshirt_score` SELECT SUM(`work_hours`) AS `tshirt_score`
FROM `User` FROM `User`
@ -49,6 +53,9 @@ function User_tshirt_score($user)
$user['UID'], $user['UID'],
time() time()
]); ]);
if (!isset($result_worklog['tshirt_score'])) {
$result_worklog = ['tshirt_score' => 0];
}
return $result_shifts['tshirt_score'] + $result_worklog['tshirt_score']; return $result_shifts['tshirt_score'] + $result_worklog['tshirt_score'];
} }