Require comma at last array element and no single line space
This commit is contained in:
parent
216185b65c
commit
ad360a70fb
|
@ -40,6 +40,8 @@
|
|||
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment" />
|
||||
<rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment" />
|
||||
<rule ref="Generic.Formatting.SpaceAfterCast" />
|
||||
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
|
||||
<rule ref="SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace"/>
|
||||
<rule ref="Squiz.Strings.DoubleQuoteUsage" />
|
||||
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
|
||||
<exclude-pattern>/includes</exclude-pattern>
|
||||
|
|
|
@ -357,7 +357,7 @@ return [
|
|||
'name' => env('SESSION_NAME', 'session'),
|
||||
|
||||
// Lifetime in days
|
||||
'lifetime' => env('SESSION_LIFETIME', 30)
|
||||
'lifetime' => env('SESSION_LIFETIME', 30),
|
||||
],
|
||||
|
||||
// IP addresses of reverse proxies that are trusted, can be an array or a comma separated list
|
||||
|
@ -380,7 +380,7 @@ return [
|
|||
'credits' => [
|
||||
'Contribution' => 'Please visit [engelsystem/engelsystem](https://github.com/engelsystem/engelsystem) if '
|
||||
. 'you want to contribute, have found any [bugs](https://github.com/engelsystem/engelsystem/issues) '
|
||||
. 'or need help.'
|
||||
. 'or need help.',
|
||||
],
|
||||
|
||||
// var dump server
|
||||
|
|
|
@ -17,7 +17,7 @@ class FixUserLanguages extends Migration
|
|||
$connection
|
||||
->table('users_settings')
|
||||
->update([
|
||||
'language' => $connection->raw('REPLACE(language, ".UTF-8", "")')
|
||||
'language' => $connection->raw('REPLACE(language, ".UTF-8", "")'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ class FixUserLanguages extends Migration
|
|||
$connection
|
||||
->table('users_settings')
|
||||
->update([
|
||||
'language' => $connection->raw('CONCAT(language, ".UTF-8")')
|
||||
'language' => $connection->raw('CONCAT(language, ".UTF-8")'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration
|
|||
|
||||
$connection->table('schedules')
|
||||
->update([
|
||||
'shift_type' => $connection->raw('(' . $query->toSql() . ')')
|
||||
'shift_type' => $connection->raw('(' . $query->toSql() . ')'),
|
||||
]);
|
||||
|
||||
$this->schema->table('schedules', function (Blueprint $table): void {
|
||||
|
|
|
@ -68,7 +68,7 @@ function angeltypes_about_controller()
|
|||
|
||||
return [
|
||||
__('Teams/Job description'),
|
||||
AngelTypes_about_view($angeltypes, (bool) $user)
|
||||
AngelTypes_about_view($angeltypes, (bool) $user),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ function angeltype_delete_controller()
|
|||
|
||||
return [
|
||||
sprintf(__('Delete angeltype %s'), $angeltype->name),
|
||||
AngelType_delete_view($angeltype)
|
||||
AngelType_delete_view($angeltype),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ function angeltype_edit_controller()
|
|||
|
||||
return [
|
||||
sprintf(__('Edit %s'), $angeltype->name),
|
||||
AngelType_edit_view($angeltype, $supporter_mode)
|
||||
AngelType_edit_view($angeltype, $supporter_mode),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ function angeltype_controller()
|
|||
$shiftsFilterRenderer,
|
||||
$shiftCalendarRenderer,
|
||||
$tab
|
||||
)
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -298,7 +298,7 @@ function angeltypes_list_controller()
|
|||
page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype->id]),
|
||||
icon('eye') . __('view'),
|
||||
'btn-sm'
|
||||
)
|
||||
),
|
||||
];
|
||||
|
||||
if (auth()->can('admin_angel_types')) {
|
||||
|
@ -346,7 +346,7 @@ function angeltypes_list_controller()
|
|||
|
||||
return [
|
||||
angeltypes_title(),
|
||||
AngelTypes_list_view($angeltypes, auth()->can('admin_angel_types'))
|
||||
AngelTypes_list_view($angeltypes, auth()->can('admin_angel_types')),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -131,6 +131,6 @@ function event_config_edit_controller()
|
|||
$event_start_date,
|
||||
$event_end_date,
|
||||
$teardown_end_date
|
||||
)
|
||||
),
|
||||
];
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ function public_dashboard_controller()
|
|||
'needed-3-hours' => stats_angels_needed_three_hours($filter),
|
||||
'needed-night' => stats_angels_needed_for_nightshifts($filter),
|
||||
'angels-working' => stats_currently_working($filter),
|
||||
'hours-to-work' => stats_hours_to_work($filter)
|
||||
'hours-to-work' => stats_hours_to_work($filter),
|
||||
];
|
||||
|
||||
$free_shifts_source = Shifts_free(time(), time() + 12 * 60 * 60, $filter);
|
||||
|
@ -57,7 +57,7 @@ function public_dashboard_controller()
|
|||
|
||||
return [
|
||||
__('Public Dashboard'),
|
||||
public_dashboard_view($stats, $free_shifts)
|
||||
public_dashboard_view($stats, $free_shifts),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ function public_dashboard_needed_angels($needed_angels, ShiftsFilter $filter = n
|
|||
if ($angeltype->show_on_dashboard) {
|
||||
$result[] = [
|
||||
'need' => $need,
|
||||
'angeltype_name' => $angeltype->name
|
||||
'angeltype_name' => $angeltype->name,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ function room_controller(): array
|
|||
|
||||
return [
|
||||
$room->name,
|
||||
Room_view($room, $shiftsFilterRenderer, $shiftCalendarRenderer)
|
||||
Room_view($room, $shiftsFilterRenderer, $shiftCalendarRenderer),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ function shift_entry_create_controller_admin(Shift $shift, ?AngelType $angeltype
|
|||
$room = $shift->room;
|
||||
return [
|
||||
ShiftEntry_create_title(),
|
||||
ShiftEntry_create_view_admin($shift, $room, $angeltype, $angeltypes_select, $signup_user, $users_select)
|
||||
ShiftEntry_create_view_admin($shift, $room, $angeltype, $angeltypes_select, $signup_user, $users_select),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ function shift_entry_create_controller_supporter(Shift $shift, AngelType $angelt
|
|||
$room = $shift->room;
|
||||
return [
|
||||
ShiftEntry_create_title(),
|
||||
ShiftEntry_create_view_supporter($shift, $room, $angeltype, $signup_user, $users_select)
|
||||
ShiftEntry_create_view_supporter($shift, $room, $angeltype, $signup_user, $users_select),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ function shift_entry_create_controller_user(Shift $shift, AngelType $angeltype):
|
|||
$room = $shift->room;
|
||||
return [
|
||||
ShiftEntry_create_title(),
|
||||
ShiftEntry_create_view_user($shift, $room, $angeltype, $comment)
|
||||
ShiftEntry_create_view_user($shift, $room, $angeltype, $comment),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ function shift_entry_create_link(Shift $shift, AngelType $angeltype, $params = [
|
|||
$params = array_merge([
|
||||
'action' => 'create',
|
||||
'shift_id' => $shift->id,
|
||||
'angeltype_id' => $angeltype->id
|
||||
'angeltype_id' => $angeltype->id,
|
||||
], $params);
|
||||
return page_link_to('shift_entries', $params);
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ function shift_entry_create_link_admin(Shift $shift, $params = [])
|
|||
{
|
||||
$params = array_merge([
|
||||
'action' => 'create',
|
||||
'shift_id' => $shift->id
|
||||
'shift_id' => $shift->id,
|
||||
], $params);
|
||||
return page_link_to('shift_entries', $params);
|
||||
}
|
||||
|
@ -339,13 +339,13 @@ function shift_entry_delete_controller()
|
|||
if ($user->id == $signout_user->id) {
|
||||
return [
|
||||
ShiftEntry_delete_title(),
|
||||
ShiftEntry_delete_view($shift, $angeltype, $signout_user)
|
||||
ShiftEntry_delete_view($shift, $angeltype, $signout_user),
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
ShiftEntry_delete_title(),
|
||||
ShiftEntry_delete_view_admin($shift, $angeltype, $signout_user)
|
||||
ShiftEntry_delete_view_admin($shift, $angeltype, $signout_user),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ function shift_entry_delete_link($shiftEntry, $params = [])
|
|||
{
|
||||
$params = array_merge([
|
||||
'action' => 'delete',
|
||||
'shift_entry_id' => $shiftEntry['shift_entry_id'] ?? $shiftEntry['id']
|
||||
'shift_entry_id' => $shiftEntry['shift_entry_id'] ?? $shiftEntry['id'],
|
||||
], $params);
|
||||
return page_link_to('shift_entries', $params);
|
||||
}
|
||||
|
|
|
@ -215,8 +215,8 @@ function shift_edit_controller()
|
|||
form_info('', __('This description is for single shifts, otherwise please use the description in shift type.')),
|
||||
'<h2>' . __('Needed angels') . '</h2>',
|
||||
$angel_types_spinner,
|
||||
form_submit('submit', __('Save'))
|
||||
])
|
||||
form_submit('submit', __('Save')),
|
||||
]),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -338,7 +338,7 @@ function shift_controller()
|
|||
|
||||
return [
|
||||
$shift->shiftType->name,
|
||||
Shift_view($shift, $shifttype, $room, $angeltypes, $shift_signup_state)
|
||||
Shift_view($shift, $shifttype, $room, $angeltypes, $shift_signup_state),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ function shifttype_delete_controller()
|
|||
|
||||
return [
|
||||
sprintf(__('Delete shifttype %s'), $shifttype->name),
|
||||
ShiftType_delete_view($shifttype)
|
||||
ShiftType_delete_view($shifttype),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ function shifttype_edit_controller()
|
|||
|
||||
return [
|
||||
shifttypes_title(),
|
||||
ShiftType_edit_view($name, $description, $shifttype_id)
|
||||
ShiftType_edit_view($name, $description, $shifttype_id),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ function shifttype_controller()
|
|||
|
||||
return [
|
||||
$shifttype->name,
|
||||
ShiftType_view($shifttype)
|
||||
ShiftType_view($shifttype),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ function shifttypes_list_controller()
|
|||
|
||||
return [
|
||||
shifttypes_title(),
|
||||
ShiftTypes_list_view($shifttypes)
|
||||
ShiftTypes_list_view($shifttypes),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ function user_angeltypes_delete_all_controller(): array
|
|||
|
||||
return [
|
||||
__('Deny all users'),
|
||||
UserAngelTypes_delete_all_view($angeltype)
|
||||
UserAngelTypes_delete_all_view($angeltype),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ function user_angeltypes_confirm_all_controller(): array
|
|||
|
||||
return [
|
||||
__('Confirm all users'),
|
||||
UserAngelTypes_confirm_all_view($angeltype)
|
||||
UserAngelTypes_confirm_all_view($angeltype),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ function user_angeltype_confirm_controller(): array
|
|||
|
||||
return [
|
||||
__('Confirm angeltype for user'),
|
||||
UserAngelType_confirm_view($user_angeltype, $user_source, $angeltype)
|
||||
UserAngelType_confirm_view($user_angeltype, $user_source, $angeltype),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -275,7 +275,7 @@ function user_angeltype_delete_controller(): array
|
|||
|
||||
return [
|
||||
__('Remove angeltype'),
|
||||
UserAngelType_delete_view($user_angeltype, $user_source, $angeltype)
|
||||
UserAngelType_delete_view($user_angeltype, $user_source, $angeltype),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -334,7 +334,7 @@ function user_angeltype_update_controller(): array
|
|||
|
||||
return [
|
||||
$supporter ? __('Add supporter rights') : __('Remove supporter rights'),
|
||||
UserAngelType_update_view($user_angeltype, $user_source, $angeltype, $supporter)
|
||||
UserAngelType_update_view($user_angeltype, $user_source, $angeltype, $supporter),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -400,7 +400,7 @@ function user_angeltype_add_controller(): array
|
|||
|
||||
return [
|
||||
__('Add user to angeltype'),
|
||||
UserAngelType_add_view($angeltype, $users_source, $user_source->id)
|
||||
UserAngelType_add_view($angeltype, $users_source, $user_source->id),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -451,7 +451,7 @@ function user_angeltype_join_controller(AngelType $angeltype)
|
|||
|
||||
return [
|
||||
sprintf(__('Become a %s'), $angeltype->name),
|
||||
UserAngelType_join_view($user, $angeltype)
|
||||
UserAngelType_join_view($user, $angeltype),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -138,6 +138,6 @@ function user_driver_license_edit_controller()
|
|||
|
||||
return [
|
||||
sprintf(__('Edit %s driving license information'), $user_source->name),
|
||||
UserDriverLicense_edit_view($user_source, $driverLicense)
|
||||
UserDriverLicense_edit_view($user_source, $driverLicense),
|
||||
];
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ function user_delete_controller()
|
|||
|
||||
return [
|
||||
sprintf(__('Delete %s'), $user_source->name),
|
||||
User_delete_view($user_source)
|
||||
User_delete_view($user_source),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ function user_edit_vouchers_controller()
|
|||
|
||||
return [
|
||||
sprintf(__('%s\'s vouchers'), $user_source->name),
|
||||
User_edit_vouchers_view($user_source)
|
||||
User_edit_vouchers_view($user_source),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ function user_controller()
|
|||
auth()->can('admin_active'),
|
||||
auth()->can('admin_user_worklog'),
|
||||
UserWorkLogsForUser($user_source->id)
|
||||
)
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ function users_list_controller()
|
|||
ShiftEntry::whereFreeloaded(true)->count(),
|
||||
State::whereGotShirt(true)->count(),
|
||||
State::query()->sum('got_voucher')
|
||||
)
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class ShiftsFilter
|
|||
$this->types = $angelTypes;
|
||||
|
||||
$this->filled = [
|
||||
ShiftsFilter::FILLED_FREE
|
||||
ShiftsFilter::FILLED_FREE,
|
||||
];
|
||||
|
||||
if ($user_shifts_admin) {
|
||||
|
|
|
@ -78,7 +78,7 @@ function Shifts_free($start, $end, ShiftsFilter $filter = null)
|
|||
$start,
|
||||
$end,
|
||||
$start,
|
||||
$end
|
||||
$end,
|
||||
]);
|
||||
|
||||
$shifts = collect($shifts);
|
||||
|
@ -238,7 +238,7 @@ function NeededAngeltype_by_Shift_and_Angeltype(Shift $shift, AngelType $angelty
|
|||
$shift->id,
|
||||
$angeltype->id,
|
||||
$shift->id,
|
||||
$angeltype->id
|
||||
$angeltype->id,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -564,7 +564,7 @@ function Shift($shift)
|
|||
'angel_type_id' => $type['angel_type_id'],
|
||||
'count' => $type['count'],
|
||||
'restricted' => $type['restricted'],
|
||||
'taken' => $type['taken']
|
||||
'taken' => $type['taken'],
|
||||
];
|
||||
}
|
||||
$shift->neededAngels = $neededAngels;
|
||||
|
|
|
@ -133,7 +133,7 @@ function stats_angels_needed_three_hours(ShiftsFilter $filter = null)
|
|||
' . ($filter ? 'AND shifts.room_id IN (' . implode(',', $filter->getRooms()) . ')' : '') . '
|
||||
) AS `tmp`', [
|
||||
$in3hours,
|
||||
$in3hours
|
||||
$in3hours,
|
||||
]);
|
||||
|
||||
return $result['count'] ?: '-';
|
||||
|
@ -214,7 +214,7 @@ function stats_angels_needed_for_nightshifts(ShiftsFilter $filter = null)
|
|||
$night_start,
|
||||
$night_end,
|
||||
$night_start,
|
||||
$night_end
|
||||
$night_end,
|
||||
]);
|
||||
|
||||
return $result['count'] ?: '-';
|
||||
|
|
|
@ -31,7 +31,7 @@ function User_tshirt_score($userId)
|
|||
AND `shifts`.`end` < NOW()
|
||||
GROUP BY `users`.`id`
|
||||
', $shift_sum_formula), [
|
||||
$userId
|
||||
$userId,
|
||||
]);
|
||||
if (!isset($result_shifts['tshirt_score'])) {
|
||||
$result_shifts = ['tshirt_score' => 0];
|
||||
|
|
|
@ -305,7 +305,7 @@ function admin_active()
|
|||
->count();
|
||||
$shirt_statistics[] = [
|
||||
'size' => $size,
|
||||
'given' => $gc
|
||||
'given' => $gc,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -319,11 +319,11 @@ function admin_active()
|
|||
form([
|
||||
form_text('search', __('Search angel:'), $search),
|
||||
form_checkbox('show_all_shifts', __('Show all shifts'), $show_all_shifts),
|
||||
form_submit('submit', __('Search'))
|
||||
form_submit('submit', __('Search')),
|
||||
], page_link_to('admin_active')),
|
||||
$set_active == '' ? form([
|
||||
form_text('count', __('How much angels should be active?'), $count ?: $forced_count),
|
||||
form_submit('set_active', __('Preview'))
|
||||
form_submit('set_active', __('Preview')),
|
||||
]) : $set_active,
|
||||
$msg . msg(),
|
||||
table(
|
||||
|
@ -339,7 +339,7 @@ function admin_active()
|
|||
'active' => __('Active?'),
|
||||
'force_active' => __('Forced'),
|
||||
'tshirt' => ($other_goodie ? __('Goodie?') : __('T-shirt?')),
|
||||
'actions' => ''
|
||||
'actions' => '',
|
||||
]
|
||||
),
|
||||
$matched_users
|
||||
|
@ -348,6 +348,6 @@ function admin_active()
|
|||
table(array_merge(
|
||||
(!$other_goodie ? ['size' => __('Size')] : []),
|
||||
['given' => $other_goodie ? __('Given goodies') : __('Given shirts') ]
|
||||
), $shirt_statistics)
|
||||
), $shirt_statistics),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ function admin_arrive()
|
|||
$arrival_at_day[$day] = [
|
||||
'day' => $day,
|
||||
'count' => $count,
|
||||
'sum' => $arrival_sum
|
||||
'sum' => $arrival_sum,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ function admin_arrive()
|
|||
$planned_arrival_at_day[$day] = [
|
||||
'day' => $day,
|
||||
'count' => $count,
|
||||
'sum' => $planned_arrival_sum
|
||||
'sum' => $planned_arrival_sum,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ function admin_arrive()
|
|||
$planned_departure_at_day[$day] = [
|
||||
'day' => $day,
|
||||
'count' => $count,
|
||||
'sum' => $planned_departure_sum
|
||||
'sum' => $planned_departure_sum,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ function admin_arrive()
|
|||
$msg . msg(),
|
||||
form([
|
||||
form_text('search', __('Search'), $search),
|
||||
form_submit('submit', __('Search'))
|
||||
form_submit('submit', __('Search')),
|
||||
], page_link_to('admin_arrive')),
|
||||
table([
|
||||
'name' => __('Nickname'),
|
||||
|
@ -190,54 +190,54 @@ function admin_arrive()
|
|||
'arrived' => __('Arrived?'),
|
||||
'rendered_arrival_date' => __('Arrival date'),
|
||||
'rendered_planned_departure_date' => __('Planned departure'),
|
||||
'actions' => ''
|
||||
'actions' => '',
|
||||
], $users_matched),
|
||||
div('row', [
|
||||
div('col-md-4', [
|
||||
heading(__('Planned arrival statistics'), 3),
|
||||
BarChart::render([
|
||||
'count' => __('arrived'),
|
||||
'sum' => __('arrived sum')
|
||||
'sum' => __('arrived sum'),
|
||||
], [
|
||||
'count' => '#090',
|
||||
'sum' => '#888'
|
||||
'sum' => '#888',
|
||||
], $planned_arrival_at_day),
|
||||
table([
|
||||
'day' => __('Date'),
|
||||
'count' => __('Count'),
|
||||
'sum' => __('Sum')
|
||||
], $planned_arrival_at_day)
|
||||
'sum' => __('Sum'),
|
||||
], $planned_arrival_at_day),
|
||||
]),
|
||||
div('col-md-4', [
|
||||
heading(__('Arrival statistics'), 3),
|
||||
BarChart::render([
|
||||
'count' => __('arrived'),
|
||||
'sum' => __('arrived sum')
|
||||
'sum' => __('arrived sum'),
|
||||
], [
|
||||
'count' => '#090',
|
||||
'sum' => '#888'
|
||||
'sum' => '#888',
|
||||
], $arrival_at_day),
|
||||
table([
|
||||
'day' => __('Date'),
|
||||
'count' => __('Count'),
|
||||
'sum' => __('Sum')
|
||||
], $arrival_at_day)
|
||||
'sum' => __('Sum'),
|
||||
], $arrival_at_day),
|
||||
]),
|
||||
div('col-md-4', [
|
||||
heading(__('Planned departure statistics'), 3),
|
||||
BarChart::render([
|
||||
'count' => __('arrived'),
|
||||
'sum' => __('arrived sum')
|
||||
'sum' => __('arrived sum'),
|
||||
], [
|
||||
'count' => '#090',
|
||||
'sum' => '#888'
|
||||
'sum' => '#888',
|
||||
], $planned_departure_at_day),
|
||||
table([
|
||||
'day' => __('Date'),
|
||||
'count' => __('Count'),
|
||||
'sum' => __('Sum')
|
||||
], $planned_departure_at_day)
|
||||
])
|
||||
])
|
||||
'sum' => __('Sum'),
|
||||
], $planned_departure_at_day),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ function admin_free()
|
|||
|
||||
$angel_types_source = AngelType::all(['id', 'name']);
|
||||
$angel_types = [
|
||||
'' => __('All')
|
||||
'' => __('All'),
|
||||
];
|
||||
foreach ($angel_types_source as $angel_type) {
|
||||
$angel_types[$angel_type->id] = $angel_type->name;
|
||||
|
@ -105,7 +105,7 @@ function admin_free()
|
|||
'actions' =>
|
||||
auth()->can('admin_user')
|
||||
? button(page_link_to('admin_user', ['id' => $usr->id]), icon('pencil') . __('edit'), 'btn-sm')
|
||||
: ''
|
||||
: '',
|
||||
];
|
||||
}
|
||||
return page_with_title(admin_free_title(), [
|
||||
|
@ -115,7 +115,7 @@ function admin_free()
|
|||
div('row', [
|
||||
form_text('search', __('Search'), $search, null, null, null, 'col'),
|
||||
form_select('angeltype', __('Angeltype'), $angel_types, $angelType, '', 'col'),
|
||||
form_submit('submit', __('Search'))
|
||||
form_submit('submit', __('Search')),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
|
@ -126,7 +126,7 @@ function admin_free()
|
|||
'last_shift' => __('Last shift'),
|
||||
'dect' => __('DECT'),
|
||||
'email' => __('E-Mail'),
|
||||
'actions' => ''
|
||||
'actions' => '',
|
||||
], $free_users_table),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ function admin_groups()
|
|||
),
|
||||
icon('pencil') . __('edit'),
|
||||
'btn-sm'
|
||||
)
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -52,8 +52,8 @@ function admin_groups()
|
|||
table([
|
||||
'name' => __('Name'),
|
||||
'privileges' => __('Privileges'),
|
||||
'actions' => ''
|
||||
], $groups_table)
|
||||
'actions' => '',
|
||||
], $groups_table),
|
||||
]);
|
||||
} else {
|
||||
switch ($request->input('action')) {
|
||||
|
@ -84,7 +84,7 @@ function admin_groups()
|
|||
form(
|
||||
$privileges_form,
|
||||
page_link_to('admin_groups', ['action' => 'save', 'id' => $group->id])
|
||||
)
|
||||
),
|
||||
]);
|
||||
} else {
|
||||
return error('No Group found.', true);
|
||||
|
@ -145,6 +145,6 @@ function groupPrivilegesWithSelected(Group $group): Collection
|
|||
->orderBy('name')
|
||||
->get([
|
||||
'privileges.*',
|
||||
'group_privileges.group_id as selected'
|
||||
'group_privileges.group_id as selected',
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -37,8 +37,8 @@ function admin_rooms()
|
|||
page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room->id]),
|
||||
icon('trash') . __('delete'),
|
||||
'btn-sm'
|
||||
)
|
||||
])
|
||||
),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -154,13 +154,13 @@ function admin_rooms()
|
|||
$angeltypes_count_form = [];
|
||||
foreach ($angeltypes as $angeltype_id => $angeltypeName) {
|
||||
$angeltypes_count_form[] = div('col-lg-4 col-md-6 col-xs-6', [
|
||||
form_spinner('angeltype_count_' . $angeltype_id, $angeltypeName, $angeltypes_count[$angeltype_id])
|
||||
form_spinner('angeltype_count_' . $angeltype_id, $angeltypeName, $angeltypes_count[$angeltype_id]),
|
||||
]);
|
||||
}
|
||||
|
||||
return page_with_title(admin_rooms_title(), [
|
||||
buttons([
|
||||
button(page_link_to('admin_rooms'), __('back'), 'back')
|
||||
button(page_link_to('admin_rooms'), __('back'), 'back'),
|
||||
]),
|
||||
$msg,
|
||||
form([
|
||||
|
@ -176,14 +176,14 @@ function admin_rooms()
|
|||
div('col-md-6', [
|
||||
div('row', [
|
||||
div('col-md-12', [
|
||||
form_info(__('Needed angels:'))
|
||||
form_info(__('Needed angels:')),
|
||||
]),
|
||||
join($angeltypes_count_form)
|
||||
])
|
||||
])
|
||||
join($angeltypes_count_form),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
form_submit('submit', __('Save'))
|
||||
])
|
||||
form_submit('submit', __('Save')),
|
||||
]),
|
||||
], true);
|
||||
} elseif ($request->input('show') == 'delete') {
|
||||
if ($request->hasPostData('ack')) {
|
||||
|
@ -213,7 +213,7 @@ function admin_rooms()
|
|||
|
||||
return page_with_title(admin_rooms_title(), [
|
||||
buttons([
|
||||
button(page_link_to('admin_rooms'), __('back'), 'back')
|
||||
button(page_link_to('admin_rooms'), __('back'), 'back'),
|
||||
]),
|
||||
sprintf(__('Do you want to delete room %s?'), $name),
|
||||
form([
|
||||
|
@ -225,14 +225,14 @@ function admin_rooms()
|
|||
|
||||
return page_with_title(admin_rooms_title(), [
|
||||
buttons([
|
||||
button(page_link_to('admin_rooms', ['show' => 'edit']), __('add'))
|
||||
button(page_link_to('admin_rooms', ['show' => 'edit']), __('add')),
|
||||
]),
|
||||
msg(),
|
||||
table([
|
||||
'name' => __('Name'),
|
||||
'dect' => __('DECT'),
|
||||
'map_url' => __('Map'),
|
||||
'actions' => ''
|
||||
], $rooms)
|
||||
'actions' => '',
|
||||
], $rooms),
|
||||
], true);
|
||||
}
|
||||
|
|
|
@ -286,7 +286,7 @@ function admin_shifts()
|
|||
'room_id' => $rid,
|
||||
'title' => $title,
|
||||
'shift_type_id' => $shifttype_id,
|
||||
'description' => $description
|
||||
'description' => $description,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ function admin_shifts()
|
|||
'title' =>
|
||||
ShiftType_name_render(ShiftType::find($shifttype_id))
|
||||
. ($shift['title'] ? '<br />' . $shift['title'] : ''),
|
||||
'needed_angels' => ''
|
||||
'needed_angels' => '',
|
||||
];
|
||||
foreach ($types as $type) {
|
||||
if (isset($needed_angel_types[$type->id]) && $needed_angel_types[$type->id] > 0) {
|
||||
|
@ -357,10 +357,10 @@ function admin_shifts()
|
|||
table([
|
||||
'timeslot' => __('Time and location'),
|
||||
'title' => __('Type and title'),
|
||||
'needed_angels' => __('Needed angels')
|
||||
'needed_angels' => __('Needed angels'),
|
||||
], $shifts_table),
|
||||
form_submit('submit', icon('save') . __('Save'))
|
||||
])
|
||||
form_submit('submit', icon('save') . __('Save')),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
} elseif ($request->hasPostData('submit')) {
|
||||
|
@ -424,7 +424,7 @@ function admin_shifts()
|
|||
$needed_angel_types[$type->id],
|
||||
[
|
||||
'radio-name' => 'angelmode',
|
||||
'radio-value' => 'manually'
|
||||
'radio-value' => 'manually',
|
||||
]
|
||||
)
|
||||
. '</div>';
|
||||
|
@ -454,10 +454,10 @@ function admin_shifts()
|
|||
div('col-md-6 col-xl-5', [
|
||||
div('row', [
|
||||
div('col-lg-6', [
|
||||
form_datetime('start', __('Start'), $start)
|
||||
form_datetime('start', __('Start'), $start),
|
||||
]),
|
||||
div('col-lg-6', [
|
||||
form_datetime('end', __('End'), $end)
|
||||
form_datetime('end', __('End'), $end),
|
||||
]),
|
||||
]),
|
||||
form_info(__('Mode')),
|
||||
|
@ -475,7 +475,7 @@ function admin_shifts()
|
|||
'',
|
||||
[
|
||||
'radio-name' => 'mode',
|
||||
'radio-value' => 'multi'
|
||||
'radio-value' => 'multi',
|
||||
]
|
||||
),
|
||||
form_radio(
|
||||
|
@ -496,14 +496,14 @@ function admin_shifts()
|
|||
'',
|
||||
[
|
||||
'radio-name' => 'mode',
|
||||
'radio-value' => 'variable'
|
||||
'radio-value' => 'variable',
|
||||
]
|
||||
),
|
||||
form_checkbox(
|
||||
'shift_over_midnight',
|
||||
__('Create a shift over midnight.'),
|
||||
$shift_over_midnight
|
||||
)
|
||||
),
|
||||
]),
|
||||
div('col-md-6 col-xl-7', [
|
||||
form_info(__('Needed angels')),
|
||||
|
@ -520,12 +520,12 @@ function admin_shifts()
|
|||
'manually'
|
||||
),
|
||||
div('row', [
|
||||
$angel_types
|
||||
])
|
||||
])
|
||||
$angel_types,
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
form_submit('preview', icon('search') . __('Preview'))
|
||||
])
|
||||
form_submit('preview', icon('search') . __('Preview')),
|
||||
]),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -621,7 +621,7 @@ function admin_shifts_history(): string
|
|||
'end' => __('End'),
|
||||
'user' => __('User'),
|
||||
'created_at' => __('Created'),
|
||||
'actions' => ''
|
||||
], $shiftsData)
|
||||
'actions' => '',
|
||||
], $shiftsData),
|
||||
], true);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ function admin_user()
|
|||
|
||||
$options = [
|
||||
'1' => __('Yes'),
|
||||
'0' => __('No')
|
||||
'0' => __('No'),
|
||||
];
|
||||
|
||||
// Gekommen?
|
||||
|
@ -175,7 +175,7 @@ function admin_user()
|
|||
}
|
||||
|
||||
$html .= buttons([
|
||||
button(user_delete_link($user_source->id), icon('trash') . __('delete'), 'btn-danger')
|
||||
button(user_delete_link($user_source->id), icon('trash') . __('delete'), 'btn-danger'),
|
||||
]);
|
||||
|
||||
$html .= '<hr>';
|
||||
|
@ -296,7 +296,7 @@ function admin_user()
|
|||
}
|
||||
|
||||
return page_with_title(__('Edit user'), [
|
||||
$html
|
||||
$html,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -317,6 +317,6 @@ function changeableGroups($myHighestGroup, $angelId): Collection
|
|||
->orderBy('name')
|
||||
->get([
|
||||
'groups.*',
|
||||
'users_groups.group_id as selected'
|
||||
'users_groups.group_id as selected',
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -394,21 +394,21 @@ function guest_register()
|
|||
form_info(
|
||||
'',
|
||||
__('Use up to 24 letters, numbers, connecting punctuations or spaces for your nickname.')
|
||||
)
|
||||
),
|
||||
]),
|
||||
|
||||
$enable_pronoun ? div('col', [
|
||||
form_text('pronoun', __('Pronoun'), $pronoun, false, 15)
|
||||
form_text('pronoun', __('Pronoun'), $pronoun, false, 15),
|
||||
]) : '',
|
||||
]),
|
||||
|
||||
$enable_user_name ? div('row', [
|
||||
div('col', [
|
||||
form_text('prename', __('First name'), $preName, false, 64, 'given-name')
|
||||
form_text('prename', __('First name'), $preName, false, 64, 'given-name'),
|
||||
]),
|
||||
div('col', [
|
||||
form_text('lastname', __('Last name'), $lastName, false, 64, 'family-name')
|
||||
])
|
||||
form_text('lastname', __('Last name'), $lastName, false, 64, 'family-name'),
|
||||
]),
|
||||
]) : '',
|
||||
|
||||
div('row', [
|
||||
|
@ -449,7 +449,7 @@ function guest_register()
|
|||
]),
|
||||
|
||||
$enable_dect ? div('col', [
|
||||
form_text('dect', __('DECT'), $dect, false, 40, 'tel-local')
|
||||
form_text('dect', __('DECT'), $dect, false, 40, 'tel-local'),
|
||||
]) : '',
|
||||
|
||||
div('col', [
|
||||
|
@ -458,13 +458,13 @@ function guest_register()
|
|||
'mobile_show',
|
||||
__('Show mobile number to other users to contact me'),
|
||||
$mobile_show
|
||||
) : ''
|
||||
])
|
||||
) : '',
|
||||
]),
|
||||
]),
|
||||
|
||||
div('row', [
|
||||
$enable_password ? div('col', [
|
||||
form_password('password', __('Password') . ' ' . entry_required(), 'new-password')
|
||||
form_password('password', __('Password') . ' ' . entry_required(), 'new-password'),
|
||||
]) : '',
|
||||
|
||||
$enable_planned_arrival ? div('col', [
|
||||
|
@ -474,13 +474,13 @@ function guest_register()
|
|||
$planned_arrival_date,
|
||||
$buildup_start_date,
|
||||
$teardown_end_date
|
||||
)
|
||||
),
|
||||
]) : '',
|
||||
]),
|
||||
|
||||
div('row', [
|
||||
$enable_password ? div('col', [
|
||||
form_password('password2', __('Confirm password') . ' ' . entry_required(), 'new-password')
|
||||
form_password('password2', __('Confirm password') . ' ' . entry_required(), 'new-password'),
|
||||
]) : '',
|
||||
|
||||
div('col', [
|
||||
|
@ -490,7 +490,7 @@ function guest_register()
|
|||
$tshirt_sizes,
|
||||
$tshirt_size,
|
||||
__('Please select...')
|
||||
) : ''
|
||||
) : '',
|
||||
]),
|
||||
]),
|
||||
|
||||
|
@ -509,12 +509,12 @@ function guest_register()
|
|||
form_info(
|
||||
'',
|
||||
__('Some angel types have to be confirmed later by a supporter at an introduction meeting. You can change your selection in the options section.')
|
||||
)
|
||||
])
|
||||
),
|
||||
]),
|
||||
]),
|
||||
|
||||
form_submit('submit', __('Register'))
|
||||
])
|
||||
form_submit('submit', __('Register')),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ class ImportSchedule extends BaseController
|
|||
->table('shift_entries')
|
||||
->select([
|
||||
'shift_types.name', 'shifts.title', 'angel_types.name AS type', 'rooms.id AS room_id',
|
||||
'shifts.start', 'shifts.end', 'shift_entries.user_id', 'shift_entries.freeloaded'
|
||||
'shifts.start', 'shifts.end', 'shift_entries.user_id', 'shift_entries.freeloaded',
|
||||
])
|
||||
->join('shifts', 'shifts.id', 'shift_entries.shift_id')
|
||||
->join('schedule_shift', 'shifts.id', 'schedule_shift.shift_id')
|
||||
|
|
|
@ -44,7 +44,7 @@ function user_myshifts()
|
|||
__('If you reset the key, the url to your iCal- and JSON-export and your atom/rss feed changes! You have to update it in every application using one of these exports.'),
|
||||
true
|
||||
),
|
||||
button(page_link_to('user_myshifts', ['reset' => 'ack']), __('Continue'), 'btn-danger')
|
||||
button(page_link_to('user_myshifts', ['reset' => 'ack']), __('Continue'), 'btn-danger'),
|
||||
]);
|
||||
} elseif ($request->has('edit') && preg_match('/^\d+$/', $request->input('edit'))) {
|
||||
$shift_entry_id = $request->input('edit');
|
||||
|
|
|
@ -246,12 +246,12 @@ function view_user_shifts()
|
|||
$filled = [
|
||||
[
|
||||
'id' => '1',
|
||||
'name' => __('occupied')
|
||||
'name' => __('occupied'),
|
||||
],
|
||||
[
|
||||
'id' => '0',
|
||||
'name' => __('free')
|
||||
]
|
||||
'name' => __('free'),
|
||||
],
|
||||
];
|
||||
$start_day = $shiftsFilter->getStart()->format('Y-m-d');
|
||||
$start_time = $shiftsFilter->getStart()->format('H:i');
|
||||
|
@ -326,9 +326,9 @@ function view_user_shifts()
|
|||
'buttons' => button(
|
||||
public_dashboard_link(),
|
||||
icon('speedometer2') . __('Public Dashboard')
|
||||
)
|
||||
])
|
||||
])
|
||||
),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ function stats($label, $number, $style = null)
|
|||
return div('col stats text-' . $style, [
|
||||
$label,
|
||||
div('number', [
|
||||
$number
|
||||
])
|
||||
$number,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ function tabs($tabs, $selected = 0)
|
|||
}
|
||||
return div('', [
|
||||
'<ul class="nav nav-tabs mb-3" role="tablist">' . join($tab_header) . '</ul>',
|
||||
'<div class="tab-content">' . join($tab_content) . '</div>'
|
||||
'<div class="tab-content">' . join($tab_content) . '</div>',
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ function toolbar_dropdown_item(string $href, string $label, bool $active, string
|
|||
'{icon}' => $icon === null ? '' : '<i class="bi bi-' . $icon . '"></i>',
|
||||
'{label}' => $label,
|
||||
'{active}' => $active ? ' active' : '',
|
||||
'{aria}' => $active ? ' aria-current="page"' : ''
|
||||
'{aria}' => $active ? ' aria-current="page"' : '',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ EOT;
|
|||
[
|
||||
'{class}' => $active ? ' active' : '',
|
||||
'{label}' => $label,
|
||||
'{submenu}' => join("\n", $submenu)
|
||||
'{submenu}' => join("\n", $submenu),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -304,11 +304,11 @@ function table($columns, $rows_raw, $data = true)
|
|||
$rows = [];
|
||||
foreach ($rows_raw as $row) {
|
||||
$rows[] = [
|
||||
'col' => $row
|
||||
'col' => $row,
|
||||
];
|
||||
}
|
||||
return render_table([
|
||||
'col' => $columns
|
||||
'col' => $columns,
|
||||
], $rows, $data);
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ function AngelType_delete_view(AngelType $angeltype)
|
|||
buttons([
|
||||
button(page_link_to('angeltypes'), icon('x-lg') . __('cancel')),
|
||||
form_submit('delete', icon('trash') . __('delete'), 'btn-danger', false),
|
||||
])
|
||||
]),
|
||||
]),
|
||||
], true);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ function AngelType_edit_view(AngelType $angeltype, bool $supporter_mode)
|
|||
{
|
||||
return page_with_title(sprintf(__('Edit %s'), $angeltype->name), [
|
||||
buttons([
|
||||
button(page_link_to('angeltypes'), icon('person-lines-fill') . __('Angeltypes'), 'back')
|
||||
button(page_link_to('angeltypes'), icon('person-lines-fill') . __('Angeltypes'), 'back'),
|
||||
]),
|
||||
msg(),
|
||||
form([
|
||||
|
@ -128,8 +128,8 @@ function AngelType_edit_view(AngelType $angeltype, bool $supporter_mode)
|
|||
form_text('contact_name', __('Name'), $angeltype->contact_name),
|
||||
config('enable_dect') ? form_text('contact_dect', __('DECT'), $angeltype->contact_dect) : '',
|
||||
form_text('contact_email', __('E-Mail'), $angeltype->contact_email),
|
||||
form_submit('submit', __('Save'))
|
||||
])
|
||||
form_submit('submit', __('Save')),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ function AngelType_view_buttons(
|
|||
$user
|
||||
) {
|
||||
$buttons = [
|
||||
button(page_link_to('angeltypes'), icon('person-lines-fill') . __('Angeltypes'), 'back')
|
||||
button(page_link_to('angeltypes'), icon('person-lines-fill') . __('Angeltypes'), 'back'),
|
||||
];
|
||||
|
||||
if ($angeltype->requires_driver_license) {
|
||||
|
@ -250,7 +250,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
|
|||
),
|
||||
__('deny'),
|
||||
'btn-sm'
|
||||
)
|
||||
),
|
||||
]);
|
||||
$members_unconfirmed[] = $member;
|
||||
} elseif ($member->pivot->supporter) {
|
||||
|
@ -260,11 +260,11 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
|
|||
page_link_to('user_angeltypes', [
|
||||
'action' => 'update',
|
||||
'user_angeltype_id' => $member->pivot->id,
|
||||
'supporter' => 0
|
||||
'supporter' => 0,
|
||||
]),
|
||||
icon('person-fill-down') . __('Remove supporter rights'),
|
||||
'btn-sm'
|
||||
)
|
||||
),
|
||||
]);
|
||||
} else {
|
||||
$member['actions'] = '';
|
||||
|
@ -278,7 +278,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
|
|||
page_link_to('user_angeltypes', [
|
||||
'action' => 'update',
|
||||
'user_angeltype_id' => $member->pivot->id,
|
||||
'supporter' => 1
|
||||
'supporter' => 1,
|
||||
]),
|
||||
icon('person-fill-up') . __('Add supporter rights'),
|
||||
'btn-sm'
|
||||
|
@ -287,11 +287,11 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
|
|||
button(
|
||||
page_link_to('user_angeltypes', [
|
||||
'action' => 'delete',
|
||||
'user_angeltype_id' => $member->pivot->id
|
||||
'user_angeltype_id' => $member->pivot->id,
|
||||
]),
|
||||
icon('trash') . __('remove'),
|
||||
'btn-sm'
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
$members_confirmed[] = $member;
|
||||
|
@ -301,7 +301,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
|
|||
return [
|
||||
$supporters,
|
||||
$members_confirmed,
|
||||
$members_unconfirmed
|
||||
$members_unconfirmed,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -318,7 +318,7 @@ function AngelType_view_table_headers(AngelType $angeltype, $supporter, $admin_a
|
|||
$headers = [
|
||||
'name' => __('Nick'),
|
||||
'dect' => __('DECT'),
|
||||
'actions' => ''
|
||||
'actions' => '',
|
||||
];
|
||||
if ($angeltype->requires_driver_license && ($supporter || $admin_angeltypes)) {
|
||||
$headers = [
|
||||
|
@ -331,7 +331,7 @@ function AngelType_view_table_headers(AngelType $angeltype, $supporter, $admin_a
|
|||
'has_license_7_5t_truck' => __('7,5t Truck'),
|
||||
'has_license_12t_truck' => __('12t Truck'),
|
||||
'has_license_forklift' => __('Forklift'),
|
||||
'actions' => ''
|
||||
'actions' => '',
|
||||
];
|
||||
}
|
||||
if (!config('enable_dect')) {
|
||||
|
@ -385,7 +385,7 @@ function AngelType_view(
|
|||
$shiftsFilterRenderer,
|
||||
$shiftCalendarRenderer
|
||||
),
|
||||
], $tab)
|
||||
], $tab),
|
||||
], true);
|
||||
}
|
||||
|
||||
|
@ -399,7 +399,7 @@ function AngelType_view_shifts(AngelType $angeltype, $shiftsFilterRenderer, $shi
|
|||
{
|
||||
$shifts = $shiftsFilterRenderer->render(page_link_to('angeltypes', [
|
||||
'action' => 'view',
|
||||
'angeltype_id' => $angeltype->id
|
||||
'angeltype_id' => $angeltype->id,
|
||||
]), ['type' => $angeltype->id]);
|
||||
$shifts .= $shiftCalendarRenderer->render();
|
||||
|
||||
|
@ -449,7 +449,7 @@ function AngelType_view_info(
|
|||
$members_confirmed[] = [
|
||||
'name' => __('Sum'),
|
||||
'dect' => count($members_confirmed),
|
||||
'actions' => ''
|
||||
'actions' => '',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ function AngelType_view_info(
|
|||
$members_unconfirmed[] = [
|
||||
'name' => __('Sum'),
|
||||
'dect' => count($members_unconfirmed),
|
||||
'actions' => ''
|
||||
'actions' => '',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -471,7 +471,7 @@ function AngelType_view_info(
|
|||
),
|
||||
__('Add'),
|
||||
'add'
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
$info[] = table($table_headers, $members_confirmed);
|
||||
|
@ -486,7 +486,7 @@ function AngelType_view_info(
|
|||
button(
|
||||
page_link_to('user_angeltypes', ['action' => 'delete_all', 'angeltype_id' => $angeltype->id]),
|
||||
icon('trash') . __('deny all')
|
||||
)
|
||||
),
|
||||
]);
|
||||
$info[] = table($table_headers, $members_unconfirmed);
|
||||
}
|
||||
|
@ -532,15 +532,15 @@ function AngelTypes_list_view($angeltypes, bool $admin_angeltypes)
|
|||
$admin_angeltypes
|
||||
? button(page_link_to('angeltypes', ['action' => 'edit']), __('New angeltype'), 'add')
|
||||
: '',
|
||||
button(page_link_to('angeltypes', ['action' => 'about']), __('Teams/Job description'))
|
||||
button(page_link_to('angeltypes', ['action' => 'about']), __('Teams/Job description')),
|
||||
]),
|
||||
table([
|
||||
'name' => __('Name'),
|
||||
'is_restricted' => icon('mortarboard-fill') . __('Requires introduction'),
|
||||
'no_self_signup_allowed' => icon('pencil-square') . __('Self Sign Up Allowed'),
|
||||
'membership' => __('Membership'),
|
||||
'actions' => ''
|
||||
], $angeltypes)
|
||||
'actions' => '',
|
||||
], $angeltypes),
|
||||
], true);
|
||||
}
|
||||
|
||||
|
@ -627,7 +627,7 @@ function AngelTypes_about_view($angeltypes, $user_logged_in)
|
|||
$content = [
|
||||
buttons($buttons),
|
||||
'<p>' . __('Here is the list of teams and their tasks. If you have questions, read the FAQ.') . '</p>',
|
||||
'<hr />'
|
||||
'<hr />',
|
||||
];
|
||||
foreach ($angeltypes as $angeltype) {
|
||||
$content[] = AngelTypes_about_view_angeltype($angeltype);
|
||||
|
|
|
@ -31,20 +31,20 @@ function EventConfig_edit_view(
|
|||
form_info(
|
||||
'',
|
||||
__('Welcome message is shown after successful registration. You can use markdown.')
|
||||
)
|
||||
),
|
||||
]),
|
||||
div('col-md-3 col-xs-6', [
|
||||
form_datetime('buildup_start_date', __('Buildup date'), $buildup_start_date),
|
||||
form_datetime('event_start_date', __('Event start date'), $event_start_date),
|
||||
form_datetime('event_end_date', __('Event end date'), $event_end_date),
|
||||
form_datetime('teardown_end_date', __('Teardown end date'), $teardown_end_date),
|
||||
])
|
||||
]),
|
||||
]),
|
||||
div('row', [
|
||||
div('col-md-6', [
|
||||
form_submit('submit', __('Save'))
|
||||
])
|
||||
])
|
||||
])
|
||||
form_submit('submit', __('Save')),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ function public_dashboard_view($stats, $free_shifts)
|
|||
$needed_angels = '';
|
||||
if (count($free_shifts) > 0) {
|
||||
$shift_panels = [
|
||||
'<div class="row">'
|
||||
'<div class="row">',
|
||||
];
|
||||
foreach ($free_shifts as $i => $shift) {
|
||||
$shift_panels[] = public_dashboard_shift_render($shift);
|
||||
|
@ -23,11 +23,11 @@ function public_dashboard_view($stats, $free_shifts)
|
|||
$shift_panels[] = '</div>';
|
||||
$needed_angels = div('first', [
|
||||
div('col-md-12', [
|
||||
heading(__('Needed angels:'))
|
||||
heading(__('Needed angels:')),
|
||||
]),
|
||||
div('container-fluid', [
|
||||
join($shift_panels)
|
||||
])
|
||||
join($shift_panels),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ function public_dashboard_view($stats, $free_shifts)
|
|||
stats(__('Angels currently working'), $stats['angels-working'], 'default'),
|
||||
stats(__('Hours to be worked'), $stats['hours-to-work'], 'default'),
|
||||
], 'statistics'),
|
||||
$needed_angels
|
||||
$needed_angels,
|
||||
], 'public-dashboard'),
|
||||
]),
|
||||
div('first col-md-12 text-center', [buttons([
|
||||
|
@ -55,7 +55,7 @@ function public_dashboard_view($stats, $free_shifts)
|
|||
auth()->user() ? button(
|
||||
public_dashboard_link($isFiltered ? [] : ['filtered' => 1] + $filter),
|
||||
icon('filter') . ($isFiltered ? __('All') : __('Filtered'))
|
||||
) : ''
|
||||
) : '',
|
||||
])], 'fullscreen-button'),
|
||||
]);
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ function public_dashboard_shift_render($shift)
|
|||
div('dashboard-card card border-' . $shift['style'] . ' ' . $type, [
|
||||
div('card-body', [
|
||||
'<a class="card-link" href="' . shift_link($shift) . '"></a>',
|
||||
$panel_body
|
||||
])
|
||||
])
|
||||
$panel_body,
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -46,9 +46,9 @@ function Room_view(Room $room, ShiftsFilterRenderer $shiftsFilterRenderer, Shift
|
|||
$tabs[__('Shifts')] = div('first', [
|
||||
$shiftsFilterRenderer->render(page_link_to('rooms', [
|
||||
'action' => 'view',
|
||||
'room_id' => $room->id
|
||||
'room_id' => $room->id,
|
||||
]), ['rooms' => [$room->id]]),
|
||||
$shiftCalendarRenderer->render()
|
||||
$shiftCalendarRenderer->render(),
|
||||
]);
|
||||
|
||||
$selected_tab = 0;
|
||||
|
@ -69,7 +69,7 @@ function Room_view(Room $room, ShiftsFilterRenderer $shiftsFilterRenderer, Shift
|
|||
page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room->id]),
|
||||
icon('trash') . __('delete'),
|
||||
'btn'
|
||||
)
|
||||
),
|
||||
]) : '',
|
||||
$dect,
|
||||
$description,
|
||||
|
|
|
@ -77,7 +77,7 @@ class ShiftCalendarRenderer
|
|||
if (!isset($lanes[$room->id])) {
|
||||
// initialize room with one lane
|
||||
$lanes[$room->id] = [
|
||||
new ShiftCalendarLane($header)
|
||||
new ShiftCalendarLane($header),
|
||||
];
|
||||
}
|
||||
// Try to add the shift to the existing lanes for this room
|
||||
|
@ -141,7 +141,7 @@ class ShiftCalendarRenderer
|
|||
|
||||
return div('shift-calendar table-responsive', [
|
||||
$this->renderTimeLane(),
|
||||
$this->renderShiftLanes()
|
||||
$this->renderShiftLanes(),
|
||||
]) . $this->renderLegend();
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,7 @@ class ShiftCalendarRenderer
|
|||
|
||||
return div('lane', [
|
||||
div('header ' . $bg, $lane->getHeader()),
|
||||
$html
|
||||
$html,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -218,14 +218,14 @@ class ShiftCalendarRenderer
|
|||
return div($class . ' day');
|
||||
}
|
||||
return div($class . ' day', [
|
||||
date(__('m-d'), $time) . '<br>' . date(__('H:i'), $time)
|
||||
date(__('m-d'), $time) . '<br>' . date(__('H:i'), $time),
|
||||
]);
|
||||
} elseif ($time % (60 * 60) == 0) {
|
||||
if (!$label) {
|
||||
return div($class . ' hour');
|
||||
}
|
||||
return div($class . ' hour', [
|
||||
date(__('m-d'), $time) . '<br>' . date(__('H:i'), $time)
|
||||
date(__('m-d'), $time) . '<br>' . date(__('H:i'), $time),
|
||||
]);
|
||||
}
|
||||
return div($class);
|
||||
|
@ -242,8 +242,8 @@ class ShiftCalendarRenderer
|
|||
|
||||
$time_slot = [
|
||||
div('header ' . $bg, [
|
||||
__('Time')
|
||||
])
|
||||
__('Time'),
|
||||
]),
|
||||
];
|
||||
for ($block = 0; $block < $this->getBlocksPerSlot(); $block++) {
|
||||
$thistime = $this->getFirstBlockStartTime() + ($block * ShiftCalendarRenderer::SECONDS_PER_ROW);
|
||||
|
@ -312,7 +312,7 @@ class ShiftCalendarRenderer
|
|||
badge(__('Help needed'), 'danger'),
|
||||
badge(__('Other angeltype needed / collides with my shifts'), 'warning'),
|
||||
badge(__('Shift is full'), 'success'),
|
||||
badge(__('Shift running/ended or user not arrived/allowed'), 'secondary')
|
||||
badge(__('Shift running/ended or user not arrived/allowed'), 'secondary'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,12 +57,12 @@ class ShiftCalendarShiftRenderer
|
|||
$this->renderShiftHead($shift, $class, $shift_signup_state->getFreeEntries()),
|
||||
div('card-body ' . $this->classBg(), [
|
||||
$info_text,
|
||||
Room_name_render($room)
|
||||
Room_name_render($room),
|
||||
]),
|
||||
$shifts_row
|
||||
$shifts_row,
|
||||
]
|
||||
)
|
||||
)
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -134,13 +134,13 @@ class ShiftCalendarShiftRenderer
|
|||
if ($html != '') {
|
||||
return [
|
||||
$shift_signup_state,
|
||||
'<ul class="list-group list-group-flush">' . $html . '</ul>'
|
||||
'<ul class="list-group list-group-flush">' . $html . '</ul>',
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
$shift_signup_state,
|
||||
''
|
||||
'',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ class ShiftCalendarShiftRenderer
|
|||
$shifts_row .= '</li>';
|
||||
return [
|
||||
$shift_signup_state,
|
||||
$shifts_row
|
||||
$shifts_row,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ class ShiftCalendarShiftRenderer
|
|||
page_link_to('user_shifts', ['delete_shift' => $shift->id]),
|
||||
icon('trash'),
|
||||
'btn-' . $class . ' btn-sm border-light text-white'
|
||||
)
|
||||
),
|
||||
]) . '</div>';
|
||||
}
|
||||
$shift_heading = $shift->start->format('H:i') . ' ‐ '
|
||||
|
@ -270,7 +270,7 @@ class ShiftCalendarShiftRenderer
|
|||
|
||||
return div('card-header d-flex align-items-center', [
|
||||
'<a class="d-flex align-items-center text-white" href="' . shift_link($shift) . '">' . $shift_heading . '</a>',
|
||||
$header_buttons
|
||||
$header_buttons,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ function ShiftEntry_delete_view_admin(Shift $shift, AngelType $angeltype, User $
|
|||
form([
|
||||
buttons([
|
||||
button(user_link($signoff_user->id), icon('x-lg') . __('cancel')),
|
||||
form_submit('delete', icon('trash') . __('sign off'), 'btn-danger', false)
|
||||
form_submit('delete', icon('trash') . __('sign off'), 'btn-danger', false),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
|
@ -100,8 +100,8 @@ function ShiftEntry_create_view_admin(
|
|||
form([
|
||||
form_select('angeltype_id', __('Angeltype'), $angeltypes_select, $angeltype->id),
|
||||
form_select('user_id', __('User'), $users_select, $signup_user->id),
|
||||
form_submit('submit', icon('check-lg') . __('Save'))
|
||||
])
|
||||
form_submit('submit', icon('check-lg') . __('Save')),
|
||||
]),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -130,8 +130,8 @@ function ShiftEntry_create_view_supporter(Shift $shift, Room $room, AngelType $a
|
|||
), true),
|
||||
form([
|
||||
form_select('user_id', __('User'), $users_select, $signup_user->id),
|
||||
form_submit('submit', icon('check-lg') . __('Save'))
|
||||
])
|
||||
form_submit('submit', icon('check-lg') . __('Save')),
|
||||
]),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -156,8 +156,8 @@ function ShiftEntry_create_view_user(Shift $shift, Room $room, AngelType $angelt
|
|||
info(sprintf(__('Do you want to sign up for this shift as %s?'), AngelType_name_render($angeltype)), true),
|
||||
form([
|
||||
form_textarea('comment', __('Comment (for your eyes only):'), $comment),
|
||||
form_submit('submit', icon('check-lg') . __('Save'))
|
||||
])
|
||||
form_submit('submit', icon('check-lg') . __('Save')),
|
||||
]),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ function ShiftEntry_edit_view(
|
|||
'freeloaded_comment',
|
||||
__('Freeload comment (Only for shift coordination):'),
|
||||
$freeloaded_comment
|
||||
)
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ function ShiftEntry_edit_view(
|
|||
form_info(__('Type:'), $type),
|
||||
$comment,
|
||||
join('', $freeload_form),
|
||||
form_submit('submit', __('Save'))
|
||||
])
|
||||
form_submit('submit', __('Save')),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -48,14 +48,14 @@ function ShiftType_edit_view($name, $description, $shifttype_id)
|
|||
return page_with_title($shifttype_id ? __('Edit shifttype') : __('Create shifttype'), [
|
||||
msg(),
|
||||
buttons([
|
||||
button(page_link_to('shifttypes'), shifttypes_title(), 'back')
|
||||
button(page_link_to('shifttypes'), shifttypes_title(), 'back'),
|
||||
]),
|
||||
form([
|
||||
form_text('name', __('Name'), $name),
|
||||
form_textarea('description', __('Description'), $description),
|
||||
form_info('', __('Please use markdown for the description.')),
|
||||
form_submit('submit', __('Save'))
|
||||
])
|
||||
form_submit('submit', __('Save')),
|
||||
]),
|
||||
], true);
|
||||
}
|
||||
|
||||
|
@ -80,10 +80,10 @@ function ShiftType_view(ShiftType $shifttype)
|
|||
page_link_to('shifttypes', ['action' => 'delete', 'shifttype_id' => $shifttype->id]),
|
||||
icon('trash') . __('delete'),
|
||||
'delete'
|
||||
)
|
||||
),
|
||||
]),
|
||||
heading(__('Description'), 2),
|
||||
$parsedown->parse($shifttype->description)
|
||||
$parsedown->parse($shifttype->description),
|
||||
], true);
|
||||
}
|
||||
|
||||
|
@ -112,18 +112,18 @@ function ShiftTypes_list_view($shifttypes)
|
|||
page_link_to('shifttypes', ['action' => 'delete', 'shifttype_id' => $shifttype->id]),
|
||||
icon('trash') . __('delete'),
|
||||
'btn-sm'
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
return page_with_title(shifttypes_title(), [
|
||||
msg(),
|
||||
buttons([
|
||||
button(page_link_to('shifttypes', ['action' => 'edit']), __('New shifttype'), 'add')
|
||||
button(page_link_to('shifttypes', ['action' => 'edit']), __('New shifttype'), 'add'),
|
||||
]),
|
||||
table([
|
||||
'name' => __('Name'),
|
||||
'actions' => ''
|
||||
], $shifttypes)
|
||||
'actions' => '',
|
||||
], $shifttypes),
|
||||
], true);
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ class ShiftsFilterRenderer
|
|||
}
|
||||
}
|
||||
return div('mb-3', [
|
||||
toolbar_pills($toolbar)
|
||||
toolbar_pills($toolbar),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ function Shift_view_header(Shift $shift, Room $room)
|
|||
. ($shift->url != ''
|
||||
? '<a href="' . $shift->url . '">' . $shift->title . '</a>'
|
||||
: $shift->title)
|
||||
. '</p>'
|
||||
. '</p>',
|
||||
]),
|
||||
div('col-sm-3 col-xs-6', [
|
||||
'<h4>' . __('Start') . '</h4>',
|
||||
|
@ -34,7 +34,7 @@ function Shift_view_header(Shift $shift, Room $room)
|
|||
icon('calendar-event') . $shift->start->format(__('Y-m-d')),
|
||||
'<br />',
|
||||
icon('clock') . $shift->start->format('H:i'),
|
||||
'</p>'
|
||||
'</p>',
|
||||
]),
|
||||
div('col-sm-3 col-xs-6', [
|
||||
'<h4>' . __('End') . '</h4>',
|
||||
|
@ -42,12 +42,12 @@ function Shift_view_header(Shift $shift, Room $room)
|
|||
icon('calendar-event') . $shift->end->format(__('Y-m-d')),
|
||||
'<br />',
|
||||
icon('clock') . $shift->end->format('H:i'),
|
||||
'</p>'
|
||||
'</p>',
|
||||
]),
|
||||
div('col-sm-3 col-xs-6', [
|
||||
'<h4>' . __('Location') . '</h4>',
|
||||
'<p class="lead">' . Room_name_render($room) . '</p>'
|
||||
])
|
||||
'<p class="lead">' . Room_name_render($room) . '</p>',
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -184,13 +184,13 @@ function Shift_view(Shift $shift, ShiftType $shifttype, Room $room, $angeltypes_
|
|||
$content[] = div('row', [
|
||||
div('col-sm-6', [
|
||||
'<h2>' . __('Needed angels') . '</h2>',
|
||||
'<div class="list-group">' . $needed_angels . '</div>'
|
||||
'<div class="list-group">' . $needed_angels . '</div>',
|
||||
]),
|
||||
div('col-sm-6', [
|
||||
'<h2>' . __('Description') . '</h2>',
|
||||
$parsedown->parse($shifttype->description),
|
||||
$parsedown->parse($shift->description),
|
||||
])
|
||||
]),
|
||||
]);
|
||||
|
||||
if ($shift_admin) {
|
||||
|
|
|
@ -56,7 +56,7 @@ function UserAngelTypes_delete_all_view(AngelType $angeltype)
|
|||
),
|
||||
icon('x-lg') . __('cancel')
|
||||
),
|
||||
form_submit('deny_all', icon('check-lg') . __('yes'), 'btn-primary', false)
|
||||
form_submit('deny_all', icon('check-lg') . __('yes'), 'btn-primary', false),
|
||||
]),
|
||||
], page_link_to('user_angeltypes', ['action' => 'delete_all', 'angeltype_id' => $angeltype->id])),
|
||||
]);
|
||||
|
@ -148,14 +148,14 @@ function UserAngelType_add_view(AngelType $angeltype, $users_source, $user_id)
|
|||
page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype->id]),
|
||||
__('back'),
|
||||
'back'
|
||||
)
|
||||
),
|
||||
]),
|
||||
form([
|
||||
form_info(__('Angeltype'), $angeltype->name),
|
||||
form_checkbox('auto_confirm_user', __('Confirm user'), true),
|
||||
form_select('user_id', __('User'), $users, $user_id),
|
||||
form_submit('submit', __('Add'))
|
||||
])
|
||||
form_submit('submit', __('Add')),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ function UserAngelType_join_view($user, AngelType $angeltype)
|
|||
auth()->can('admin_user_angeltypes') ? form_checkbox('auto_confirm_user', __('Confirm user'), true) : '',
|
||||
buttons([
|
||||
button(angeltype_link($angeltype->id), icon('x-lg') . __('cancel')),
|
||||
form_submit('submit', icon('check-lg') . __('save'), 'btn-primary', false)
|
||||
form_submit('submit', icon('check-lg') . __('save'), 'btn-primary', false),
|
||||
]),
|
||||
], page_link_to(
|
||||
'user_angeltypes',
|
||||
|
|
|
@ -14,7 +14,7 @@ function UserDriverLicense_edit_view($user_source, $user_driver_license)
|
|||
{
|
||||
return page_with_title(sprintf(__('Edit %s driving license information'), User_Nick_render($user_source)), [
|
||||
buttons([
|
||||
button(user_link($user_source->id), __('Back to profile'), 'back')
|
||||
button(user_link($user_source->id), __('Back to profile'), 'back'),
|
||||
]),
|
||||
msg(),
|
||||
form([
|
||||
|
@ -47,9 +47,9 @@ function UserDriverLicense_edit_view($user_source, $user_driver_license)
|
|||
'has_license_forklift',
|
||||
__('Forklift'),
|
||||
$user_driver_license->drive_forklift
|
||||
)
|
||||
),
|
||||
], 'driving_license'),
|
||||
form_submit('submit', __('Save'))
|
||||
form_submit('submit', __('Save')),
|
||||
]),
|
||||
'
|
||||
<script type="text/javascript">
|
||||
|
@ -68,6 +68,6 @@ function UserDriverLicense_edit_view($user_source, $user_driver_license)
|
|||
});
|
||||
}
|
||||
</script>
|
||||
'
|
||||
',
|
||||
], true);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,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), icon('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?'),
|
||||
|
@ -29,8 +29,8 @@ function User_delete_view($user)
|
|||
),
|
||||
form([
|
||||
form_password('password', __('Your password'), 'current-password'),
|
||||
form_submit('submit', __('Delete'))
|
||||
])
|
||||
form_submit('submit', __('Delete')),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,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), icon('chevron-left') . __('back'))
|
||||
button(user_link($user->id), icon('chevron-left') . __('back')),
|
||||
]),
|
||||
info(sprintf(
|
||||
$user->state->force_active
|
||||
|
@ -56,10 +56,10 @@ function User_edit_vouchers_view($user)
|
|||
form(
|
||||
[
|
||||
form_spinner('vouchers', __('Number of vouchers given out'), $user->state->got_voucher),
|
||||
form_submit('submit', __('Save'))
|
||||
form_submit('submit', __('Save')),
|
||||
],
|
||||
page_link_to('users', ['action' => 'edit_vouchers', 'user_id' => $user->id])
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,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_icon(page_link_to('admin_user', ['id' => $user->id]), 'pencil', 'btn-sm')
|
||||
button_icon(page_link_to('admin_user', ['id' => $user->id]), 'pencil', 'btn-sm'),
|
||||
]);
|
||||
$usersList[] = $u;
|
||||
}
|
||||
|
@ -122,11 +122,11 @@ function Users_view(
|
|||
'force_active' => $force_active_count,
|
||||
'freeloads' => $freeloads_count,
|
||||
'got_shirt' => $tshirts_count,
|
||||
'actions' => '<strong>' . count($usersList) . '</strong>'
|
||||
'actions' => '<strong>' . count($usersList) . '</strong>',
|
||||
];
|
||||
|
||||
$user_table_headers = [
|
||||
'name' => Users_table_header_link('name', __('Nick'), $order_by)
|
||||
'name' => Users_table_header_link('name', __('Nick'), $order_by),
|
||||
];
|
||||
if (config('enable_user_name')) {
|
||||
$user_table_headers['first_name'] = Users_table_header_link('first_name', __('Prename'), $order_by);
|
||||
|
@ -172,9 +172,9 @@ function Users_view(
|
|||
return page_with_title(__('All users'), [
|
||||
msg(),
|
||||
buttons([
|
||||
button(page_link_to('register'), icon('plus-lg') . __('New user'))
|
||||
button(page_link_to('register'), icon('plus-lg') . __('New user')),
|
||||
]),
|
||||
table($user_table_headers, $usersList)
|
||||
table($user_table_headers, $usersList),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -312,7 +312,7 @@ function User_view_myshift(Shift $shift, $user_source, $its_me)
|
|||
'duration' => sprintf('%.2f', ($shift->end->timestamp - $shift->start->timestamp) / 3600) . ' h',
|
||||
'room' => Room_name_render($shift->room),
|
||||
'shift_info' => $shift_info,
|
||||
'comment' => ''
|
||||
'comment' => '',
|
||||
];
|
||||
|
||||
if ($its_me) {
|
||||
|
@ -332,7 +332,7 @@ function User_view_myshift(Shift $shift, $user_source, $its_me)
|
|||
}
|
||||
|
||||
$myshift['actions'] = [
|
||||
button(shift_link($shift), icon('eye') . __('view'), 'btn-sm')
|
||||
button(shift_link($shift), icon('eye') . __('view'), 'btn-sm'),
|
||||
];
|
||||
if ($its_me || auth()->can('user_shifts_admin')) {
|
||||
$myshift['actions'][] = button(
|
||||
|
@ -403,7 +403,7 @@ function User_view_myshifts(
|
|||
'room' => '',
|
||||
'shift_info' => '',
|
||||
'comment' => '',
|
||||
'actions' => ''
|
||||
'actions' => '',
|
||||
];
|
||||
if (config('enable_tshirt_size', false) && ($its_me || $tshirt_admin)) {
|
||||
$myshifts_table[] = [
|
||||
|
@ -412,7 +412,7 @@ function User_view_myshifts(
|
|||
'room' => '',
|
||||
'shift_info' => '',
|
||||
'comment' => '',
|
||||
'actions' => ''
|
||||
'actions' => '',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -440,7 +440,7 @@ function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege)
|
|||
url('/admin/user/' . $worklog->user->id . '/worklog/' . $worklog->id . '/delete'),
|
||||
icon('trash') . __('delete'),
|
||||
'btn-sm'
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege)
|
|||
User_Nick_render($worklog->creator),
|
||||
$worklog->created_at->format('Y-m-d H:i')
|
||||
),
|
||||
'actions' => $actions
|
||||
'actions' => $actions,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -512,7 +512,7 @@ function User_view(
|
|||
'room' => __('Location'),
|
||||
'shift_info' => __('Name & workmates'),
|
||||
'comment' => __('Comment'),
|
||||
'actions' => __('Action')
|
||||
'actions' => __('Action'),
|
||||
], $my_shifts);
|
||||
} elseif ($user_source->state->force_active) {
|
||||
$myshifts_table = success(__('You have done enough.'), true);
|
||||
|
@ -554,7 +554,7 @@ function User_view(
|
|||
form([
|
||||
form_hidden('action', 'arrived'),
|
||||
form_hidden('user', $user_source->id),
|
||||
form_submit('submit', __('arrived'), '', false)
|
||||
form_submit('submit', __('arrived'), '', false),
|
||||
], page_link_to('admin_arrive'), true) : '',
|
||||
($admin_user_privilege || $auth->can('voucher.edit')) && config('enable_voucher') ?
|
||||
button(
|
||||
|
@ -588,9 +588,9 @@ function User_view(
|
|||
)) ? button(
|
||||
page_link_to('user_myshifts', ['reset' => 1]),
|
||||
icon('arrow-repeat') . __('Reset API key')
|
||||
) : ''
|
||||
])
|
||||
])
|
||||
) : '',
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
div('row user-info', [
|
||||
div('col-md-2', [
|
||||
|
@ -641,7 +641,7 @@ function User_view(
|
|||
page_link_to('user_shifts')
|
||||
), true)
|
||||
: '',
|
||||
$its_me ? ical_hint() : ''
|
||||
$its_me ? ical_hint() : '',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -664,7 +664,7 @@ function User_view_state($admin_user_privilege, $freeloader, $user_source)
|
|||
|
||||
return div('col-md-2', [
|
||||
heading(__('User state'), 4),
|
||||
join('<br>', $state)
|
||||
join('<br>', $state),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -677,7 +677,7 @@ function User_view_state($admin_user_privilege, $freeloader, $user_source)
|
|||
function User_view_state_user($user_source)
|
||||
{
|
||||
$state = [
|
||||
User_shift_state_render($user_source)
|
||||
User_shift_state_render($user_source),
|
||||
];
|
||||
|
||||
if ($user_source->state->arrived) {
|
||||
|
@ -771,7 +771,7 @@ function User_angeltypes_render($user_angeltypes)
|
|||
}
|
||||
return div('col-md-2', [
|
||||
heading(__('Angeltypes'), 4),
|
||||
join('<br>', $output)
|
||||
join('<br>', $output),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -788,7 +788,7 @@ function User_groups_render($user_groups)
|
|||
|
||||
return div('col-md-2', [
|
||||
'<h4>' . __('Rights') . '</h4>',
|
||||
join('<br>', $output)
|
||||
join('<br>', $output),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ class NewsController extends BaseController
|
|||
'Deleted {type} "{news}"',
|
||||
[
|
||||
'type' => $news->is_meeting ? 'meeting' : 'news',
|
||||
'news' => $news->title
|
||||
'news' => $news->title,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class UserShirtController extends BaseController
|
|||
'size' => $user->personalData->shirt_size,
|
||||
'arrived' => $user->state->arrived ? 'yes' : 'no',
|
||||
'active' => $user->state->active ? 'yes' : 'no',
|
||||
'got_shirt' => $user->state->got_shirt ? 'yes' : 'no'
|
||||
'got_shirt' => $user->state->got_shirt ? 'yes' : 'no',
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ class UserWorkLogController extends BaseController
|
|||
|
||||
return $this->response->withView(
|
||||
'admin/user/delete-worklog.twig',
|
||||
[ 'user' => $user ]
|
||||
['user' => $user]
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ class FeedController extends BaseController
|
|||
...$entry->toArray(),
|
||||
|
||||
// Fahrplan app required data
|
||||
...$data
|
||||
...$data,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class MessagesController extends BaseController
|
|||
$users = $this->user->orderBy('name')->get()
|
||||
->except($currentUser->id)
|
||||
->mapWithKeys(function ($u) {
|
||||
return [ $u->id => $u->name ];
|
||||
return [$u->id => $u->name];
|
||||
});
|
||||
$users->prepend($currentUser->name, $currentUser->id);
|
||||
|
||||
|
@ -76,7 +76,7 @@ class MessagesController extends BaseController
|
|||
'pages/messages/overview.twig',
|
||||
[
|
||||
'conversations' => $conversations,
|
||||
'users' => $users
|
||||
'users' => $users,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ class MessagesController extends BaseController
|
|||
->groupBy('user_id')
|
||||
->get(['user_id', 'amount'])
|
||||
->mapWithKeys(function ($unread) {
|
||||
return [ $unread->user_id => $unread->amount ];
|
||||
return [$unread->user_id => $unread->amount];
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ class Controller extends BaseController
|
|||
'tshirts_issued' => ['type' => 'counter', 'help' => 'Issued T-Shirts', $this->stats->tshirts()],
|
||||
'tshirt_sizes' => [
|
||||
'type' => 'gauge',
|
||||
'help' => 'The sizes users have configured'
|
||||
'help' => 'The sizes users have configured',
|
||||
] + $userTshirtSizes,
|
||||
'locales' => ['type' => 'gauge', 'help' => 'The locales users have configured'] + $userLocales,
|
||||
'themes' => ['type' => 'gauge', 'help' => 'The themes users have configured'] + $userThemes,
|
||||
|
|
|
@ -56,7 +56,7 @@ class OAuthController extends BaseController
|
|||
[
|
||||
// Leauge separates scopes by comma, which is wrong, so we do it
|
||||
// here properly by spaces. See https://www.rfc-editor.org/rfc/rfc6749#section-3.3
|
||||
'scope' => join(' ', $config['scope'] ?? [])
|
||||
'scope' => join(' ', $config['scope'] ?? []),
|
||||
]
|
||||
);
|
||||
$this->session->set('oauth2_state', $provider->getState());
|
||||
|
@ -80,7 +80,7 @@ class OAuthController extends BaseController
|
|||
$accessToken = $provider->getAccessToken(
|
||||
'authorization_code',
|
||||
[
|
||||
'code' => $request->get('code')
|
||||
'code' => $request->get('code'),
|
||||
]
|
||||
);
|
||||
} catch (IdentityProviderException $e) {
|
||||
|
@ -258,7 +258,7 @@ class OAuthController extends BaseController
|
|||
'provider' => $providerName,
|
||||
'user' => $this->getId($providerName, $resourceOwner),
|
||||
'name' => $user->name,
|
||||
'id' => $user->id
|
||||
'id' => $user->id,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ class SettingsController extends BaseController
|
|||
'pages/settings/password',
|
||||
[
|
||||
'settings_menu' => $this->settingsMenu(),
|
||||
'min_length' => config('min_password_length')
|
||||
'min_length' => config('min_password_length'),
|
||||
] + $this->getNotifications()
|
||||
);
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ class SettingsController extends BaseController
|
|||
[
|
||||
'settings_menu' => $this->settingsMenu(),
|
||||
'themes' => $themes,
|
||||
'current_theme' => $currentTheme
|
||||
'current_theme' => $currentTheme,
|
||||
] + $this->getNotifications()
|
||||
);
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ class SettingsController extends BaseController
|
|||
[
|
||||
'settings_menu' => $this->settingsMenu(),
|
||||
'languages' => $languages,
|
||||
'current_language' => $currentLanguage
|
||||
'current_language' => $currentLanguage,
|
||||
] + $this->getNotifications()
|
||||
);
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ class SettingsController extends BaseController
|
|||
url('/settings/profile') => 'settings.profile',
|
||||
url('/settings/password') => 'settings.password',
|
||||
url('/settings/language') => 'settings.language',
|
||||
url('/settings/theme') => 'settings.theme'
|
||||
url('/settings/theme') => 'settings.theme',
|
||||
];
|
||||
|
||||
if (!empty(config('oauth'))) {
|
||||
|
|
|
@ -160,7 +160,7 @@ class BarChart
|
|||
[
|
||||
|
||||
'count' => '#090',
|
||||
'sum' => '#888'
|
||||
'sum' => '#888',
|
||||
],
|
||||
$demoData,
|
||||
];
|
||||
|
|
|
@ -38,7 +38,7 @@ class Question extends BaseModel
|
|||
|
||||
/** @var array<string> */
|
||||
protected $dates = [ // phpcs:ignore
|
||||
'answered_at'
|
||||
'answered_at',
|
||||
];
|
||||
|
||||
/** @var array<string> */
|
||||
|
|
|
@ -26,7 +26,7 @@ class NewsControllerTest extends ControllerTest
|
|||
'title' => 'Foo',
|
||||
'text' => '**foo**',
|
||||
'user_id' => 1,
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -110,7 +110,7 @@ class UserWorkLogControllerTest extends ControllerTest
|
|||
'user_id' => $this->user->id,
|
||||
'worked_at' => new Carbon('2022-01-01'),
|
||||
'hours' => 3.14,
|
||||
'comment' => 'a comment'
|
||||
'comment' => 'a comment',
|
||||
])->create();
|
||||
|
||||
$request = $this->request
|
||||
|
|
|
@ -71,7 +71,7 @@ class ControllerTest extends TestCase
|
|||
$this->assertArraySubset(['tshirt_sizes' => [
|
||||
'type' => 'gauge',
|
||||
['labels' => ['size' => 'L'], 2],
|
||||
['labels' => ['size' => 'XL'], 0]
|
||||
['labels' => ['size' => 'XL'], 0],
|
||||
]], $data);
|
||||
|
||||
return 'metrics return';
|
||||
|
|
|
@ -77,7 +77,7 @@ engelsystem_test_minimum_histogram_count 4
|
|||
EOD,
|
||||
$engine->get('/metrics', [
|
||||
'test_minimum_histogram' => [
|
||||
'type' => 'histogram', [3 => 4, 'sum' => 1.337]
|
||||
'type' => 'histogram', [3 => 4, 'sum' => 1.337],
|
||||
],
|
||||
])
|
||||
);
|
||||
|
@ -96,7 +96,7 @@ EOD,
|
|||
$engine->get('/metrics', [
|
||||
'test_short_histogram' => [
|
||||
'type' => 'histogram',
|
||||
'value' => [120 => 19, '+Inf' => 300, 60 => 10, 0 => 0, 'sum' => 123.456]
|
||||
'value' => [120 => 19, '+Inf' => 300, 60 => 10, 0 => 0, 'sum' => 123.456],
|
||||
],
|
||||
])
|
||||
);
|
||||
|
@ -134,7 +134,7 @@ engelsystem_test_minimum_histogram_count NaN
|
|||
EOD,
|
||||
$engine->get('/metrics', [
|
||||
'test_minimum_histogram' => [
|
||||
'type' => 'histogram', []
|
||||
'type' => 'histogram', [],
|
||||
],
|
||||
])
|
||||
);
|
||||
|
|
|
@ -155,7 +155,7 @@ class StatsTest extends TestCase
|
|||
'creator_id' => 1,
|
||||
'hours' => 2.4,
|
||||
'comment' => '',
|
||||
'worked_at' => new Carbon()
|
||||
'worked_at' => new Carbon(),
|
||||
];
|
||||
(new Worklog($worklogData))->save();
|
||||
(new Worklog(['hours' => 1.2, 'user_id' => 3] + $worklogData))->save();
|
||||
|
@ -183,7 +183,7 @@ class StatsTest extends TestCase
|
|||
2 * 60 * 60,
|
||||
3 * 60 * 60,
|
||||
4 * 60 * 60,
|
||||
'+Inf'
|
||||
'+Inf',
|
||||
]);
|
||||
|
||||
$this->assertEquals([
|
||||
|
|
|
@ -387,7 +387,7 @@ class OAuthControllerTest extends TestCase
|
|||
['unsupported_response_type'],
|
||||
['invalid_scope'],
|
||||
['server_error'],
|
||||
['temporarily_unavailable']
|
||||
['temporarily_unavailable'],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -612,7 +612,7 @@ class OAuthControllerTest extends TestCase
|
|||
$this->oauth,
|
||||
$this->redirect,
|
||||
$this->session,
|
||||
$this->url
|
||||
$this->url,
|
||||
])
|
||||
->onlyMethods($mockMethods)
|
||||
->getMock();
|
||||
|
|
|
@ -208,7 +208,7 @@ class PasswordResetControllerTest extends TestCase
|
|||
'session' => $session,
|
||||
'mailer' => $mailer,
|
||||
'log' => $log,
|
||||
'renderer' => $renderer
|
||||
'renderer' => $renderer,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ class SettingsControllerTest extends ControllerTest
|
|||
$body = [
|
||||
'password' => 'password',
|
||||
'new_password' => 'newpassword',
|
||||
'new_password2' => 'newpassword'
|
||||
'new_password2' => 'newpassword',
|
||||
];
|
||||
$this->request = $this->request->withParsedBody($body);
|
||||
|
||||
|
@ -286,7 +286,7 @@ class SettingsControllerTest extends ControllerTest
|
|||
|
||||
$body = [
|
||||
'new_password' => 'anotherpassword',
|
||||
'new_password2' => 'anotherpassword'
|
||||
'new_password2' => 'anotherpassword',
|
||||
];
|
||||
$this->request = $this->request->withParsedBody($body);
|
||||
|
||||
|
@ -311,7 +311,7 @@ class SettingsControllerTest extends ControllerTest
|
|||
$body = [
|
||||
'password' => 'wrongpassword',
|
||||
'new_password' => 'newpassword',
|
||||
'new_password2' => 'newpassword'
|
||||
'new_password2' => 'newpassword',
|
||||
];
|
||||
$this->request = $this->request->withParsedBody($body);
|
||||
|
||||
|
@ -342,7 +342,7 @@ class SettingsControllerTest extends ControllerTest
|
|||
$body = [
|
||||
'password' => 'password',
|
||||
'new_password' => 'newpassword',
|
||||
'new_password2' => 'wrongpassword'
|
||||
'new_password2' => 'wrongpassword',
|
||||
];
|
||||
$this->request = $this->request->withParsedBody($body);
|
||||
|
||||
|
@ -371,7 +371,7 @@ class SettingsControllerTest extends ControllerTest
|
|||
[null, 'newpassword', 'newpassword'],
|
||||
['password', null, 'newpassword'],
|
||||
['password', 'newpassword', null],
|
||||
['password', 'short', 'short']
|
||||
['password', 'short', 'short'],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -389,7 +389,7 @@ class SettingsControllerTest extends ControllerTest
|
|||
$body = [
|
||||
'password' => $password,
|
||||
'new_password' => $newPassword,
|
||||
'new_password2' => $newPassword2
|
||||
'new_password2' => $newPassword2,
|
||||
];
|
||||
$this->request = $this->request->withParsedBody($body);
|
||||
|
||||
|
@ -594,7 +594,7 @@ class SettingsControllerTest extends ControllerTest
|
|||
'http://localhost/settings/password' => 'settings.password',
|
||||
'http://localhost/settings/language' => 'settings.language',
|
||||
'http://localhost/settings/theme' => 'settings.theme',
|
||||
'http://localhost/settings/oauth' => ['title' => 'settings.oauth', 'hidden' => false]
|
||||
'http://localhost/settings/oauth' => ['title' => 'settings.oauth', 'hidden' => false],
|
||||
], $this->controller->settingsMenu());
|
||||
|
||||
config(['oauth' => $providersHidden]);
|
||||
|
@ -603,7 +603,7 @@ class SettingsControllerTest extends ControllerTest
|
|||
'http://localhost/settings/password' => 'settings.password',
|
||||
'http://localhost/settings/language' => 'settings.language',
|
||||
'http://localhost/settings/theme' => 'settings.theme',
|
||||
'http://localhost/settings/oauth' => ['title' => 'settings.oauth', 'hidden' => true]
|
||||
'http://localhost/settings/oauth' => ['title' => 'settings.oauth', 'hidden' => true],
|
||||
], $this->controller->settingsMenu());
|
||||
}
|
||||
|
||||
|
@ -618,7 +618,7 @@ class SettingsControllerTest extends ControllerTest
|
|||
'http://localhost/settings/profile' => 'settings.profile',
|
||||
'http://localhost/settings/password' => 'settings.password',
|
||||
'http://localhost/settings/language' => 'settings.language',
|
||||
'http://localhost/settings/theme' => 'settings.theme'
|
||||
'http://localhost/settings/theme' => 'settings.theme',
|
||||
], $this->controller->settingsMenu());
|
||||
}
|
||||
|
||||
|
@ -631,18 +631,18 @@ class SettingsControllerTest extends ControllerTest
|
|||
|
||||
$themes = [
|
||||
0 => ['name' => 'Engelsystem light'],
|
||||
1 => ['name' => 'Engelsystem dark']
|
||||
1 => ['name' => 'Engelsystem dark'],
|
||||
];
|
||||
$languages = [
|
||||
'en_US' => 'English',
|
||||
'de_DE' => 'Deutsch'
|
||||
'de_DE' => 'Deutsch',
|
||||
];
|
||||
$tshirt_sizes = ['S' => 'Small'];
|
||||
$this->config = new Config([
|
||||
'min_password_length' => 6,
|
||||
'themes' => $themes,
|
||||
'locales' => $languages,
|
||||
'tshirt_sizes' => $tshirt_sizes
|
||||
'tshirt_sizes' => $tshirt_sizes,
|
||||
]);
|
||||
$this->app->instance('config', $this->config);
|
||||
$this->app->instance(Config::class, $this->config);
|
||||
|
|
|
@ -152,7 +152,7 @@ class MigrateTest extends TestCase
|
|||
$this->setExpects($migration, 'lockTable');
|
||||
$this->setExpects($migration, 'unlockTable');
|
||||
$this->setExpects($migration, 'getMigrations', null, collect([
|
||||
['migration' => '1234_01_23_123456_init_foo', 'path' => '/foo']
|
||||
['migration' => '1234_01_23_123456_init_foo', 'path' => '/foo'],
|
||||
]));
|
||||
$this->setExpects($migration, 'getMigrated', null, collect([]));
|
||||
$migration->expects($this->once())
|
||||
|
|
|
@ -30,8 +30,8 @@ class EventsServiceProviderTest extends ServiceProviderTest
|
|||
$config = new Config([
|
||||
'event-handlers' => [
|
||||
'test.event' => 'someFunction',
|
||||
'another.event' => ['Foo\Bar@baz', [$this, 'testRegister']]
|
||||
]
|
||||
'another.event' => ['Foo\Bar@baz', [$this, 'testRegister']],
|
||||
],
|
||||
]);
|
||||
$this->app->instance('config', $config);
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ class OAuth2Test extends TestCase
|
|||
'groups' => 'groups_key',
|
||||
'teams' => [
|
||||
'/test' => 21,
|
||||
'/lorem' => ['id' => 42, 'supporter' => true]
|
||||
'/lorem' => ['id' => 42, 'supporter' => true],
|
||||
],
|
||||
],
|
||||
]]);
|
||||
|
|
|
@ -22,7 +22,7 @@ class FakerProvider extends Base
|
|||
've',
|
||||
'xe',
|
||||
'ze',
|
||||
'zie'
|
||||
'zie',
|
||||
];
|
||||
|
||||
/** @var string[] */
|
||||
|
|
|
@ -77,7 +77,7 @@ class BarChartTest extends TestCase
|
|||
'rowLabels' => self::ROW_LABELS,
|
||||
'barChartClass' => '',
|
||||
'yLabels' => $yLabels,
|
||||
]
|
||||
],
|
||||
];
|
||||
yield 'non-empty data' => [
|
||||
self::DATA,
|
||||
|
|
|
@ -25,7 +25,7 @@ class DumpServerServiceProviderTest extends ServiceProviderTest
|
|||
$varDumpServerConfig = [
|
||||
'host' => 'localhost',
|
||||
'port' => 80,
|
||||
'enable' => true
|
||||
'enable' => true,
|
||||
];
|
||||
|
||||
$config = new Config();
|
||||
|
@ -69,7 +69,7 @@ class DumpServerServiceProviderTest extends ServiceProviderTest
|
|||
$varDumpServerConfig = [
|
||||
'host' => 'localhost',
|
||||
'port' => 80,
|
||||
'enable' => $enable
|
||||
'enable' => $enable,
|
||||
];
|
||||
|
||||
$config = new Config();
|
||||
|
|
|
@ -29,7 +29,7 @@ class UuidTest extends TestCase
|
|||
['42', 'a1d0c6e8-3f02-4327-9846-1063f4ac58a6'],
|
||||
[1.23, '579c4c7f-58e4-45e8-8cfc-73e08903a08c'],
|
||||
['1.23', '579c4c7f-58e4-45e8-8cfc-73e08903a08c'],
|
||||
['test', '098f6bcd-4621-4373-8ade-4e832627b4f6']
|
||||
['test', '098f6bcd-4621-4373-8ade-4e832627b4f6'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class SessionServiceProviderTest extends ServiceProviderTest
|
|||
[
|
||||
// 2 days
|
||||
'options' => ['cookie_httponly' => true, 'name' => 'session', 'cookie_lifetime' => 172800],
|
||||
'handler' => null
|
||||
'handler' => null,
|
||||
],
|
||||
],
|
||||
[Session::class],
|
||||
|
@ -70,7 +70,7 @@ class SessionServiceProviderTest extends ServiceProviderTest
|
|||
[
|
||||
// 5 days
|
||||
'options' => ['cookie_httponly' => true, 'name' => 'foobar', 'cookie_lifetime' => 432000],
|
||||
'handler' => $databaseHandler
|
||||
'handler' => $databaseHandler,
|
||||
],
|
||||
],
|
||||
[Session::class]
|
||||
|
|
|
@ -75,7 +75,7 @@ class LoggerTest extends ServiceProviderTest
|
|||
{
|
||||
return 'Bar';
|
||||
}
|
||||
}
|
||||
},
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class NewsTest extends ModelTest
|
|||
$this->newsData = [
|
||||
'title' => 'test title',
|
||||
'text' => 'test text',
|
||||
'user_id' => $this->user->id
|
||||
'user_id' => $this->user->id,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -128,9 +128,9 @@ class UserTest extends ModelTest
|
|||
],
|
||||
[
|
||||
'name' => 'Ipsum',
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue