chg: [event:view] Added button to quickly extend an event. Fix #4481.

pull/4580/head
mokaddem 2019-05-06 15:38:08 +02:00
parent ffbbb9292d
commit b192a6ce28
3 changed files with 16 additions and 1 deletions

View File

@ -1928,6 +1928,9 @@ class EventsController extends AppController
$this->set('info', $info);
$this->set('analysisDescriptions', $this->Event->analysisDescriptions);
$this->set('analysisLevels', $this->Event->analysisLevels);
if (isset($this->params['named']['extends'])) {
$this->set('extends_uuid', $this->params['named']['extends']);
}
}
public function addIOC($id)

View File

@ -59,6 +59,7 @@
));
echo $this->Form->input('extends_uuid', array(
'label' => __('Extends event'),
'value' => isset($extends_uuid) ? $extends_uuid : '',
'div' => 'clear',
'class' => 'form-control span6',
'placeholder' => __('Event UUID or ID. Leave blank if not applicable.')
@ -105,6 +106,7 @@ echo $this->Form->end();
if ($('#EventDistribution').val() == 4) $('#SGContainer').show();
else $('#SGContainer').hide();
initPopoverContent('Event');
previewEventBasedOnUuids();
});
</script>
<?php echo $this->Js->writeBuffer();

View File

@ -52,7 +52,17 @@
if (strlen($title) > 58) $title = substr($title, 0, 55) . '...';
$table_data = array();
$table_data[] = array('key' => __('Event ID'), 'value' => $event['Event']['id']);
$table_data[] = array('key' => 'UUID', 'value' => $event['Event']['uuid']);
$table_data[] = array(
'key' => 'UUID',
'html' => sprintf('%s %s',
$event['Event']['uuid'],
sprintf('<a href="%s/events/add/extends:%s" class="btn btn-inverse noPrint" style="line-height: 10px; padding: 4px 4px;" title="%s">+</a>',
$baseurl,
$event['Event']['id'],
__('Extend this event')
)
)
);
if (Configure::read('MISP.showorgalternate')) {
$table_data[] = array(
'key' => __('Source Organisation'),