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>
2013-03-26 14:32:32 +01:00
<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
2013-02-19 15:37:35 +01:00
endif; ?>
<?php
2013-03-13 15:11:49 +01:00
if ($isSiteAdmin): ?>
2013-02-19 15:37:35 +01:00
<th><?php echo $this->Paginator->sort('owner org');?></th>
<?php
2012-12-18 20:25:12 +01:00
endif; ?>
2012-08-31 10:23:40 +02:00
<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
2013-04-16 15:29:34 +02:00
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>
2012-09-19 11:05:10 +02:00
<th<?php echo ' title="' . $eventDescriptions['risk']['desc'] . '"';?>>
2012-09-18 15:30:32 +02:00
<?php echo $this->Paginator->sort('risk');?></th>
2012-12-17 15:51:30 +01:00
<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')): ?>
2013-04-17 11:13:09 +02:00
<th<?php echo ' title="' . $eventDescriptions['distribution']['desc'] . '"';?>>
<?php echo $this->Paginator->sort('distribution');?></th>
<?php
2012-12-18 20:25:12 +01:00
endif; ?>
2012-03-15 15:06:45 +01:00
<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):?>
2012-03-15 15:06:45 +01:00
<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) {
2013-01-02 15:49:49 +01:00
echo $this->Html->image('yes.png', array('title' => 'Validated', 'alt' => 'Validated', 'width' => '16', 'hight' => '16'));
2012-12-19 14:34:40 +01:00
} else {
2013-01-02 15:49:49 +01:00
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
}?>
</td><?php
2012-12-18 20:25:12 +01:00
if ('true' == Configure::read('CyDefSIG.showorg') || $isAdmin): ?>
2013-02-19 15:37:35 +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']['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
?>
</td><?php
endif;
2013-03-13 15:11:49 +01:00
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
2012-12-20 16:56:56 +01:00
$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-08-31 10:23:40 +02:00
?>
2012-12-19 14:34:40 +01:00
</td><?php
2012-12-18 20:25:12 +01:00
endif; ?>
2012-06-25 08:00:08 +02:00
<td class="short">
2012-07-24 15:44:04 +02:00
<?php echo $this->Html->link($event['Event']['id'], array('controller' => 'events', 'action' => 'view', $event['Event']['id'])); ?>
2012-03-15 15:06:45 +01:00
</td>
2012-11-14 16:14:04 +01:00
<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']; ?> </td><?php
2013-04-16 15:29:34 +02:00
if ($isAdmin): ?>
2012-09-18 15:30:32 +02:00
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
2013-04-16 15:29:34 +02:00
<?php if($isSiteAdmin || $event['Event']['org'] == $me['org']) echo h($event['User']['email']);
2013-03-13 15:11:49 +01:00
?> </td><?php
2012-12-18 20:25:12 +01:00
endif; ?>
2012-09-18 15:30:32 +02:00
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
2012-03-16 14:13:31 +01:00
<?php echo $event['Event']['date']; ?> </td>
2012-09-18 15:30:32 +02:00
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
2012-03-16 14:13:31 +01:00
<?php echo $event['Event']['risk']; ?> </td>
2012-12-17 15:51:30 +01:00
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
<?php echo $analysisLevels[$event['Event']['analysis']]; ?> </td>
2012-09-18 15:30:32 +02:00
<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'])); ?> </td>
2012-12-18 20:25:12 +01:00
<?php
2013-04-17 11:13:09 +02:00
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; ?>
2012-03-15 15:06:45 +01:00
<td class="actions">
2012-03-25 16:25:16 +02:00
<?php
2013-03-13 15:11:49 +01:00
if (0 == $event['Event']['published'] && ($isSiteAdmin || ($isAclPublish && $event['Event']['org'] == $me['org'])))
2013-05-30 11:14:00 +02:00
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?');
2012-03-27 14:49:31 +02:00
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
2013-03-05 16:17:34 +01:00
if ($isSiteAdmin || ($isAclModify && $event['Event']['user_id'] == $me['id']) || ($isAclModifyOrg && $event['Event']['org'] == $me['org'])) {
2013-05-30 11:14:00 +02:00
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
}?>
2013-05-30 11:14:00 +02: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(
2012-03-15 15:06:45 +01:00
'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">
2012-09-21 08:51:00 +02:00
<?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>
2013-05-30 11:14:00 +02:00
<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>