summaryrefslogtreecommitdiff
path: root/includes/model/Shifts_model.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-12-29 15:24:57 +0100
committermsquare <msquare@notrademark.de>2016-12-29 15:24:57 +0100
commit51eb22a1c651ffabd10d772b7e06ec05c46c5b86 (patch)
tree804f4e8dd91da9d22b70741be249d725f4191c62 /includes/model/Shifts_model.php
parent3fbd62ab7de38dc66e9694c89e8242c4e9249003 (diff)
fix shift signup state calculation
Diffstat (limited to 'includes/model/Shifts_model.php')
-rw-r--r--includes/model/Shifts_model.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index 9d91b00c..a9a1cd7f 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -229,6 +229,7 @@ function Shift_signup_allowed_angeltype_supporter($angeltype, $needed_angeltype,
*/
function Shift_signup_allowed_admin($angeltype, $needed_angeltype, $shift_entries) {
$free_entries = Shift_free_entries($needed_angeltype, $shift_entries);
+
if ($free_entries == 0) {
// User shift admins may join anybody in every shift
return new ShiftSignupState(ShiftSignupState::ADMIN, $free_entries);
@@ -250,6 +251,10 @@ function Shift_signup_allowed_admin($angeltype, $needed_angeltype, $shift_entrie
function Shift_signup_allowed($signup_user, $shift, $angeltype, $user_angeltype = null, $user_shifts = null, $needed_angeltype, $shift_entries) {
global $user, $privileges;
+// if($shift['SID']==1907) {
+// print_r(Shift_signup_allowed_admin($angeltype, $needed_angeltype, $shift_entries));
+// }
+
if (in_array('user_shifts_admin', $privileges)) {
return Shift_signup_allowed_admin($angeltype, $needed_angeltype, $shift_entries);
}