add hints to myshifts table
This commit is contained in:
parent
f3a12ebda8
commit
c0088d6601
|
@ -346,7 +346,8 @@ return [
|
||||||
// Local timezone
|
// Local timezone
|
||||||
'timezone' => env('TIMEZONE', 'Europe/Berlin'),
|
'timezone' => env('TIMEZONE', 'Europe/Berlin'),
|
||||||
|
|
||||||
// Multiply 'night shifts' and freeloaded shifts (start or end between 2 and 6 exclusive) by 2
|
// Multiply 'night shifts' and freeloaded shifts (start or end between 2 and 8 exclusive) by 2 in goodie score
|
||||||
|
// Goodies must be enabled to use this feature
|
||||||
'night_shifts' => [
|
'night_shifts' => [
|
||||||
'enabled' => (bool) env('NIGHT_SHIFTS', true), // Disable to weigh every shift the same
|
'enabled' => (bool) env('NIGHT_SHIFTS', true), // Disable to weigh every shift the same
|
||||||
'start' => env('NIGHT_SHIFTS_START', 2),
|
'start' => env('NIGHT_SHIFTS_START', 2),
|
||||||
|
|
|
@ -327,7 +327,12 @@ function User_view_myshift(Shift $shift, $user_source, $its_me)
|
||||||
$night_shift = '';
|
$night_shift = '';
|
||||||
if (Shifts::isNightShift($shift->start, $shift->end) && $nightShiftsConfig['enabled'] && $goodie_enabled) {
|
if (Shifts::isNightShift($shift->start, $shift->end) && $nightShiftsConfig['enabled'] && $goodie_enabled) {
|
||||||
$night_shift = ' <span class="bi bi-moon-stars text-info" data-bs-toggle="tooltip" title="'
|
$night_shift = ' <span class="bi bi-moon-stars text-info" data-bs-toggle="tooltip" title="'
|
||||||
. __('Night shift')
|
. __('Night shifts between %d and %d am are multiplied by %d for the %s score.', [
|
||||||
|
$nightShiftsConfig['start'],
|
||||||
|
$nightShiftsConfig['end'],
|
||||||
|
$nightShiftsConfig['multiplier'],
|
||||||
|
($goodie_tshirt ? __('T-shirt') : __('goodie')),
|
||||||
|
])
|
||||||
. '"></span>';
|
. '"></span>';
|
||||||
}
|
}
|
||||||
$myshift = [
|
$myshift = [
|
||||||
|
@ -335,9 +340,9 @@ function User_view_myshift(Shift $shift, $user_source, $its_me)
|
||||||
. $shift->start->format(__('general.date')) . '<br>'
|
. $shift->start->format(__('general.date')) . '<br>'
|
||||||
. icon('clock-history') . $shift->start->format('H:i')
|
. icon('clock-history') . $shift->start->format('H:i')
|
||||||
. ' - '
|
. ' - '
|
||||||
. $shift->end->format(__('H:i'))
|
. $shift->end->format(__('H:i')),
|
||||||
. $night_shift,
|
|
||||||
'duration' => sprintf('%.2f', ($shift->end->timestamp - $shift->start->timestamp) / 3600) . ' h',
|
'duration' => sprintf('%.2f', ($shift->end->timestamp - $shift->start->timestamp) / 3600) . ' h',
|
||||||
|
'hints' => $night_shift,
|
||||||
'location' => location_name_render($shift->location),
|
'location' => location_name_render($shift->location),
|
||||||
'shift_info' => $shift_info,
|
'shift_info' => $shift_info,
|
||||||
'comment' => '',
|
'comment' => '',
|
||||||
|
@ -360,19 +365,20 @@ function User_view_myshift(Shift $shift, $user_source, $its_me)
|
||||||
. __('Freeloaded') . ': ' . htmlspecialchars($shift->freeloaded_comment)
|
. __('Freeloaded') . ': ' . htmlspecialchars($shift->freeloaded_comment)
|
||||||
. '</p>';
|
. '</p>';
|
||||||
} else {
|
} else {
|
||||||
if (!$goodie_enabled) {
|
|
||||||
$freeload_info = __('freeload.info');
|
|
||||||
} else {
|
|
||||||
$freeload_info = __('freeload.info.goodie', [($goodie_tshirt
|
|
||||||
? __('T-shirt score')
|
|
||||||
: __('Goodie score'))]);
|
|
||||||
}
|
|
||||||
$myshift['comment'] .= '<br /><p class="text-danger">'
|
$myshift['comment'] .= '<br /><p class="text-danger">'
|
||||||
. __('Freeloaded')
|
. __('Freeloaded')
|
||||||
. ' <span class="bi bi-info-circle-fill" data-bs-toggle="tooltip" title="'
|
. '</p>';
|
||||||
. $freeload_info
|
|
||||||
. '"></span></p>';
|
|
||||||
}
|
}
|
||||||
|
if (!$goodie_enabled) {
|
||||||
|
$freeload_info = __('freeload.info');
|
||||||
|
} else {
|
||||||
|
$freeload_info = __('freeload.info.goodie', [($goodie_tshirt
|
||||||
|
? __('T-shirt score')
|
||||||
|
: __('Goodie score'))]);
|
||||||
|
}
|
||||||
|
$myshift['hints'] .= ' <span class="bi bi-info-circle-fill text-danger" data-bs-toggle="tooltip" title="'
|
||||||
|
. $freeload_info
|
||||||
|
. '"></span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$myshift['actions'] = [
|
$myshift['actions'] = [
|
||||||
|
@ -464,6 +470,7 @@ function User_view_myshifts(
|
||||||
$myshifts_table[] = [
|
$myshifts_table[] = [
|
||||||
'date' => '<b>' . __('Sum:') . '</b>',
|
'date' => '<b>' . __('Sum:') . '</b>',
|
||||||
'duration' => '<b>' . sprintf('%.2f', round($timeSum / 3600, 2)) . ' h</b>',
|
'duration' => '<b>' . sprintf('%.2f', round($timeSum / 3600, 2)) . ' h</b>',
|
||||||
|
'hints' => '',
|
||||||
'location' => '',
|
'location' => '',
|
||||||
'shift_info' => '',
|
'shift_info' => '',
|
||||||
'comment' => '',
|
'comment' => '',
|
||||||
|
@ -473,6 +480,7 @@ function User_view_myshifts(
|
||||||
$myshifts_table[] = [
|
$myshifts_table[] = [
|
||||||
'date' => '<b>' . ($goodie_tshirt ? __('T-shirt score') : __('Goodie score')) . '™:</b>',
|
'date' => '<b>' . ($goodie_tshirt ? __('T-shirt score') : __('Goodie score')) . '™:</b>',
|
||||||
'duration' => '<b>' . $tshirt_score . '</b>',
|
'duration' => '<b>' . $tshirt_score . '</b>',
|
||||||
|
'hints' => '',
|
||||||
'location' => '',
|
'location' => '',
|
||||||
'shift_info' => '',
|
'shift_info' => '',
|
||||||
'comment' => '',
|
'comment' => '',
|
||||||
|
@ -515,6 +523,7 @@ function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege)
|
||||||
return [
|
return [
|
||||||
'date' => icon('calendar-event') . date(__('general.date'), $worklog->worked_at->timestamp),
|
'date' => icon('calendar-event') . date(__('general.date'), $worklog->worked_at->timestamp),
|
||||||
'duration' => sprintf('%.2f', $worklog->hours) . ' h',
|
'duration' => sprintf('%.2f', $worklog->hours) . ' h',
|
||||||
|
'hints' => '',
|
||||||
'location' => '',
|
'location' => '',
|
||||||
'shift_info' => __('Work log entry'),
|
'shift_info' => __('Work log entry'),
|
||||||
'comment' => htmlspecialchars($worklog->comment) . '<br>'
|
'comment' => htmlspecialchars($worklog->comment) . '<br>'
|
||||||
|
@ -584,6 +593,7 @@ function User_view(
|
||||||
$myshifts_table = div('table-responsive', table([
|
$myshifts_table = div('table-responsive', table([
|
||||||
'date' => __('Day & Time'),
|
'date' => __('Day & Time'),
|
||||||
'duration' => __('Duration'),
|
'duration' => __('Duration'),
|
||||||
|
'hints' => '',
|
||||||
'location' => __('Location'),
|
'location' => __('Location'),
|
||||||
'shift_info' => __('Name & Workmates'),
|
'shift_info' => __('Name & Workmates'),
|
||||||
'comment' => __('worklog.comment'),
|
'comment' => __('worklog.comment'),
|
||||||
|
|
|
@ -1232,9 +1232,6 @@ msgstr "JSON Export"
|
||||||
msgid "Night shifts between %d and %d am are multiplied by %d for the %s score."
|
msgid "Night shifts between %d and %d am are multiplied by %d for the %s score."
|
||||||
msgstr "Nachtschichten zwischen %d und %d Uhr werden für den %4$s Score mit %3$d multipliziert."
|
msgstr "Nachtschichten zwischen %d und %d Uhr werden für den %4$s Score mit %3$d multipliziert."
|
||||||
|
|
||||||
msgid "Night shifts"
|
|
||||||
msgstr "Nachtschicht"
|
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Go to the <a href=\"%s\">shifts table</a> to sign yourself up for some "
|
"Go to the <a href=\"%s\">shifts table</a> to sign yourself up for some "
|
||||||
"shifts."
|
"shifts."
|
||||||
|
|
Loading…
Reference in New Issue