chg: [organisation:index] Removed ENISA-specific quick filters
But kept them as develop documentation...pull/121/head
parent
f8af692122
commit
31750da7c9
|
@ -20,46 +20,48 @@ class OrganisationsController extends AppController
|
||||||
|
|
||||||
public function index()
|
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([
|
$this->CRUD->index([
|
||||||
'filters' => $this->filterFields,
|
'filters' => $this->filterFields,
|
||||||
'quickFilters' => $this->quickFilterFields,
|
'quickFilters' => $this->quickFilterFields,
|
||||||
'quickFilterForMetaField' => ['enabled' => true, 'wildcard_search' => true],
|
'quickFilterForMetaField' => ['enabled' => true, 'wildcard_search' => true],
|
||||||
'contextFilters' => [
|
'contextFilters' => [
|
||||||
'custom' => [
|
'custom' => $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',
|
|
||||||
],
|
|
||||||
]
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
'contain' => $this->containFields,
|
'contain' => $this->containFields,
|
||||||
'statisticsFields' => $this->statisticsFields,
|
'statisticsFields' => $this->statisticsFields,
|
||||||
|
|
Loading…
Reference in New Issue