show user-info icon with admin_arrive permission
This commit is contained in:
parent
a35a3580e0
commit
48ea35562e
|
@ -98,7 +98,11 @@ function admin_arrive()
|
|||
}
|
||||
}
|
||||
|
||||
$usr->name = User_Nick_render($usr) . User_Pronoun_render($usr);
|
||||
$usr->name = User_Nick_render($usr)
|
||||
. User_Pronoun_render($usr)
|
||||
. ($usr->state->user_info
|
||||
? ' <small><span class="bi bi-info-circle-fill text-info"></span></small>'
|
||||
: '');
|
||||
$plannedDepartureDate = $usr->personalData->planned_departure_date;
|
||||
$arrivalDate = $usr->state->arrival_date;
|
||||
$plannedArrivalDate = $usr->personalData->planned_arrival_date;
|
||||
|
|
|
@ -97,7 +97,11 @@ function admin_free()
|
|||
|
||||
$email = $usr->contact->email ?: $usr->email;
|
||||
$free_users_table[] = [
|
||||
'name' => User_Nick_render($usr) . User_Pronoun_render($usr),
|
||||
'name' => User_Nick_render($usr)
|
||||
. User_Pronoun_render($usr)
|
||||
. ($usr->state->user_info
|
||||
? ' <small><span class="bi bi-info-circle-fill text-info"></span></small>'
|
||||
: ''),
|
||||
'shift_state' => User_shift_state_render($usr),
|
||||
'last_shift' => User_last_shift_render($usr),
|
||||
'dect' => sprintf('<a href="tel:%s">%1$s</a>', htmlspecialchars((string) $usr->contact->dect)),
|
||||
|
|
|
@ -282,7 +282,7 @@ function view_user_shifts()
|
|||
$end_time = $shiftsFilter->getEnd()->format('H:i');
|
||||
|
||||
if (config('signup_requires_arrival') && !$user->state->arrived) {
|
||||
info(render_user_arrived_hint());
|
||||
info(render_user_arrived_hint((bool) $user->state->user_info));
|
||||
}
|
||||
|
||||
$formattedDays = collect($days)->map(function ($value) {
|
||||
|
|
|
@ -17,7 +17,7 @@ function location_view(Location $location, ShiftsFilterRenderer $shiftsFilterRen
|
|||
|
||||
$assignNotice = '';
|
||||
if (config('signup_requires_arrival') && !$user->state->arrived) {
|
||||
$assignNotice = info(render_user_arrived_hint(), true);
|
||||
$assignNotice = info(render_user_arrived_hint((bool) $user->state->user_info), true);
|
||||
}
|
||||
|
||||
$description = '';
|
||||
|
|
|
@ -92,7 +92,11 @@ function Users_view(
|
|||
$usersList = [];
|
||||
foreach ($users as $user) {
|
||||
$u = [];
|
||||
$u['name'] = User_Nick_render($user) . User_Pronoun_render($user);
|
||||
$u['name'] = User_Nick_render($user)
|
||||
. User_Pronoun_render($user)
|
||||
. ($user->state->user_info
|
||||
? ' <small><span class="bi bi-info-circle-fill text-info"></span></small>'
|
||||
: '');
|
||||
$u['first_name'] = htmlspecialchars((string) $user->personalData->first_name);
|
||||
$u['last_name'] = htmlspecialchars((string) $user->personalData->last_name);
|
||||
$u['dect'] = sprintf('<a href="tel:%s">%1$s</a>', htmlspecialchars((string) $user->contact->dect));
|
||||
|
@ -519,6 +523,7 @@ function User_view(
|
|||
$nightShiftsConfig = config('night_shifts');
|
||||
$user_name = htmlspecialchars((string) $user_source->personalData->first_name) . ' '
|
||||
. htmlspecialchars((string) $user_source->personalData->last_name);
|
||||
$user_info_show = auth()->can('user.info.show');
|
||||
$myshifts_table = '';
|
||||
if ($its_me || $admin_user_privilege || $tshirt_admin) {
|
||||
$my_shifts = User_view_myshifts(
|
||||
|
@ -564,10 +569,12 @@ function User_view(
|
|||
. htmlspecialchars($user_source->name)
|
||||
. (config('enable_user_name') ? ' <small>' . $user_name . '</small>' : '')
|
||||
. (
|
||||
(auth()->can('user.info.show') && $user_source->state->user_info)
|
||||
(($user_info_show || auth()->can('admin_arrive')) && $user_source->state->user_info)
|
||||
? (
|
||||
' <small><span class="bi bi-info-circle-fill text-info" data-bs-toggle="tooltip" title="'
|
||||
. htmlspecialchars($user_source->state->user_info)
|
||||
' <small><span class="bi bi-info-circle-fill text-info" '
|
||||
. ($user_info_show
|
||||
? 'data-bs-toggle="tooltip" title="' . htmlspecialchars($user_source->state->user_info)
|
||||
: '')
|
||||
. '"></span></small>'
|
||||
)
|
||||
: ''
|
||||
|
@ -952,17 +959,20 @@ function render_user_freeloader_hint()
|
|||
}
|
||||
|
||||
/**
|
||||
* Hinweis für Engel, die noch nicht angekommen sind
|
||||
* hint for angels, which are not arrived yet
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
function render_user_arrived_hint()
|
||||
function render_user_arrived_hint(bool $is_user_shifts = false)
|
||||
{
|
||||
$user_info = auth()->user()->state->user_info;
|
||||
if (config('signup_requires_arrival') && !auth()->user()->state->arrived) {
|
||||
/** @var Carbon $buildup */
|
||||
$buildup = config('buildup_start');
|
||||
if (!empty($buildup) && $buildup->lessThan(new Carbon())) {
|
||||
return __('You are not marked as arrived. Please go to heaven\'s desk, get your angel badge and/or tell them that you arrived already.');
|
||||
return !$user_info
|
||||
? __('You are not marked as arrived. Please go to heaven, get your angel badge and/or tell them that you arrived already.')
|
||||
: ($is_user_shifts ? __('user_info.not_arrived_hint') : null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1267,11 +1267,11 @@ msgid "Rights"
|
|||
msgstr "Berechtigungen"
|
||||
|
||||
msgid ""
|
||||
"You are not marked as arrived. Please go to heaven's desk, get your angel "
|
||||
"You are not marked as arrived. Please go to heaven, get your angel "
|
||||
"badge and/or tell them that you arrived already."
|
||||
msgstr ""
|
||||
"Du bist nicht als angekommen markiert. Bitte gehe zur Himmelsverwaltung, "
|
||||
"hole Dein Badge ab und/oder erkläre ihnen, dass Du bereits angekommen bist."
|
||||
"Du bist nicht als angekommen markiert. Geh bitte zum Himmel, "
|
||||
"hole Dein Badge ab und/oder melde dich als angekommen."
|
||||
|
||||
msgid ""
|
||||
"Please enter your planned date of departure on your settings page to give us "
|
||||
|
@ -1995,7 +1995,13 @@ msgid "user.info"
|
|||
msgstr "Benutzer Info"
|
||||
|
||||
msgid "user.info.hint"
|
||||
msgstr "Wird auf der Benutzer Seite für Schichtkoordinatoren und Admins angezeigt."
|
||||
msgstr ""
|
||||
"Wird auf der Benutzer Seite für Schichtkoordinatoren und Admins angezeigt. "
|
||||
"Wenn ein Engel nicht als angekommen markiert ist, "
|
||||
"entfernt eine Benutzer Info die nicht-angekommen Nachricht im Systemmenü des Engels."
|
||||
|
||||
msgid "user_info.not_arrived_hint"
|
||||
msgstr "Wenn du dich für Schichten eintragen willst, komm gerne im Himmel vorbei."
|
||||
|
||||
msgid "design.title"
|
||||
msgstr "Design"
|
||||
|
|
|
@ -733,7 +733,12 @@ msgid "user.info"
|
|||
msgstr "User info"
|
||||
|
||||
msgid "user.info.hint"
|
||||
msgstr "Is displayed for shift coordinators and admins in the user view."
|
||||
msgstr ""
|
||||
"Is displayed for shift coordinators and admins in the user view. "
|
||||
"If an angel is not marked as arrived a user-info removes the not-arrived notification in the angels sysmenu."
|
||||
|
||||
msgid "user_info.not_arrived_hint"
|
||||
msgstr "If you want to sign up for shifts, feel free to drop by heaven."
|
||||
|
||||
msgid "email.greeting"
|
||||
msgstr "Hi %s,"
|
||||
|
|
Loading…
Reference in New Issue