mirror of https://github.com/MISP/MISP
chg: [statistics] Added Attribute count
parent
2f3c4778f4
commit
a8b5da4be2
|
@ -1756,10 +1756,11 @@ class UsersController extends AppController
|
|||
'group' => 'Event.orgc_id',
|
||||
'conditions' => array('Event.orgc_id' => array_keys($orgs)),
|
||||
'recursive' => -1,
|
||||
'fields' => array('Event.orgc_id', 'count(*)')
|
||||
'fields' => array('Event.orgc_id', 'count(*)', 'sum(Event.attribute_count) as attributeCount')
|
||||
));
|
||||
foreach ($events as $event) {
|
||||
$orgs[$event['Event']['orgc_id']]['eventCount'] = $event[0]['count(*)'];
|
||||
$orgs[$event['Event']['orgc_id']]['attributeCount'] = $event[0]['attributeCount'];
|
||||
}
|
||||
unset($events);
|
||||
$orgs = Set::combine($orgs, '{n}.name', '{n}');
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
<th><?php echo __('Name');?></th>
|
||||
<th><?php echo __('Users');?></th>
|
||||
<th><?php echo __('Events');?></th>
|
||||
<th><?php echo __('Attributes');?></th>
|
||||
<th><?php echo __('Nationality');?></th>
|
||||
<th><?php echo __('Type');?></th>
|
||||
<th><?php echo __('Sector');?></th>
|
||||
|
@ -47,6 +48,7 @@
|
|||
<td class="short"><?php echo h($data['name']); ?></td>
|
||||
<td class="short"><span class="<?php echo isset($data['userCount']) ? 'blue bold' : 'grey'; ?>"><?php echo isset($data['userCount']) ? h($data['userCount']) : '0';?></span></td>
|
||||
<td class="short"><span class="<?php echo isset($data['eventCount']) ? 'blue bold' : 'grey'; ?>"><?php echo isset($data['eventCount']) ? h($data['eventCount']) : '0';?></span></td>
|
||||
<td class="short"><span class="<?php echo isset($data['attributeCount']) ? 'blue bold' : 'grey'; ?>"><?php echo isset($data['attributeCount']) ? h($data['attributeCount']) : '0';?></span></td>
|
||||
<td class="shortish"><?php echo isset($data['nationality']) && $data['nationality'] !== 'Not specified' ? h($data['nationality']) : ' '; ?></td>
|
||||
<td class="shortish"><?php echo isset($data['type']) ? h($data['type']) : ' '; ?></td>
|
||||
<td class="shortish"><?php echo isset($data['sector']) ? h($data['sector']) : ' '; ?></td>
|
||||
|
|
Loading…
Reference in New Issue