From 678ad0fe8e9749aefdb0ec3470801e09a84828c7 Mon Sep 17 00:00:00 2001 From: iglocska Date: Thu, 24 Feb 2022 13:48:10 +0100 Subject: [PATCH] chg: [templates] for user creation now have a minimalist individiual creation included --- templates/Users/add.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/templates/Users/add.php b/templates/Users/add.php index d3fcb7f..3365150 100644 --- a/templates/Users/add.php +++ b/templates/Users/add.php @@ -1,4 +1,7 @@ request->getParam('action') === 'add') { + $dropdownData['individual'] = ['new' => __('New individual')] + $dropdownData['individual']; + } echo $this->element('genericElements/Form/genericForm', [ 'data' => [ 'description' => __('Roles define global rules for a set of users, including first and foremost access controls to certain functionalities.'), @@ -10,6 +13,32 @@ 'label' => __('Associated individual'), 'options' => $dropdownData['individual'] ], + [ + 'field' => 'individual.email', + 'stateDependence' => [ + 'source' => '#individual_id-field', + 'option' => 'new' + ], + 'required' => false + ], + [ + 'field' => 'individual.first_name', + 'label' => 'First name', + 'stateDependence' => [ + 'source' => '#individual_id-field', + 'option' => 'new' + ], + 'required' => false + ], + [ + 'field' => 'individual.last_name', + 'label' => 'Last name', + 'stateDependence' => [ + 'source' => '#individual_id-field', + 'option' => 'new' + ], + 'required' => false + ], [ 'field' => 'username', 'autocomplete' => 'off'