|
|
|
@ -140,7 +140,7 @@ function User_delete_view($user)
|
|
|
|
|
return page_with_title(sprintf(__('Delete %s'), User_Nick_render($user)), [
|
|
|
|
|
msg(),
|
|
|
|
|
buttons([
|
|
|
|
|
button(user_edit_link($user->id), glyph('chevron-left') . __('back'))
|
|
|
|
|
button(user_edit_link($user->id), icon('chevron-left') . __('back'))
|
|
|
|
|
]),
|
|
|
|
|
error(
|
|
|
|
|
__('Do you really want to delete the user including all his shifts and every other piece of his data?'),
|
|
|
|
@ -164,7 +164,7 @@ function User_edit_vouchers_view($user)
|
|
|
|
|
return page_with_title(sprintf(__('%s\'s vouchers'), User_Nick_render($user)), [
|
|
|
|
|
msg(),
|
|
|
|
|
buttons([
|
|
|
|
|
button(user_link($user->id), glyph('chevron-left') . __('back'))
|
|
|
|
|
button(user_link($user->id), icon('chevron-left') . __('back'))
|
|
|
|
|
]),
|
|
|
|
|
info(sprintf(
|
|
|
|
|
__('Angel should receive at least %d vouchers.'),
|
|
|
|
@ -208,12 +208,12 @@ function Users_view(
|
|
|
|
|
$u['first_name'] = $user->personalData->first_name;
|
|
|
|
|
$u['last_name'] = $user->personalData->last_name;
|
|
|
|
|
$u['dect'] = sprintf('<a href="tel:%s">%1$s</a>', $user->contact->dect);
|
|
|
|
|
$u['arrived'] = glyph_bool($user->state->arrived);
|
|
|
|
|
$u['arrived'] = icon_bool($user->state->arrived);
|
|
|
|
|
$u['got_voucher'] = $user->state->got_voucher;
|
|
|
|
|
$u['freeloads'] = $user->getAttribute('freeloads');
|
|
|
|
|
$u['active'] = glyph_bool($user->state->active);
|
|
|
|
|
$u['force_active'] = glyph_bool($user->state->force_active);
|
|
|
|
|
$u['got_shirt'] = glyph_bool($user->state->got_shirt);
|
|
|
|
|
$u['active'] = icon_bool($user->state->active);
|
|
|
|
|
$u['force_active'] = icon_bool($user->state->force_active);
|
|
|
|
|
$u['got_shirt'] = icon_bool($user->state->got_shirt);
|
|
|
|
|
$u['shirt_size'] = $user->personalData->shirt_size;
|
|
|
|
|
$u['arrival_date'] = $user->personalData->planned_arrival_date
|
|
|
|
|
? $user->personalData->planned_arrival_date->format(__('Y-m-d')) : '';
|
|
|
|
@ -221,7 +221,7 @@ function Users_view(
|
|
|
|
|
? $user->personalData->planned_departure_date->format(__('Y-m-d')) : '';
|
|
|
|
|
$u['last_login_at'] = $user->last_login_at ? $user->last_login_at->format(__('m/d/Y h:i a')) : '';
|
|
|
|
|
$u['actions'] = table_buttons([
|
|
|
|
|
button_glyph(page_link_to('admin_user', ['id' => $user->id]), 'edit', 'btn-xs')
|
|
|
|
|
button_icon(page_link_to('admin_user', ['id' => $user->id]), 'pencil-square', 'btn-xs')
|
|
|
|
|
]);
|
|
|
|
|
$usersList[] = $u;
|
|
|
|
|
}
|
|
|
|
@ -269,7 +269,7 @@ function Users_view(
|
|
|
|
|
return page_with_title(__('All users'), [
|
|
|
|
|
msg(),
|
|
|
|
|
buttons([
|
|
|
|
|
button(page_link_to('register'), glyph('plus') . __('New user'))
|
|
|
|
|
button(page_link_to('register'), icon('plus-lg') . __('New user'))
|
|
|
|
|
]),
|
|
|
|
|
table($user_table_headers, $usersList)
|
|
|
|
|
]);
|
|
|
|
@ -390,9 +390,9 @@ function User_view_myshift($shift, $user_source, $its_me)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$myshift = [
|
|
|
|
|
'date' => glyph('calendar')
|
|
|
|
|
'date' => icon('calendar')
|
|
|
|
|
. date('Y-m-d', $shift['start']) . '<br>'
|
|
|
|
|
. glyph('time') . date('H:i', $shift['start'])
|
|
|
|
|
. icon('clock') . date('H:i', $shift['start'])
|
|
|
|
|
. ' - '
|
|
|
|
|
. date('H:i', $shift['end']),
|
|
|
|
|
'duration' => sprintf('%.2f', ($shift['end'] - $shift['start']) / 3600) . ' h',
|
|
|
|
@ -418,19 +418,19 @@ function User_view_myshift($shift, $user_source, $its_me)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$myshift['actions'] = [
|
|
|
|
|
button(shift_link($shift), glyph('eye-open') . __('view'), 'btn-xs')
|
|
|
|
|
button(shift_link($shift), icon('eye') . __('view'), 'btn-xs')
|
|
|
|
|
];
|
|
|
|
|
if ($its_me || auth()->can('user_shifts_admin')) {
|
|
|
|
|
$myshift['actions'][] = button(
|
|
|
|
|
page_link_to('user_myshifts', ['edit' => $shift['id'], 'id' => $user_source->id]),
|
|
|
|
|
glyph('edit') . __('edit'),
|
|
|
|
|
icon('pencil-square') . __('edit'),
|
|
|
|
|
'btn-xs'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
if (Shift_signout_allowed($shift, ['id' => $shift['TID']], $user_source->id)) {
|
|
|
|
|
$myshift['actions'][] = button(
|
|
|
|
|
shift_entry_delete_link($shift),
|
|
|
|
|
glyph('trash') . __('sign off'),
|
|
|
|
|
icon('trash') . __('sign off'),
|
|
|
|
|
'btn-xs'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
@ -518,19 +518,19 @@ function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege)
|
|
|
|
|
$actions = table_buttons([
|
|
|
|
|
button(
|
|
|
|
|
user_worklog_edit_link($worklog),
|
|
|
|
|
glyph('edit') . __('edit'),
|
|
|
|
|
icon('pencil-square') . __('edit'),
|
|
|
|
|
'btn-xs'
|
|
|
|
|
),
|
|
|
|
|
button(
|
|
|
|
|
user_worklog_delete_link($worklog),
|
|
|
|
|
glyph('trash') . __('delete'),
|
|
|
|
|
icon('trash') . __('delete'),
|
|
|
|
|
'btn-xs'
|
|
|
|
|
)
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
'date' => glyph('calendar') . date('Y-m-d', $worklog->worked_at->timestamp),
|
|
|
|
|
'date' => icon('calendar') . date('Y-m-d', $worklog->worked_at->timestamp),
|
|
|
|
|
'duration' => sprintf('%.2f', $worklog->hours) . ' h',
|
|
|
|
|
'room' => '',
|
|
|
|
|
'shift_info' => __('Work log entry'),
|
|
|
|
@ -620,11 +620,11 @@ function User_view(
|
|
|
|
|
buttons([
|
|
|
|
|
$admin_user_privilege ? button(
|
|
|
|
|
page_link_to('admin_user', ['id' => $user_source->id]),
|
|
|
|
|
glyph('edit') . __('edit')
|
|
|
|
|
icon('pencil-square') . __('edit')
|
|
|
|
|
) : '',
|
|
|
|
|
$admin_user_privilege ? button(
|
|
|
|
|
user_driver_license_edit_link($user_source),
|
|
|
|
|
glyph('road') . __('driving license')
|
|
|
|
|
icon('wallet2') . __('driving license')
|
|
|
|
|
) : '',
|
|
|
|
|
(($admin_user_privilege || $auth->can('admin_arrive')) && !$user_source->state->arrived) ?
|
|
|
|
|
form([
|
|
|
|
@ -637,23 +637,23 @@ function User_view(
|
|
|
|
|
'users',
|
|
|
|
|
['action' => 'edit_vouchers', 'user_id' => $user_source->id]
|
|
|
|
|
),
|
|
|
|
|
glyph('cutlery') . __('Edit vouchers')
|
|
|
|
|
icon('file-binary-fill') . __('Edit vouchers')
|
|
|
|
|
) : '',
|
|
|
|
|
$admin_user_worklog_privilege ? button(
|
|
|
|
|
user_worklog_add_link($user_source),
|
|
|
|
|
glyph('list') . __('Add work log')
|
|
|
|
|
icon('list') . __('Add work log')
|
|
|
|
|
) : '',
|
|
|
|
|
$its_me ? button(
|
|
|
|
|
page_link_to('user_settings'),
|
|
|
|
|
glyph('list-alt') . __('Settings')
|
|
|
|
|
icon('gear') . __('Settings')
|
|
|
|
|
) : '',
|
|
|
|
|
($its_me && $auth->can('ical')) ? button(
|
|
|
|
|
page_link_to('ical', ['key' => $user_source->api_key]),
|
|
|
|
|
glyph('calendar') . __('iCal Export')
|
|
|
|
|
icon('calendar') . __('iCal Export')
|
|
|
|
|
) : '',
|
|
|
|
|
($its_me && $auth->can('shifts_json_export')) ? button(
|
|
|
|
|
page_link_to('shifts_json_export', ['key' => $user_source->api_key]),
|
|
|
|
|
glyph('export') . __('JSON Export')
|
|
|
|
|
icon('box-arrow-up-right') . __('JSON Export')
|
|
|
|
|
) : '',
|
|
|
|
|
($its_me && (
|
|
|
|
|
$auth->can('shifts_json_export')
|
|
|
|
@ -661,14 +661,14 @@ function User_view(
|
|
|
|
|
|| $auth->can('atom')
|
|
|
|
|
)) ? button(
|
|
|
|
|
page_link_to('user_myshifts', ['reset' => 1]),
|
|
|
|
|
glyph('repeat') . __('Reset API key')
|
|
|
|
|
icon('arrow-repeat') . __('Reset API key')
|
|
|
|
|
) : ''
|
|
|
|
|
])
|
|
|
|
|
])
|
|
|
|
|
]),
|
|
|
|
|
div('row', [
|
|
|
|
|
div('col-md-2', [
|
|
|
|
|
heading(glyph('phone')
|
|
|
|
|
heading(icon('phone')
|
|
|
|
|
. '<a href="tel:' . $user_source->contact->dect . '">'
|
|
|
|
|
. $user_source->contact->dect, 1)
|
|
|
|
|
. '</a>'
|
|
|
|
@ -681,7 +681,7 @@ function User_view(
|
|
|
|
|
($its_me || $admin_user_privilege) ? '<h2>' . __('Shifts') . '</h2>' : '',
|
|
|
|
|
$myshifts_table,
|
|
|
|
|
($its_me && $nightShiftsConfig['enabled']) ? info(
|
|
|
|
|
glyph('info-sign') . sprintf(
|
|
|
|
|
icon('info-lg') . sprintf(
|
|
|
|
|
__('Your night shifts between %d and %d am count twice.'),
|
|
|
|
|
$nightShiftsConfig['start'],
|
|
|
|
|
$nightShiftsConfig['end']
|
|
|
|
@ -734,7 +734,7 @@ function User_view_state_user($user_source)
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
if ($user_source->state->arrived) {
|
|
|
|
|
$state[] = '<span class="text-success">' . glyph('home') . __('Arrived') . '</span>';
|
|
|
|
|
$state[] = '<span class="text-success">' . icon('house') . __('Arrived') . '</span>';
|
|
|
|
|
} else {
|
|
|
|
|
$state[] = '<span class="text-danger">' . __('Not arrived') . '</span>';
|
|
|
|
|
}
|
|
|
|
@ -755,13 +755,13 @@ function User_view_state_admin($freeloader, $user_source)
|
|
|
|
|
$state = [];
|
|
|
|
|
|
|
|
|
|
if ($freeloader) {
|
|
|
|
|
$state[] = '<span class="text-danger">' . glyph('exclamation-sign') . __('Freeloader') . '</span>';
|
|
|
|
|
$state[] = '<span class="text-danger">' . icon('exclamation-circle') . __('Freeloader') . '</span>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$state[] = User_shift_state_render($user_source);
|
|
|
|
|
|
|
|
|
|
if ($user_source->state->arrived) {
|
|
|
|
|
$state[] = '<span class="text-success">' . glyph('home')
|
|
|
|
|
$state[] = '<span class="text-success">' . icon('house')
|
|
|
|
|
. sprintf(
|
|
|
|
|
__('Arrived at %s'),
|
|
|
|
|
$user_source->state->arrival_date ? $user_source->state->arrival_date->format('Y-m-d') : ''
|
|
|
|
@ -791,7 +791,7 @@ function User_view_state_admin($freeloader, $user_source)
|
|
|
|
|
$availableCount = max($voucherCount, $availableCount);
|
|
|
|
|
if ($user_source->state->got_voucher > 0) {
|
|
|
|
|
$state[] = '<span class="text-success">'
|
|
|
|
|
. glyph('cutlery')
|
|
|
|
|
. icon('file-binary-fill')
|
|
|
|
|
. __('Got %s of %s vouchers', [$voucherCount, $availableCount])
|
|
|
|
|
. '</span>';
|
|
|
|
|
} else {
|
|
|
|
@ -817,7 +817,7 @@ function User_angeltypes_render($user_angeltypes)
|
|
|
|
|
$class = 'text-warning';
|
|
|
|
|
}
|
|
|
|
|
$output[] = '<a href="' . angeltype_link($angeltype['id']) . '" class="' . $class . '">'
|
|
|
|
|
. ($angeltype['supporter'] ? glyph('education') : '') . $angeltype['name']
|
|
|
|
|
. ($angeltype['supporter'] ? icon('patch-check') : '') . $angeltype['name']
|
|
|
|
|
. '</a>';
|
|
|
|
|
}
|
|
|
|
|
return div('col-md-2', [
|
|
|
|
|