new: [eventview] Shows number of object in the event

pull/4237/head
mokaddem 2019-02-26 16:33:37 +01:00
parent 3f292458ec
commit af735901fd
2 changed files with 5 additions and 1 deletions

View File

@ -1223,6 +1223,7 @@ class EventsController extends AppController
$emptyEvent = (empty($event['Object']) && empty($event['Attribute']));
$this->set('emptyEvent', $emptyEvent);
$attributeCount = isset($event['Attribute']) ? count($event['Attribute']) : 0;
$objectCount = isset($event['Object']) ? count($event['Object']) : 0;
if (!empty($event['Object'])) {
foreach ($event['Object'] as $k => $object) {
if (!empty($object['Attribute'])) {
@ -1231,6 +1232,7 @@ class EventsController extends AppController
}
}
$this->set('attribute_count', $attributeCount);
$this->set('object_count', $objectCount);
// 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)));

View File

@ -167,9 +167,11 @@
'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'])) . ')')
);
$attribute_text = $attribute_count;
$attribute_text .= $object_count > 1 ? sprintf(' (%s Objects)', h($object_count)) : sprintf(' (%s Object)', h($object_count));
$table_data[] = array(
'key' => __('#Attributes'),
'value' => $attribute_count
'value' => $attribute_text
);
$table_data[] = array(
'key' => __('First recorded change'),