@ -13,7 +13,14 @@
function ShiftEntry_delete_view_admin($shiftEntry, $shift, $angeltype, $signoff_user)
{
return page_with_title(ShiftEntry_delete_title(), [
info(sprintf(_('Do you want to sign off %s from shift %s from %s to %s as %s?'), User_Nick_render($signoff_user), $shift['name'], date('Y-m-d H:i', $shift['start']), date('Y-m-d H:i', $shift['end']), $angeltype['name']), true),
info(sprintf(
_('Do you want to sign off %s from shift %s from %s to %s as %s?'),
User_Nick_render($signoff_user),
$shift['name'],
date('Y-m-d H:i', $shift['start']),
date('Y-m-d H:i', $shift['end']),
$angeltype['name']
), true),
buttons([
button(user_link($signoff_user), glyph('remove') . _('cancel')),
button(shift_entry_delete_link($shiftEntry, [
@ -36,7 +43,13 @@ function ShiftEntry_delete_view_admin($shiftEntry, $shift, $angeltype, $signoff_
function ShiftEntry_delete_view($shiftEntry, $shift, $angeltype, $signoff_user)
{
return page_with_title(ShiftEntry_delete_title(), [
info(sprintf(_('Do you want to sign off from your shift %s from %s to %s as %s?'), $shift['name'], date('Y-m-d H:i', $shift['start']), date('Y-m-d H:i', $shift['end']), $angeltype['name']), true),
info(sprintf(
_('Do you want to sign off from your shift %s from %s to %s as %s?'),
$shift['name'],
date('Y-m-d H:i', $shift['start']),
date('Y-m-d H:i', $shift['end']),
$angeltype['name']
), true),
buttons([
button(user_link($signoff_user), glyph('remove') . _('cancel')),
button(shift_entry_delete_link($shiftEntry, [
@ -63,10 +76,14 @@ function ShiftEntry_delete_title()
* @param array $angeltypes_select
* @param array $signup_user
* @param array $users_select
* @return string
*/
function ShiftEntry_create_view_admin($shift, $room, $angeltype, $angeltypes_select, $signup_user, $users_select)
{
return page_with_title(ShiftEntry_create_title() . ': ' . $shift['name'] . ' < small class = "moment-countdown" data-timestamp = "' . $shift['start'] . '" > %c< / small > ', [
return page_with_title(
ShiftEntry_create_title() . ': ' . $shift['name']
. ' < small class = "moment-countdown" data-timestamp = "' . $shift['start'] . '" > %c< / small > ',
[
Shift_view_header($shift, $room),
info(_('Do you want to sign up the following user for this shift?'), true),
form([
@ -85,12 +102,16 @@ function ShiftEntry_create_view_admin($shift, $room, $angeltype, $angeltypes_sel
* @param array $angeltype
* @param array $signup_user
* @param array $users_select
* @return string
*/
function ShiftEntry_create_view_supporter($shift, $room, $angeltype, $signup_user, $users_select)
{
return page_with_title(ShiftEntry_create_title() . ': ' . $shift['name'] . ' < small class = "moment-countdown" data-timestamp = "' . $shift['start'] . '" > %c< / small > ', [
return page_with_title(ShiftEntry_create_title() . ': ' . $shift['name']
. ' < small class = "moment-countdown" data-timestamp = "' . $shift['start'] . '" > %c< / small > ',
[
Shift_view_header($shift, $room),
info(sprintf(_('Do you want to sign up the following user for this shift as %s?'), AngelType_name_render($angeltype)), true),
info(sprintf(_('Do you want to sign up the following user for this shift as %s?'),
AngelType_name_render($angeltype)), true),
form([
form_select('user_id', _('User'), $users_select, $signup_user['UID']),
form_submit('submit', glyph('ok') . _('Save'))
@ -105,10 +126,13 @@ function ShiftEntry_create_view_supporter($shift, $room, $angeltype, $signup_use
* @param array $room
* @param array $angeltype
* @param string $comment
* @return string
*/
function ShiftEntry_create_view_user($shift, $room, $angeltype, $comment)
{
return page_with_title(ShiftEntry_create_title() . ': ' . $shift['name'] . ' < small class = "moment-countdown" data-timestamp = "' . $shift['start'] . '" > %c< / small > ', [
return page_with_title(ShiftEntry_create_title() . ': ' . $shift['name']
. ' < small class = "moment-countdown" data-timestamp = "' . $shift['start'] . '" > %c< / small > ',
[
Shift_view_header($shift, $room),
info(sprintf(_('Do you want to sign up for this shift as %s?'), AngelType_name_render($angeltype)), true),
form([
@ -140,13 +164,26 @@ function ShiftEntry_create_title()
* @param bool $user_admin_shifts
* @return string
*/
function ShiftEntry_edit_view($angel, $date, $location, $title, $type, $comment, $freeloaded, $freeload_comment, $user_admin_shifts = false)
{
function ShiftEntry_edit_view(
$angel,
$date,
$location,
$title,
$type,
$comment,
$freeloaded,
$freeload_comment,
$user_admin_shifts = false
) {
$freeload_form = [];
if ($user_admin_shifts) {
$freeload_form = [
form_checkbox('freeloaded', _('Freeloaded'), $freeloaded),
form_textarea('freeload_comment', _('Freeload comment (Only for shift coordination):'), $freeload_comment)
form_textarea(
'freeload_comment',
_('Freeload comment (Only for shift coordination):'),
$freeload_comment
)
];
}
return page_with_title(_('Edit shift entry'), [