From b6eda8dbfc9880239bdc622a0b6988ad0a8ab722 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 4 Jun 2019 16:00:33 +0200 Subject: Fix profile link to mark angels as arrived --- includes/sys_form.php | 6 ++++-- includes/view/User_view.php | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/includes/sys_form.php b/includes/sys_form.php index af8d094a..de271eda 100644 --- a/includes/sys_form.php +++ b/includes/sys_form.php @@ -204,6 +204,7 @@ function form_info($label, $text = '') * @param string $label * @param string $class * @param bool $wrapForm + * @param string $buttonType * @return string */ function form_submit($name, $label, $class = '', $wrapForm = true, $buttonType = 'primary') @@ -402,11 +403,12 @@ function form_element($label, $input, $for = '') * * @param string[] $elements * @param string $action + * @param bool $inline * @return string */ -function form($elements, $action = '') +function form($elements, $action = '', $inline = false) { - return '
' + return '' . form_csrf() . join($elements) . '
'; diff --git a/includes/view/User_view.php b/includes/view/User_view.php index 59f611bc..949bba87 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -617,10 +617,12 @@ function User_view( user_driver_license_edit_link($user_source), glyph('road') . __('driving license') ) : '', - ($admin_user_privilege && !$user_source->state->arrived) ? button( - page_link_to('admin_arrive', ['arrived' => $user_source->id]), - __('arrived') - ) : '', + ($admin_user_privilege && !$user_source->state->arrived) ? + form([ + form_hidden('action', 'arrived'), + form_hidden('user', $user_source->id), + form_submit('submit', __('arrived'), '', false, 'default') + ], page_link_to('admin_arrive'), true) : '', $admin_user_privilege ? button( page_link_to( 'users', -- cgit v1.2.3-54-g00ecf