From 81ab20291773a01eabc031c1f9e5e5a44b8ff92d Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 24 Nov 2021 01:25:57 +0100 Subject: [PATCH] chg: [templates] org fields added to user templates --- templates/Users/add.php | 6 ++++++ templates/Users/index.php | 7 +++++++ templates/Users/view.php | 8 ++++++++ 3 files changed, 21 insertions(+) diff --git a/templates/Users/add.php b/templates/Users/add.php index 99bf366..f215277 100644 --- a/templates/Users/add.php +++ b/templates/Users/add.php @@ -14,6 +14,12 @@ 'field' => 'username', 'autocomplete' => 'off' ], + [ + 'field' => 'organisation_id', + 'type' => 'dropdown', + 'label' => __('Associated organisation'), + 'options' => $dropdownData['organisation'] + ], [ 'field' => 'password', 'label' => __('Password'), diff --git a/templates/Users/index.php b/templates/Users/index.php index 64561a1..1ff36bf 100644 --- a/templates/Users/index.php +++ b/templates/Users/index.php @@ -51,6 +51,13 @@ echo $this->element('genericElements/IndexTable/index_table', [ 'sort' => 'username', 'data_path' => 'username', ], + [ + 'name' => __('Organisation'), + 'sort' => 'organisation.name', + 'data_path' => 'organisation.name', + 'url' => '/organisations/view/{{0}}', + 'url_vars' => ['organisation.id'] + ], [ 'name' => __('Email'), 'sort' => 'individual.email', diff --git a/templates/Users/view.php b/templates/Users/view.php index 760ead4..26c3c25 100644 --- a/templates/Users/view.php +++ b/templates/Users/view.php @@ -21,6 +21,14 @@ echo $this->element( 'path' => 'individual.email' ], [ + 'type' => 'generic', + 'key' => __('Organisation'), + 'path' => 'organisation.name', + 'url' => '/organisations/view/{{0}}', + 'url_vars' => 'organisation.id' + ], + [ + 'type' => 'generic', 'key' => __('Role'), 'path' => 'role.name', 'url' => '/roles/view/{{0}}',