2015-04-18 07:53:18 +02:00
|
|
|
<div class="events <?php if (!$ajax) echo 'index'; ?>">
|
2018-07-20 09:29:50 +02:00
|
|
|
<h2><?php echo __('Events');?></h2>
|
|
|
|
<div class="pagination">
|
|
|
|
<ul>
|
|
|
|
<?php
|
2021-01-17 11:45:38 +01:00
|
|
|
$pagination = $this->Paginator->prev('« ' . __('previous'), array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'prev disabled', 'escape' => false, 'disabledTag' => 'span'));
|
|
|
|
$pagination .= $this->Paginator->numbers(array('modulus' => 20, 'separator' => '', 'tag' => 'li', 'currentClass' => 'active', 'currentTag' => 'span'));
|
|
|
|
$pagination .= $this->Paginator->next(__('next') . ' »', array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'next disabled', 'escape' => false, 'disabledTag' => 'span'));
|
|
|
|
echo $pagination;
|
2018-07-20 09:29:50 +02:00
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<?php
|
2019-02-20 23:02:02 +01:00
|
|
|
$filterParamsString = array();
|
|
|
|
foreach ($passedArgsArray as $k => $v) {
|
2021-01-17 11:45:38 +01:00
|
|
|
$filterParamsString[] = sprintf(
|
|
|
|
'%s: %s',
|
|
|
|
h(ucfirst($k)),
|
2021-12-07 08:41:55 +01:00
|
|
|
h(is_array($v) ? http_build_query($v) : h($v) )
|
2021-01-17 11:45:38 +01:00
|
|
|
);
|
2019-02-20 23:02:02 +01:00
|
|
|
}
|
2021-03-20 13:35:58 +01:00
|
|
|
|
|
|
|
$columnsDescription = [
|
|
|
|
'owner_org' => __('Owner org'),
|
|
|
|
'attribute_count' => __('Attribute count'),
|
|
|
|
'creator_user' => __('Creator user'),
|
|
|
|
'tags' => __('Tags'),
|
|
|
|
'clusters' => __('Clusters'),
|
|
|
|
'correlations' => __('Correlations'),
|
|
|
|
'sightings' => __('Sightings'),
|
|
|
|
'proposals' => __('Proposals'),
|
|
|
|
'discussion' => __('Posts'),
|
2021-12-06 14:27:29 +01:00
|
|
|
'report_count' => __('Report count'),
|
|
|
|
'timestamp' => __('Last change at'),
|
|
|
|
'publish_timestamp' => __('Published at')
|
2021-03-20 13:35:58 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
$columnsMenu = [];
|
|
|
|
foreach ($possibleColumns as $possibleColumn) {
|
|
|
|
$html = in_array($possibleColumn, $columns, true) ? '<i class="fa fa-check"></i> ' : '<i class="fa fa-check" style="visibility: hidden"></i> ';
|
|
|
|
$html .= $columnsDescription[$possibleColumn];
|
|
|
|
$columnsMenu[] = [
|
|
|
|
'html' => $html,
|
|
|
|
'onClick' => 'eventIndexColumnsToggle',
|
|
|
|
'onClickParams' => [$possibleColumn],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2019-02-20 23:02:02 +01:00
|
|
|
$filterParamsString = implode(' & ', $filterParamsString);
|
|
|
|
$data = array(
|
|
|
|
'children' => array(
|
|
|
|
array(
|
|
|
|
'children' => array(
|
|
|
|
array(
|
|
|
|
'id' => 'create-button',
|
|
|
|
'title' => __('Modify filters'),
|
|
|
|
'fa-icon' => 'search',
|
|
|
|
'onClick' => 'getPopup',
|
|
|
|
'onClickParams' => array($urlparams, 'events', 'filterEventIndex')
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'children' => array(
|
|
|
|
array(
|
|
|
|
'id' => 'multi-delete-button',
|
2021-03-20 13:35:58 +01:00
|
|
|
'title' => __('Delete selected events'),
|
2019-02-21 07:48:39 +01:00
|
|
|
'fa-icon' => 'trash',
|
2019-02-20 23:02:02 +01:00
|
|
|
'class' => 'hidden mass-select',
|
|
|
|
'onClick' => 'multiSelectDeleteEvents'
|
2022-03-10 10:18:39 +01:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'id' => 'multi-export-button',
|
|
|
|
'title' => __('Export selected events'),
|
|
|
|
'fa-icon' => 'file-export',
|
|
|
|
'class' => 'hidden mass-select',
|
|
|
|
'onClick' => 'multiSelectExportEvents'
|
2019-02-20 23:02:02 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'children' => array(
|
|
|
|
array(
|
|
|
|
'requirement' => count($passedArgsArray) > 0,
|
|
|
|
'html' => sprintf(
|
|
|
|
'<span class="bold">%s</span>: %s',
|
|
|
|
__('Filters'),
|
|
|
|
$filterParamsString
|
|
|
|
)
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'requirement' => count($passedArgsArray) > 0,
|
2020-08-16 13:31:31 +02:00
|
|
|
'url' => $baseurl . '/events/index',
|
2019-02-20 23:02:02 +01:00
|
|
|
'title' => __('Remove filters'),
|
|
|
|
'fa-icon' => 'times'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'children' => array(
|
|
|
|
array(
|
|
|
|
'title' => __('My events only'),
|
|
|
|
'text' => __('My Events'),
|
|
|
|
'data' => array(
|
|
|
|
'searchemail' => h($me['email'])
|
|
|
|
),
|
|
|
|
'class' => 'searchFilterButton',
|
|
|
|
'active' => isset($passedArgsArray['email']) && $passedArgsArray['email'] === $me['email']
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => __('My organisation\'s events only'),
|
|
|
|
'text' => __('Org Events'),
|
|
|
|
'data' => array(
|
|
|
|
'searchorg' => h($me['org_id'])
|
|
|
|
),
|
|
|
|
'class' => 'searchFilterButton',
|
|
|
|
'active' => isset($passedArgsArray['org']) && $passedArgsArray['org'] === $me['org_id']
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
2021-03-20 13:35:58 +01:00
|
|
|
array(
|
|
|
|
'children' => array(
|
|
|
|
array(
|
|
|
|
'id' => 'simple_filter',
|
|
|
|
'type' => 'group',
|
|
|
|
'class' => 'last',
|
|
|
|
'title' => __('Choose columns to show'),
|
|
|
|
'fa-icon' => 'columns',
|
|
|
|
'children' => $columnsMenu,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
2019-02-20 23:02:02 +01:00
|
|
|
array(
|
|
|
|
'type' => 'search',
|
2019-03-04 15:55:40 +01:00
|
|
|
'button' => __('Filter'),
|
|
|
|
'placeholder' => __('Enter value to search'),
|
2019-02-20 23:02:02 +01:00
|
|
|
'data' => '',
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
if (!$ajax) {
|
|
|
|
echo $this->element('/genericElements/ListTopBar/scaffold', array('data' => $data));
|
|
|
|
}
|
2018-07-20 09:29:50 +02:00
|
|
|
echo $this->element('Events/eventIndexTable');
|
|
|
|
?>
|
|
|
|
<p>
|
|
|
|
<?php
|
|
|
|
echo $this->Paginator->counter(array(
|
|
|
|
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
|
|
|
|
));
|
|
|
|
?>
|
|
|
|
</p>
|
|
|
|
<div class="pagination">
|
|
|
|
<ul>
|
2021-01-17 11:45:38 +01:00
|
|
|
<?= $pagination ?>
|
2018-07-20 09:29:50 +02:00
|
|
|
</ul>
|
|
|
|
</div>
|
2011-11-26 10:45:31 +01:00
|
|
|
</div>
|
2019-02-20 23:02:02 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
var passedArgsArray = <?php echo $passedArgs; ?>;
|
2020-09-01 17:56:32 +02:00
|
|
|
$(function() {
|
2019-02-20 23:02:02 +01:00
|
|
|
$('.searchFilterButton').click(function() {
|
|
|
|
runIndexFilter(this);
|
|
|
|
});
|
|
|
|
$('#quickFilterButton').click(function() {
|
|
|
|
runIndexQuickFilter();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2019-03-12 08:15:27 +01:00
|
|
|
<?php
|
|
|
|
echo $this->Html->script('vis');
|
|
|
|
echo $this->Html->css('vis');
|
|
|
|
echo $this->Html->css('distribution-graph');
|
|
|
|
echo $this->Html->script('network-distribution-graph');
|
|
|
|
?>
|
2013-11-17 17:54:15 +01:00
|
|
|
<?php
|
2019-02-13 14:45:01 +01:00
|
|
|
if (!$ajax) echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => 'index'));
|