MISP/app/View/Events/edit.ctp

115 lines
4.8 KiB
Plaintext
Raw Normal View History

2013-05-28 11:15:21 +02:00
<div class="events form">
<?php echo $this->Form->create('Event');?>
<fieldset>
<legend><?php echo __('Edit Event'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('date', array(
'type' => 'text',
'class' => 'datepicker'
));
2013-05-28 11:15:21 +02:00
if ('true' == Configure::read('CyDefSIG.sync')) {
echo $this->Form->input('distribution', array(
'options' => array($distributionLevels),
'label' => 'Distribution',
'selected' => '3',
));
2013-05-28 11:15:21 +02:00
}
echo $this->Form->input('risk', array(
'div' => 'input clear'
));
echo $this->Form->input('analysis', array(
'options' => array($analysisLevels),
));
echo $this->Form->input('info', array(
'div' => 'clear',
'class' => 'input-xxlarge'
));
2013-05-28 11:15:21 +02:00
?>
</fieldset>
<?php
echo $this->Form->button('Edit', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
2013-05-28 11:15:21 +02:00
</div>
<div class="actions">
<ul class="nav nav-list">
2013-06-10 17:57:20 +02:00
<li><a href="/events/view/<?php echo $this->request->data['Event']['id'];?>">View Event</a></li>
2013-06-03 10:48:38 +02:00
<?php if ($isSiteAdmin || $mayModify): ?>
2013-06-10 17:57:20 +02:00
<li class="active"><a href="/events/edit/<?php echo $this->request->data['Event']['id'];?>">Edit Event</a></li>
2013-06-03 10:48:38 +02:00
<li><?php echo $this->Form->postLink('Delete Event', array('action' => 'delete', $this->request->data['Event']['id']), null, __('Are you sure you want to delete # %s?', $this->request->data['Event']['id'])); ?></li>
<li class="divider"></li>
2013-06-10 17:57:20 +02:00
<li><a href="/attributes/add/<?php echo $this->request->data['Event']['id'];?>">Add Attribute</a></li>
<li><a href="/attributes/add_attachment/<?php echo $this->request->data['Event']['id'];?>">Add Attachment</a></li>
<li><a href="/events/addIOC/<?php echo $this->request->data['Event']['id'];?>">Populate from IOC</a></li>
2013-06-03 10:48:38 +02:00
<?php else: ?>
2013-06-10 17:57:20 +02:00
<li><a href="/shadow_attributes/add/<?php echo $this->request->data['Event']['id'];?>">Propose Attribute</a></li>
<li><a href="/shadow_attributes/add_attachment/<?php echo $this->request->data['Event']['id'];?>">Propose Attachment</a></li>
<?php endif; ?>
<li class="divider"></li>
2013-06-03 10:48:38 +02:00
<?php if ( 0 == $this->request->data['Event']['published'] && ($isAdmin || $mayPublish)): ?>
<li><?php echo $this->Form->postLink('Publish Event', array('action' => 'alert', $this->request->data['Event']['id']), null, 'Are you sure this event is complete and everyone should be informed?'); ?></li>
<li><?php echo $this->Form->postLink('Publish (no email)', array('action' => 'publish', $this->request->data['Event']['id']), null, 'Publish but do NOT send alert email? Only for minor changes!'); ?></li>
<?php elseif (0 == $this->request->data['Event']['published']): ?>
<li>Not published</li>
<?php else: ?>
<!-- ul><li>Alert already sent</li></ul -->
<?php endif; ?>
2013-06-10 17:57:20 +02:00
<li><a href="/events/contact/<?php echo $this->request->data['Event']['id'];?>">Contact Reporter</a></li>
<li><a href="/events/xml/download/<?php echo $this->request->data['Event']['id'];?>">Download as XML</a></li>
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->request->data['Event']['id'];?>">Download as IOC</a></li>
<li class="divider"></li>
2013-06-10 17:57:20 +02:00
<li><a href="/events/index">List Events</a></li>
2013-06-03 10:48:38 +02:00
<?php if ($isAclAdd): ?>
2013-06-10 17:57:20 +02:00
<li><a href="/events/add">Add Event</a></li>
2013-06-03 10:48:38 +02:00
<?php endif; ?>
2013-05-28 11:15:21 +02:00
</ul>
</div>
<script type="text/javascript">
//
//Generate tooltip information
//
var formInfoValues = new Array();
<?php
if ('true' == $canEditDist) {
foreach ($distributionDescriptions as $type => $def) {
$info = isset($def['formdesc']) ? $def['formdesc'] : $def['desc'];
echo "formInfoValues['" . addslashes($type) . "'] = \"" . addslashes($info) . "\";\n"; // as we output JS code we need to add slashes
}
}
foreach ($riskDescriptions as $type => $def) {
$info = isset($def['formdesc']) ? $def['formdesc'] : $def['desc'];
echo "formInfoValues['" . addslashes($type) . "'] = \"" . addslashes($info) . "\";\n"; // as we output JS code we need to add slashes
}
foreach ($analysisDescriptions as $type => $def) {
$info = isset($def['formdesc']) ? $def['formdesc'] : $def['desc'];
echo "formInfoValues['" . addslashes($type) . "'] = \"" . addslashes($info) . "\";\n"; // as we output JS code we need to add slashes
}
?>
2013-06-06 16:36:28 +02:00
$(document).ready(function() {
$("#EventAnalysis, #EventRisk, #EventDistribution").on('mouseleave', function(e) {
$('#'+e.currentTarget.id).popover('destroy');
});
$("#EventAnalysis, #EventRisk, #EventDistribution").on('mouseover', function(e) {
var $e = $(e.target);
if ($e.is('option')) {
$('#'+e.currentTarget.id).popover('destroy');
$('#'+e.currentTarget.id).popover({
trigger: 'manual',
placement: 'right',
content: formInfoValues[$e.val()],
}).popover('show');
2013-05-28 11:15:21 +02:00
}
// hide the formInfo things
$('#EventDistributionDiv').hide();
2013-05-28 11:15:21 +02:00
$('#EventRiskDiv').hide();
$('#EventAnalysisDiv').hide();
</script>
2012-10-23 11:28:39 +02:00
<?php echo $this->Js->writeBuffer();