no signup for shifts for angels that are not arrived

This commit is contained in:
msquare 2016-12-27 19:13:24 +01:00
parent d0e924ba25
commit 2840bb6198
2 changed files with 8 additions and 0 deletions

View File

@ -121,6 +121,10 @@ function Shift_free_entries($shift_id, $angeltype_id) {
function Shift_signup_allowed_angel($user, $shift, $angeltype, $user_angeltype, $user_shifts, $angeltype_supporter = false) { function Shift_signup_allowed_angel($user, $shift, $angeltype, $user_angeltype, $user_shifts, $angeltype_supporter = false) {
$free_entries = Shift_free_entries($shift['SID'], $angeltype['id']); $free_entries = Shift_free_entries($shift['SID'], $angeltype['id']);
if($user['Gekommen'] == 0) {
return new ShiftSignupState(ShiftSignupState::SHIFT_ENDED, $free_entries);
}
if ($user_shifts == null) { if ($user_shifts == null) {
$user_shifts = Shifts_by_user($user); $user_shifts = Shifts_by_user($user);
} }

View File

@ -78,6 +78,10 @@ class ShiftCalendarShiftRenderer {
} }
$html .= $angeltype_html; $html .= $angeltype_html;
} }
if ($shift_signup_state == null) {
$shift_signup_state = new ShiftSignupState(ShiftSignupState::SHIFT_ENDED, 0);
}
if (in_array('user_shifts_admin', $privileges)) { if (in_array('user_shifts_admin', $privileges)) {
$html .= '<li class="list-group-item">' . button(page_link_to('user_shifts') . '&amp;shift_id=' . $shift['SID'] . '&amp;type_id=' . $angeltype['id'], _("Add more angels"), 'btn-xs') . '</li>'; $html .= '<li class="list-group-item">' . button(page_link_to('user_shifts') . '&amp;shift_id=' . $shift['SID'] . '&amp;type_id=' . $angeltype['id'], _("Add more angels"), 'btn-xs') . '</li>';
} }