_("Please select..."),
'S' => "S",
'M' => "M",
'L' => "L",
'XL' => "XL",
'2XL' => "2XL",
'3XL' => "3XL",
'4XL' => "4XL",
'5XL' => "5XL",
'S-G' => "S Girl",
'M-G' => "M Girl",
'L-G' => "L Girl",
'XL-G' => "XL Girl"
);
function User_shift_state_render($user) {
$upcoming_shifts = ShiftEntries_upcoming_for_user($user);
if ($upcoming_shifts === false)
return false;
if (count($upcoming_shifts) == 0)
return '' . _("Free") . '';
if ($upcoming_shifts[0]['start'] > time())
if ($upcoming_shifts[0]['start'] - time() > 3600)
return '' . _("Next shift in %c") . '';
else
return '' . _("Next shift in %c") . '';
$halfway = ($upcoming_shifts[0]['start'] + $upcoming_shifts[0]['end']) / 2;
if (time() < $halfway)
return '' . _("Shift startet %c ago") . '';
else
return '' . _("Shift ends in %c") . '';
}
function User_view($user_source, $admin_user_privilege, $freeloader, $user_angeltypes, $user_groups, $shifts, $its_me) {
global $LETZTES_AUSTRAGEN, $privileges;
$user_name = htmlspecialchars($user_source['Vorname']) . " " . htmlspecialchars($user_source['Name']);
$myshifts_table = array();
$html = "";
$timesum = 0;
foreach ($shifts as $shift) {
$shift_info = $shift['name'];
foreach ($shift['needed_angeltypes'] as $needed_angel_type) {
$shift_info .= '
' . $needed_angel_type['name'] . ': ';
$shift_entries = array();
foreach ($needed_angel_type['users'] as $user_source) {
if ($its_me)
$member = '' . User_Nick_render($user_source) . '';
else
$member = User_Nick_render($user_source);
if ($user_source['freeloaded'])
$member = '' . $member . '';
$shift_entries[] = $member;
}
$shift_info .= join(", ", $shift_entries);
}
$myshift = array(
'date' => date("Y-m-d", $shift['start']),
'time' => date("H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']),
'room' => $shift['Name'],
'shift_info' => $shift_info,
'comment' => $shift['Comment']
);
if ($shift['freeloaded']) {
if (in_array("user_shifts_admin", $privileges))
$myshift['comment'] .= '
' . _("Freeloaded") . ': ' . $shift['freeload_comment'] . '
'; else $myshift['comment'] .= '' . _("Freeloaded") . '
'; } $myshift['actions'] = ""; if ($its_me || in_array('user_shifts_admin', $privileges)) $myshift['actions'] .= img_button(page_link_to('user_myshifts') . '&edit=' . $shift['id'] . '&id=' . $user_source['UID'], 'pencil', _("edit")); if (($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges)) $myshift['actions'] .= img_button(page_link_to('user_myshifts') . ((! $its_me) ? '&id=' . $user_source['UID'] : '') . '&cancel=' . $shift['id'], 'cross', _("sign off")); if ($shift['freeloaded']) $timesum += - 2 * ($shift['end'] - $shift['start']); else $timesum += $shift['end'] - $shift['start']; $myshifts_table[] = $myshift; } if (count($myshifts_table) > 0) $myshifts_table[] = array( 'date' => '' . _("Sum:") . '', 'time' => "" . round($timesum / (60 * 60), 1) . " h", 'room' => "", 'shift_info' => "", 'comment' => "", 'actions' => "" ); return page_with_title(' ' . htmlspecialchars($user_source['Nick']) . ' ' . $user_name . '', array( msg(), div('row', array( div('col-md-3', array( '