Use mailto: and tel: links

This commit is contained in:
Igor Scheller 2021-01-12 14:19:24 +01:00 committed by msquare
parent ef665c80ba
commit 6f27d11093
2 changed files with 10 additions and 4 deletions

View File

@ -86,12 +86,15 @@ function admin_free()
} }
} }
$email = ($usr->contact->email ? $usr->contact->email : $usr->email);
$free_users_table[] = [ $free_users_table[] = [
'name' => User_Nick_render($usr) . User_Pronoun_render($usr), 'name' => User_Nick_render($usr) . User_Pronoun_render($usr),
'shift_state' => User_shift_state_render($usr), 'shift_state' => User_shift_state_render($usr),
'last_shift' => User_last_shift_render($usr), 'last_shift' => User_last_shift_render($usr),
'dect' => $usr->contact->dect, 'dect' => sprintf('<a href="tel:%s">%1$s</a>', $usr->contact->dect),
'email' => $usr->settings->email_human ? ($usr->contact->email ? $usr->contact->email : $usr->email) : glyph('eye-close'), 'email' => $usr->settings->email_human
? sprintf('<a href="email:%s">%1$s</a>', $email)
: glyph('eye-close'),
'actions' => 'actions' =>
auth()->can('admin_user') auth()->can('admin_user')
? button(page_link_to('admin_user', ['id' => $usr->id]), __('edit'), 'btn-xs') ? button(page_link_to('admin_user', ['id' => $usr->id]), __('edit'), 'btn-xs')

View File

@ -207,7 +207,7 @@ function Users_view(
$u['name'] = User_Nick_render($user) . User_Pronoun_render($user); $u['name'] = User_Nick_render($user) . User_Pronoun_render($user);
$u['first_name'] = $user->personalData->first_name; $u['first_name'] = $user->personalData->first_name;
$u['last_name'] = $user->personalData->last_name; $u['last_name'] = $user->personalData->last_name;
$u['dect'] = $user->contact->dect; $u['dect'] = sprintf('<a href="tel:%s">%1$s</a>', $user->contact->dect);
$u['arrived'] = glyph_bool($user->state->arrived); $u['arrived'] = glyph_bool($user->state->arrived);
$u['got_voucher'] = $user->state->got_voucher; $u['got_voucher'] = $user->state->got_voucher;
$u['freeloads'] = $user->getAttribute('freeloads'); $u['freeloads'] = $user->getAttribute('freeloads');
@ -668,7 +668,10 @@ function User_view(
]), ]),
div('row', [ div('row', [
div('col-md-2', [ div('col-md-2', [
heading(glyph('phone') . $user_source->contact->dect, 1) heading(glyph('phone')
. '<a href="tel:' . $user_source->contact->dect . '">'
. $user_source->contact->dect, 1)
. '</a>'
]), ]),
User_view_state($admin_user_privilege, $freeloader, $user_source), User_view_state($admin_user_privilege, $freeloader, $user_source),
User_angeltypes_render($user_angeltypes), User_angeltypes_render($user_angeltypes),