new: [sync] Added sighting sync publish button to the event view

pull/5430/head
iglocska 2019-11-25 16:21:42 +01:00
parent bdfe59766a
commit dbc229c83c
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
4 changed files with 14 additions and 1 deletions

View File

@ -2620,7 +2620,7 @@ class EventsController extends AppController
}
} else {
$this->set('id', $id);
$this->set('type', 'publish_sightings');
$this->set('type', 'publishSightings');
$this->render('ajax/eventPublishConfirmationForm');
}
}

View File

@ -143,6 +143,16 @@
'class' => (isset($event['Event']['published']) && (1 == $event['Event']['published'] && $mayModify)) ? '' : 'hidden',
'text' => __('Unpublish')
));
if (!empty($event['Event']['published']) && $me['Role']['perm_sighting']) {
echo $this->element('/genericElements/SideMenu/side_menu_link', array(
'onClick' => array(
'function' => 'publishPopup',
'params' => array($event['Event']['id'], 'sighting')
),
'class' => 'publishButtons',
'text' => __('Publish Sightings')
));
}
if (Configure::read('MISP.delegation')) {
if ((Configure::read('MISP.unpublishedprivate') || (isset($event['Event']['distribution']) && $event['Event']['distribution'] == 0)) && (!isset($delegationRequest) || !$delegationRequest) && ($isSiteAdmin || (isset($isAclDelegate) && $isAclDelegate))) {
echo $this->element('/genericElements/SideMenu/side_menu_link', array(

View File

@ -16,6 +16,8 @@
echo '<p>' . __('Are you sure this event is complete and everyone should be informed?') . '</p>';
} else if ($type === 'unpublish') {
echo '<p>' . __('Are you sure you wish to unpublish the event?') . '</p>';
} else if ($type === 'publishSightings') {
echo '<p>' . __('Are you sure you wish publish and synchronise all sightings attached to this event?') . '</p>';
} else {
echo '<p>' . __('Publish but do NOT send alert email? Only for minor changes!') . '</p>';
}

View File

@ -78,6 +78,7 @@ function publishPopup(id, type) {
var action = "alert";
if (type == "publish") action = "publish";
if (type == "unpublish") action = "unpublish";
if (type == "sighting") action = "publishSightings";
var destination = 'attributes';
$.get( "/events/" + action + "/" + id, function(data) {
$("#confirmation_box").html(data);