chg: [Organisation] Moved model to use meta-field behavior instead of association
parent
0dfa87be6f
commit
6579482526
|
@ -33,14 +33,7 @@ class OrganisationsTable extends AppTable
|
|||
'conditions' => ['owner_model' => 'organisation']
|
||||
]
|
||||
);
|
||||
$this->hasMany(
|
||||
'MetaFields',
|
||||
[
|
||||
'dependent' => true,
|
||||
'foreignKey' => 'parent_id',
|
||||
'conditions' => ['MetaFields.scope' => 'organisation']
|
||||
]
|
||||
);
|
||||
$this->addBehavior('MetaFields');
|
||||
$this->setDisplayField('name');
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
|||
'name' => __('Name'),
|
||||
'class' => 'short',
|
||||
'data_path' => 'name',
|
||||
'sort' => 'name',
|
||||
],
|
||||
[
|
||||
'name' => __('UUID'),
|
||||
|
@ -67,14 +68,17 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
|||
[
|
||||
'name' => __('Nationality'),
|
||||
'data_path' => 'nationality',
|
||||
'sort' => 'nationality',
|
||||
],
|
||||
[
|
||||
'name' => __('Sector'),
|
||||
'data_path' => 'sector',
|
||||
'sort' => 'sector',
|
||||
],
|
||||
[
|
||||
'name' => __('Type'),
|
||||
'data_path' => 'type',
|
||||
'sort' => 'type',
|
||||
],
|
||||
[
|
||||
'name' => __('Tags'),
|
||||
|
|
|
@ -48,8 +48,7 @@ echo $this->element(
|
|||
'scope' => 'organisations'
|
||||
]
|
||||
],
|
||||
'metaTemplates' => empty($metaFields) ? [] : $metaFields,
|
||||
'combinedFieldsView' => true,
|
||||
'combinedFieldsView' => false,
|
||||
'children' => []
|
||||
]
|
||||
);
|
||||
|
|
|
@ -24,4 +24,4 @@ if (!isset($params['escape']) || $params['escape'] !== false) {
|
|||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
||||
</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
Loading…
Reference in New Issue