chg: [organisation:index] Removed ENISA-specific quick filters

But kept them as develop documentation...
pull/121/head
Sami Mokaddem 2022-11-15 11:40:59 +01:00
parent f8af692122
commit 31750da7c9
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 37 additions and 35 deletions

View File

@ -20,46 +20,48 @@ class OrganisationsController extends AppController
public function index()
{
$customContextFilters = [
// [
// 'label' => __('ENISA Accredited'),
// 'filterCondition' => [
// 'MetaFields.field' => 'enisa-tistatus',
// 'MetaFields.value' => 'Accredited',
// 'MetaFields.MetaTemplates.name' => 'ENISA CSIRT Network'
// ]
// ],
// [
// 'label' => __('ENISA not-Accredited'),
// 'filterCondition' => [
// 'MetaFields.field' => 'enisa-tistatus',
// 'MetaFields.value !=' => 'Accredited',
// 'MetaFields.MetaTemplates.name' => 'ENISA CSIRT Network'
// ]
// ],
// [
// 'label' => __('ENISA CSIRT Network (GOV)'),
// 'filterConditionFunction' => function ($query) {
// return $this->CRUD->setParentConditionsForMetaFields($query, [
// 'ENISA CSIRT Network' => [
// [
// 'field' => 'constituency',
// 'value LIKE' => '%Government%',
// ],
// [
// 'field' => 'csirt-network-status',
// 'value' => 'Member',
// ],
// ]
// ]);
// }
// ],
];
$this->CRUD->index([
'filters' => $this->filterFields,
'quickFilters' => $this->quickFilterFields,
'quickFilterForMetaField' => ['enabled' => true, 'wildcard_search' => true],
'contextFilters' => [
'custom' => [
[
'label' => __('ENISA Accredited'),
'filterCondition' => [
'MetaFields.field' => 'enisa-tistatus',
'MetaFields.value' => 'Accredited',
'MetaFields.MetaTemplates.name' => 'ENISA CSIRT Network'
]
],
[
'label' => __('ENISA not-Accredited'),
'filterCondition' => [
'MetaFields.field' => 'enisa-tistatus',
'MetaFields.value !=' => 'Accredited',
'MetaFields.MetaTemplates.name' => 'ENISA CSIRT Network'
]
],
[
'label' => __('ENISA CSIRT Network (GOV)'),
'filterConditionFunction' => function($query) {
return $this->CRUD->setParentConditionsForMetaFields($query, [
'ENISA CSIRT Network' => [
[
'field' => 'constituency',
'value LIKE' => '%Government%',
],
[
'field' => 'csirt-network-status',
'value' => 'Member',
],
]
]);
}
]
],
'custom' => $customContextFilters,
],
'contain' => $this->containFields,
'statisticsFields' => $this->statisticsFields,