fix: [users] added the country information to the index / view
parent
7a8eb6ba50
commit
41749ae5a8
|
@ -11,7 +11,7 @@ use Cake\Http\Exception\NotFoundException;
|
|||
|
||||
class UsersController extends AppController
|
||||
{
|
||||
public $filterFields = ['Individuals.uuid', 'username', 'Individuals.email', 'Individuals.first_name', 'Individuals.last_name', 'Organisations.name'];
|
||||
public $filterFields = ['Individuals.uuid', 'username', 'Individuals.email', 'Individuals.first_name', 'Individuals.last_name', 'Organisations.name', 'Organisation.nationality'];
|
||||
public $quickFilterFields = ['Individuals.uuid', ['username' => true], ['Individuals.first_name' => true], ['Individuals.last_name' => true], 'Individuals.email'];
|
||||
public $containFields = ['Individuals', 'Roles', 'UserSettings', 'Organisations'];
|
||||
|
||||
|
|
|
@ -47,7 +47,8 @@ class UsersTable extends AppTable
|
|||
'Organisations',
|
||||
[
|
||||
'dependent' => false,
|
||||
'cascadeCallbacks' => false
|
||||
'cascadeCallbacks' => false,
|
||||
'strategy' => 'join'
|
||||
]
|
||||
);
|
||||
$this->hasMany(
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
echo $this->element('genericElements/Form/genericForm', array(
|
||||
'data' => array(
|
||||
'description' => __('Organisations can be equivalent to legal entities or specific individual teams within such entities. Their purpose is to relate individuals to their affiliations and for release control of information using the Trust Circles.'),
|
||||
'model' => 'Organisations',
|
||||
'model' => 'Organisation',
|
||||
'fields' => array(
|
||||
array(
|
||||
'field' => 'name'
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Cake\Core\Configure;
|
||||
|
||||
echo $this->element('genericElements/IndexTable/index_table', [
|
||||
'data' => [
|
||||
'data' => $data,
|
||||
|
@ -88,6 +87,11 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
|||
'url' => '/roles/view/{{0}}',
|
||||
'url_vars' => ['role.id']
|
||||
],
|
||||
[
|
||||
'name' => __('Country'),
|
||||
'sort' => 'organisation.nationality',
|
||||
'data_path' => 'organisation.nationality'
|
||||
],
|
||||
[
|
||||
'name' => __('# User Settings'),
|
||||
'element' => 'count_summary',
|
||||
|
|
|
@ -44,6 +44,10 @@ $fields = [
|
|||
'key' => __('Last name'),
|
||||
'path' => 'individual.last_name'
|
||||
],
|
||||
[
|
||||
'key' => __('Country'),
|
||||
'path' => 'organisation.nationality'
|
||||
],
|
||||
[
|
||||
'key' => __('Alignments'),
|
||||
'type' => 'alignment',
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<?php
|
||||
if (is_array($fieldData)) {
|
||||
// Don't barf if the model is not explicitly passed
|
||||
$modelForForm = empty($data['model']) ?
|
||||
h(\Cake\Utility\Inflector::singularize(\Cake\Utility\Inflector::classify($this->request->getParam('controller')))) :
|
||||
h($data['model']);
|
||||
$fieldTemplate = 'genericField';
|
||||
if (!empty($fieldData['type'])) {
|
||||
if (file_exists(ROOT . '/templates/element/genericElements/Form/Fields/' . $fieldData['type'] . 'Field.php')) {
|
||||
|
|
Loading…
Reference in New Issue