2022-08-29 09:03:42 +02:00
|
|
|
<?php
|
|
|
|
echo $this->element('genericElements/Form/genericForm', [
|
|
|
|
'data' => [
|
|
|
|
'title' => __('Notification settings'),
|
|
|
|
'fields' => [
|
|
|
|
[
|
|
|
|
'field' => 'notification_daily',
|
|
|
|
'label' => __('Subscribe to daily notifications'),
|
|
|
|
'default' => 0,
|
|
|
|
'type' => 'checkbox'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'field' => 'notification_weekly',
|
|
|
|
'label' => __('Subscribe to weekly notifications'),
|
|
|
|
'default' => 0,
|
|
|
|
'type' => 'checkbox'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'field' => 'notification_monthly',
|
2022-08-31 11:51:36 +02:00
|
|
|
'label' => __('Subscribe to monthly notifications'),
|
2022-08-29 09:03:42 +02:00
|
|
|
'default' => 0,
|
|
|
|
'type' => 'checkbox'
|
|
|
|
],
|
|
|
|
sprintf('<h4>%s</h4>', __('Notification filters')),
|
|
|
|
[
|
|
|
|
'field' => 'periodic_settings.orgc_id',
|
|
|
|
'label' => __('Creator organisation'),
|
2022-09-09 14:17:21 +02:00
|
|
|
'class' => 'span6',
|
2022-09-01 09:45:49 +02:00
|
|
|
'options' => $orgs,
|
|
|
|
'type' => 'dropdown',
|
|
|
|
'multiple' => true,
|
|
|
|
'picker' => true,
|
2022-08-29 09:03:42 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'field' => 'periodic_settings.distribution',
|
2022-08-30 14:10:01 +02:00
|
|
|
'label' => __('Distribution level'),
|
2022-09-09 14:17:21 +02:00
|
|
|
'class' => 'input span6',
|
2022-09-09 10:50:25 +02:00
|
|
|
'options' => [-1 => ' '] + $distributionLevels,
|
2022-08-29 09:03:42 +02:00
|
|
|
'type' => 'dropdown'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'field' => 'periodic_settings.sharing_group_id',
|
|
|
|
'label' => __('Sharing Group'),
|
2022-09-09 14:17:21 +02:00
|
|
|
'class' => 'input span6',
|
2022-08-29 09:03:42 +02:00
|
|
|
'options' => $sharingGroups,
|
2022-09-01 09:45:49 +02:00
|
|
|
'type' => 'dropdown',
|
|
|
|
'multiple' => true,
|
2022-08-29 09:03:42 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'field' => 'periodic_settings.event_info',
|
|
|
|
'label' => __('Event info'),
|
2022-09-09 14:17:21 +02:00
|
|
|
'class' => 'input span6',
|
2022-08-29 09:03:42 +02:00
|
|
|
'placeholder' => 'Phishing URL',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'field' => 'periodic_settings.tags',
|
2022-08-31 14:54:27 +02:00
|
|
|
'label' => __('Event Tags'),
|
2022-09-09 14:17:21 +02:00
|
|
|
'class' => 'span6',
|
2022-08-29 09:03:42 +02:00
|
|
|
'type' => 'tagsPicker',
|
|
|
|
'placeholder' => '["tlp:red"]',
|
|
|
|
],
|
2022-09-08 14:54:04 +02:00
|
|
|
sprintf('<h4>%s</h4>', __('Notification filters')),
|
|
|
|
[
|
|
|
|
'field' => 'periodic_settings.trending_for_tags',
|
|
|
|
'label' => __('Generate trends for tag namespaces'),
|
2022-09-09 14:17:21 +02:00
|
|
|
'class' => 'span6',
|
2022-09-08 14:54:04 +02:00
|
|
|
'type' => 'textarea',
|
|
|
|
'placeholder' => '["misp-galaxy:mitre-attack-pattern", "admiralty-scale"]',
|
|
|
|
],
|
2022-08-29 09:03:42 +02:00
|
|
|
],
|
|
|
|
'submit' => [
|
|
|
|
'action' => $this->request->params['action'],
|
|
|
|
'ajaxSubmit' => 'submitGenericFormInPlace();'
|
|
|
|
]
|
|
|
|
]
|
|
|
|
]);
|
|
|
|
if (!$ajax) {
|
|
|
|
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'globalActions', 'menuItem' => 'notification_settings'));
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
checkSharingGroup('periodic_settings');
|
|
|
|
|
|
|
|
$('#periodic_settingsDistribution').change(function() {
|
|
|
|
checkSharingGroup('periodic_settings');
|
|
|
|
});
|
|
|
|
})
|
2022-09-08 16:15:31 +02:00
|
|
|
</script>
|
2022-09-09 14:17:21 +02:00
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|