MISP/app/View/Events/index.ctp

124 lines
6.8 KiB
Plaintext
Raw Normal View History

2011-11-26 10:45:31 +01:00
<div class="events index">
2011-11-26 12:29:56 +01:00
<h2>Events</h2>
2013-05-30 16:40:47 +02:00
<table cellpadding="0" cellspacing="0" class="table table-striped table-hover table-condensed">
2011-11-26 10:45:31 +01:00
<tr>
<th><?php echo $this->Paginator->sort('published', 'Valid.');?></th>
2012-12-18 20:25:12 +01:00
<?php
if ('true' == Configure::read('CyDefSIG.showorg') || $isAdmin): ?>
2011-11-26 10:45:31 +01:00
<th><?php echo $this->Paginator->sort('org');?></th>
2012-12-18 20:25:12 +01:00
<?php
endif; ?>
<?php
if ($isSiteAdmin): ?>
<th><?php echo $this->Paginator->sort('owner org');?></th>
<?php
2012-12-18 20:25:12 +01:00
endif; ?>
<th><?php echo $this->Paginator->sort('id');?></th>
2012-12-07 14:03:28 +01:00
<th><?php echo $this->Paginator->sort('attribute_count', '#Attr.');?></th>
2012-12-18 20:25:12 +01:00
<?php
if ($isAdmin): ?>
2012-07-19 14:53:12 +02:00
<th><?php echo $this->Paginator->sort('user_id', 'Email');?></th>
2012-12-18 20:25:12 +01:00
<?php
endif; ?>
2011-11-26 10:45:31 +01:00
<th><?php echo $this->Paginator->sort('date');?></th>
<th<?php echo ' title="' . $eventDescriptions['risk']['desc'] . '"';?>>
<?php echo $this->Paginator->sort('risk');?></th>
<th<?php echo ' title="' . $eventDescriptions['analysis']['desc'] . '"';?>>
<?php echo $this->Paginator->sort('analysis');?></th>
2011-11-26 10:45:31 +01:00
<th><?php echo $this->Paginator->sort('info');?></th>
2012-12-18 20:25:12 +01:00
<?php
if ('true' == Configure::read('CyDefSIG.sync')): ?>
<th<?php echo ' title="' . $eventDescriptions['distribution']['desc'] . '"';?>>
<?php echo $this->Paginator->sort('distribution');?></th>
<?php
2012-12-18 20:25:12 +01:00
endif; ?>
<th class="actions"><?php echo __('Actions');?></th>
2012-12-19 14:34:40 +01:00
</tr><?php
2012-12-18 20:25:12 +01:00
foreach ($events as $event):?>
<tr>
2012-12-19 14:34:40 +01:00
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';"><?php
if ($event['Event']['published'] == 1) {
echo $this->Html->image('yes.png', array('title' => 'Validated', 'alt' => 'Validated', 'width' => '16', 'hight' => '16'));
2012-12-19 14:34:40 +01:00
} else {
echo $this->Html->image('no.png', array('title' => 'Not validated', 'alt' => 'Not Validated', 'width' => '16', 'hight' => '16'));
2012-12-19 14:34:40 +01:00
}?>
&nbsp;</td><?php
2012-12-18 20:25:12 +01:00
if ('true' == Configure::read('CyDefSIG.showorg') || $isAdmin): ?>
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';"><?php
$imgRelativePath = 'orgs' . DS . h($event['Event']['orgc']) . '.png';
$imgAbsolutePath = APP . WEBROOT_DIR . DS . 'img' . DS . $imgRelativePath;
if (file_exists($imgAbsolutePath)) echo $this->Html->image('orgs/' . h($event['Event']['orgc']) . '.png', array('alt' => h($event['Event']['orgc']),'width' => '48','hight' => '48'));
else echo $this->Html->tag('span', h($event['Event']['orgc']), array('class' => 'welcome', 'style' => 'float:right;'));?><?php
?>
&nbsp;</td><?php
endif;
if ('true' == $isSiteAdmin): ?>
2012-12-19 14:34:40 +01:00
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';"><?php
$imgRelativePath = 'orgs' . DS . h($event['Event']['org']) . '.png';
$imgAbsolutePath = APP . WEBROOT_DIR . DS . 'img' . DS . $imgRelativePath;
if (file_exists($imgAbsolutePath)) echo $this->Html->image('orgs/' . h($event['Event']['org']) . '.png', array('alt' => h($event['Event']['org']),'width' => '48','hight' => '48'));
else echo $this->Html->tag('span', h($event['Event']['org']), array('class' => 'welcome', 'style' => 'float:right;'));?><?php
?>
2012-12-19 14:34:40 +01:00
&nbsp;</td><?php
2012-12-18 20:25:12 +01:00
endif; ?>
<td class="short">
<?php echo $this->Html->link($event['Event']['id'], array('controller' => 'events', 'action' => 'view', $event['Event']['id'])); ?>
&nbsp;</td>
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
2012-12-19 14:34:40 +01:00
<?php echo $event['Event']['attribute_count']; ?>&nbsp;</td><?php
if ($isAdmin): ?>
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
<?php if($isSiteAdmin || $event['Event']['org'] == $me['org']) echo h($event['User']['email']);
?>&nbsp;</td><?php
2012-12-18 20:25:12 +01:00
endif; ?>
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
<?php echo $event['Event']['date']; ?>&nbsp;</td>
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
<?php echo $event['Event']['risk']; ?>&nbsp;</td>
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
<?php echo $analysisLevels[$event['Event']['analysis']]; ?>&nbsp;</td>
<td onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
2013-04-24 15:49:35 +02:00
<?php echo nl2br(h($event['Event']['info'])); ?>&nbsp;</td>
2012-12-18 20:25:12 +01:00
<?php
if ('true' == Configure::read('CyDefSIG.sync')): ?>
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
<?php echo $event['Event']['distribution'] != 'All communities' ? $event['Event']['distribution'] : 'All';?></td>
2012-12-18 20:25:12 +01:00
<?php
endif; ?>
<td class="actions">
2012-03-25 16:25:16 +02:00
<?php
if (0 == $event['Event']['published'] && ($isSiteAdmin || ($isAclPublish && $event['Event']['org'] == $me['org'])))
echo $this->Form->postLink('', array('action' => 'alert', $event['Event']['id']), array('class' => 'icon-download-alt', 'title' => 'Publish Event'), 'Are you sure this event is complete and everyone should be informed?');
elseif (0 == $event['Event']['published']) echo 'Not published';
2011-11-26 10:45:31 +01:00
?>
2012-12-18 20:25:12 +01:00
<?php
if ($isSiteAdmin || ($isAclModify && $event['Event']['user_id'] == $me['id']) || ($isAclModifyOrg && $event['Event']['org'] == $me['org'])) {
echo $this->Html->link('', array('action' => 'edit', $event['Event']['id']), array('class' => 'icon-edit', 'title' => 'Edit'));
echo $this->Form->postLink('', array('action' => 'delete', $event['Event']['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete # %s?', $event['Event']['id']));
2012-12-18 20:25:12 +01:00
}?>
<?php echo $this->Html->link('', array('controller' => 'events', 'action' => 'view', $event['Event']['id']), array('class' => 'icon-list-alt', 'title' => 'View')); ?>
2011-11-26 10:45:31 +01:00
</td>
</tr>
2012-12-18 20:25:12 +01:00
<?php
endforeach; ?>
2011-11-26 10:45:31 +01:00
</table>
<p>
<?php
echo $this->Paginator->counter(array(
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
2011-11-26 10:45:31 +01:00
));
?> </p>
<div class="paging">
<?php
echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
echo $this->Paginator->numbers(array('separator' => ''));
echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
?>
2011-11-26 10:45:31 +01:00
</div>
</div>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('Add Event', true), array('controller' => 'events' ,'action' => 'add')); ?> </li>
2011-11-26 10:45:31 +01:00
</ul>
2013-01-04 14:13:06 +01:00
</div>