mirror of https://github.com/MISP/MISP
fix: Filtering on attributes in the event view gives a no attributes warning if a tab doesn't contain attributes
- Warning now only triggers if the event doesn't have any attributes in any tabspull/1317/head
parent
7ef3f4615c
commit
ab3b85b1cc
|
@ -694,6 +694,8 @@ class EventsController extends AppController {
|
|||
$results = $this->Event->fetchEvent($this->Auth->user(), $conditions);
|
||||
if (empty($results)) throw new NotFoundException('Invalid event');
|
||||
$event = &$results[0];
|
||||
$emptyEvent = (!isset($event['Attribute']) || empty($event['Attribute']));
|
||||
$this->set('emptyEvent', $emptyEvent);
|
||||
$params = $this->Event->rearrangeEventForView($event, $this->passedArgs, $all);
|
||||
$this->params->params['paging'] = array($this->modelClass => $params);
|
||||
// workaround to get the event dates in to the attribute relations
|
||||
|
@ -740,6 +742,8 @@ class EventsController extends AppController {
|
|||
}
|
||||
|
||||
private function __viewUI($event, $continue, $fromEvent) {
|
||||
$emptyEvent = (!isset($event['Attribute']) || empty($event['Attribute']));
|
||||
$this->set('emptyEvent', $emptyEvent);
|
||||
// set the data for the contributors / history field
|
||||
$org_ids = $this->Event->ShadowAttribute->getEventContributors($event['Event']['id']);
|
||||
$contributors = $this->Event->Org->find('list', array('fields' => array('Org.name'), 'conditions' => array('Org.id' => $org_ids)));
|
||||
|
|
|
@ -460,7 +460,7 @@
|
|||
?>
|
||||
</table>
|
||||
</div>
|
||||
<?php if (!isset($event['objects']) || empty($event['objects'])): ?>
|
||||
<?php if ($emptyEvent): ?>
|
||||
<div class="background-red bold">
|
||||
<span>
|
||||
<?php
|
||||
|
|
Loading…
Reference in New Issue