2021-03-15 22:47:13 +01:00
|
|
|
<?php
|
|
|
|
echo $this->Html->scriptBlock(sprintf(
|
|
|
|
'var csrfToken = %s;',
|
|
|
|
json_encode($this->request->getAttribute('csrfToken'))
|
|
|
|
));
|
|
|
|
echo $this->element('genericElements/IndexTable/index_table', [
|
|
|
|
'data' => [
|
|
|
|
'data' => $data,
|
|
|
|
'top_bar' => [
|
|
|
|
'children' => [
|
|
|
|
[
|
|
|
|
'type' => 'context_filters',
|
|
|
|
'context_filters' => !empty($filteringContexts) ? $filteringContexts : []
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'search',
|
|
|
|
'button' => __('Filter'),
|
|
|
|
'placeholder' => __('Enter value to search'),
|
|
|
|
'data' => '',
|
|
|
|
'searchKey' => 'value',
|
|
|
|
'allowFilering' => true
|
|
|
|
]
|
|
|
|
]
|
|
|
|
],
|
|
|
|
'fields' => [
|
|
|
|
[
|
|
|
|
'name' => '#',
|
|
|
|
'sort' => 'id',
|
|
|
|
'data_path' => 'id',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'created',
|
|
|
|
'sort' => 'created',
|
|
|
|
'data_path' => 'created',
|
|
|
|
'element' => 'datetime'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'scope',
|
|
|
|
'sort' => 'scope',
|
|
|
|
'data_path' => 'scope',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'action',
|
|
|
|
'sort' => 'action',
|
|
|
|
'data_path' => 'action',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'title',
|
|
|
|
'sort' => 'title',
|
|
|
|
'data_path' => 'title',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'origin',
|
|
|
|
'sort' => 'origin',
|
|
|
|
'data_path' => 'origin',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'user',
|
|
|
|
'sort' => 'user_id',
|
|
|
|
'data_path' => 'user',
|
|
|
|
'element' => 'user'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'description',
|
|
|
|
'sort' => 'description',
|
|
|
|
'data_path' => 'description',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'comment',
|
|
|
|
'sort' => 'comment',
|
|
|
|
'data_path' => 'comment',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'title' => __('Inbox'),
|
|
|
|
'description' => __('A list of requests to be manually processed'),
|
|
|
|
'actions' => [
|
2021-03-18 09:26:01 +01:00
|
|
|
[
|
|
|
|
'url' => '/inbox/view',
|
|
|
|
'url_params_data_paths' => ['id'],
|
2021-03-18 14:01:14 +01:00
|
|
|
'icon' => 'eye',
|
|
|
|
'title' => __('View request')
|
2021-03-18 09:26:01 +01:00
|
|
|
],
|
2021-03-15 22:47:13 +01:00
|
|
|
[
|
|
|
|
'open_modal' => '/inbox/process/[onclick_params_data_path]',
|
|
|
|
'modal_params_data_path' => 'id',
|
2021-03-18 14:01:14 +01:00
|
|
|
'icon' => 'cogs',
|
|
|
|
'title' => __('Process request')
|
2021-03-15 22:47:13 +01:00
|
|
|
],
|
|
|
|
[
|
2021-03-18 09:26:01 +01:00
|
|
|
'open_modal' => '/inbox/delete/[onclick_params_data_path]',
|
2021-03-15 22:47:13 +01:00
|
|
|
'modal_params_data_path' => 'id',
|
2021-03-18 14:01:14 +01:00
|
|
|
'icon' => 'trash',
|
|
|
|
'title' => __('Discard request')
|
2021-03-15 22:47:13 +01:00
|
|
|
],
|
|
|
|
]
|
|
|
|
]
|
|
|
|
]);
|
|
|
|
echo '</div>';
|
|
|
|
?>
|