mirror of https://github.com/MISP/MISP
new: [eventview] Shows number of object in the event
parent
3f292458ec
commit
af735901fd
|
@ -1223,6 +1223,7 @@ class EventsController extends AppController
|
||||||
$emptyEvent = (empty($event['Object']) && empty($event['Attribute']));
|
$emptyEvent = (empty($event['Object']) && empty($event['Attribute']));
|
||||||
$this->set('emptyEvent', $emptyEvent);
|
$this->set('emptyEvent', $emptyEvent);
|
||||||
$attributeCount = isset($event['Attribute']) ? count($event['Attribute']) : 0;
|
$attributeCount = isset($event['Attribute']) ? count($event['Attribute']) : 0;
|
||||||
|
$objectCount = isset($event['Object']) ? count($event['Object']) : 0;
|
||||||
if (!empty($event['Object'])) {
|
if (!empty($event['Object'])) {
|
||||||
foreach ($event['Object'] as $k => $object) {
|
foreach ($event['Object'] as $k => $object) {
|
||||||
if (!empty($object['Attribute'])) {
|
if (!empty($object['Attribute'])) {
|
||||||
|
@ -1231,6 +1232,7 @@ class EventsController extends AppController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->set('attribute_count', $attributeCount);
|
$this->set('attribute_count', $attributeCount);
|
||||||
|
$this->set('object_count', $objectCount);
|
||||||
// set the data for the contributors / history field
|
// set the data for the contributors / history field
|
||||||
$org_ids = $this->Event->ShadowAttribute->getEventContributors($event['Event']['id']);
|
$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)));
|
$contributors = $this->Event->Org->find('list', array('fields' => array('Org.name'), 'conditions' => array('Org.id' => $org_ids)));
|
||||||
|
|
|
@ -167,9 +167,11 @@
|
||||||
'class_value' => ($event['Event']['published'] == 0) ? '' : 'green',
|
'class_value' => ($event['Event']['published'] == 0) ? '' : 'green',
|
||||||
'html' => ($event['Event']['published'] == 0) ? 'No' : '<span class="green bold">Yes</span>' . ((empty($event['Event']['publish_timestamp'])) ? 'N/A' : ' (' . date('Y-m-d H:i:s', ($event['Event']['publish_timestamp'])) . ')')
|
'html' => ($event['Event']['published'] == 0) ? 'No' : '<span class="green bold">Yes</span>' . ((empty($event['Event']['publish_timestamp'])) ? 'N/A' : ' (' . date('Y-m-d H:i:s', ($event['Event']['publish_timestamp'])) . ')')
|
||||||
);
|
);
|
||||||
|
$attribute_text = $attribute_count;
|
||||||
|
$attribute_text .= $object_count > 1 ? sprintf(' (%s Objects)', h($object_count)) : sprintf(' (%s Object)', h($object_count));
|
||||||
$table_data[] = array(
|
$table_data[] = array(
|
||||||
'key' => __('#Attributes'),
|
'key' => __('#Attributes'),
|
||||||
'value' => $attribute_count
|
'value' => $attribute_text
|
||||||
);
|
);
|
||||||
$table_data[] = array(
|
$table_data[] = array(
|
||||||
'key' => __('First recorded change'),
|
'key' => __('First recorded change'),
|
||||||
|
|
Loading…
Reference in New Issue