mirror of https://github.com/MISP/MISP
fix: [UI] Fix attribte search in event view
parent
402baa4677
commit
2a3d49921c
|
@ -41,7 +41,14 @@
|
|||
echo $this->element('/genericElements/IndexTable/pagination', array('paginationOptions' => $paginationData));
|
||||
echo $this->element('/genericElements/IndexTable/pagination_links');
|
||||
}
|
||||
$hasSearch = false;
|
||||
if (!empty($data['top_bar'])) {
|
||||
foreach ($data['top_bar']['children'] as $child) {
|
||||
if (isset($child['type']) && $child['type'] === 'search') {
|
||||
$hasSearch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
echo $this->element('/genericElements/ListTopBar/scaffold', array('data' => $data['top_bar']));
|
||||
}
|
||||
$rows = '';
|
||||
|
@ -93,7 +100,6 @@
|
|||
}
|
||||
$url = $baseurl . '/' . $this->params['controller'] . '/' . $this->params['action'];
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var passedArgsArray = <?= isset($passedArgs) ? $passedArgs : '[]'; ?>;
|
||||
<?php
|
||||
|
@ -102,6 +108,7 @@
|
|||
}
|
||||
?>
|
||||
var url = "<?= $url ?>";
|
||||
<?php if ($hasSearch): ?>
|
||||
$(function() {
|
||||
$('#quickFilterButton').click(function() {
|
||||
if (typeof(target) !== 'undefined') {
|
||||
|
@ -111,6 +118,7 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
<?php endif; ?>
|
||||
var ajax = <?= $ajax ? 'true' : 'false' ?>;
|
||||
if (ajax && typeof(target) !== 'undefined') {
|
||||
$(target + ' .pagination_link a').on('click', function() {
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
)
|
||||
)
|
||||
),
|
||||
'title' => sprintf(__('Event Reports %s'), !empty($event_id) ? sprintf(__('for Event %s'), h($event_id)) : ''),
|
||||
'title' => sprintf(__('Event Reports %s'), !empty($event_id) ?__('for Event %s', h($event_id)) : ''),
|
||||
'primary_id_path' => 'EventReport.id',
|
||||
'fields' => array(
|
||||
array(
|
||||
|
@ -135,20 +135,14 @@
|
|||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'eventReports', 'menuItem' => 'index'));
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var passedArgsArray = <?php echo $passedArgs; ?>;
|
||||
if (passedArgsArray['context'] === undefined) {
|
||||
passedArgsArray['context'] = '';
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$(function() {
|
||||
$('#quickFilterButton').click(function() {
|
||||
runIndexQuickFilter('/context:' + passedArgsArray['context']);
|
||||
});
|
||||
$('#quickFilterField').on('keypress', function (e) {
|
||||
if(e.which === 13) {
|
||||
runIndexQuickFilter('/context:' + passedArgsArray['context']);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue