mirror of https://github.com/MISP/MISP
fix: [UI] Undefined index
parent
41aa9d225f
commit
9e0a2546ff
|
@ -35,8 +35,6 @@
|
|||
<div id="galaxies_div">
|
||||
<span class="title-section"><?= __('Galaxies') ?></span>
|
||||
<?= $this->element('galaxyQuickViewNew', [
|
||||
'mayModify' => $mayModify,
|
||||
'isAclTagger' => $isAclTagger,
|
||||
'data' => $event['Galaxy'],
|
||||
'event' => $event,
|
||||
'target_id' => $event['Event']['id'],
|
||||
|
|
|
@ -157,9 +157,7 @@
|
|||
<td class="short" id="attribute_<?= $objectId ?>_galaxy">
|
||||
<?php
|
||||
echo $this->element('galaxyQuickViewNew', array(
|
||||
'mayModify' => $mayModify,
|
||||
'isAclTagger' => $isAclTagger,
|
||||
'data' => (!empty($object['Galaxy']) ? $object['Galaxy'] : array()),
|
||||
'data' => !empty($object['Galaxy']) ? $object['Galaxy'] : array(),
|
||||
'event' => $event,
|
||||
'target_id' => $objectId,
|
||||
'target_type' => 'attribute',
|
||||
|
|
|
@ -81,13 +81,11 @@
|
|||
$galaxies[$galaxy_id]['GalaxyCluster'][] = $galaxy_cluster;
|
||||
}
|
||||
echo $this->element('galaxyQuickViewNew', array(
|
||||
'mayModify' => false,
|
||||
'isAclTagger' => false,
|
||||
'data' => $galaxies,
|
||||
'event' => $event,
|
||||
'target_id' => $eventId,
|
||||
'target_type' => 'event',
|
||||
'static_tags_only' => 1
|
||||
'static_tags_only' => true,
|
||||
));
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<td class="shortish">
|
||||
<?php
|
||||
echo $this->element('galaxyQuickViewNew', array(
|
||||
'mayModify' => ($isSiteAdmin || $me['org_id'] == $item['TagCollection']['org_id']),
|
||||
'isAclTagger' => $me['Role']['perm_tagger'],
|
||||
'tagAccess' => ($isSiteAdmin || $me['org_id'] == $item['TagCollection']['org_id']),
|
||||
'localTagAccess' => false,
|
||||
'data' => $item['Galaxy'],
|
||||
'target_id' => h($item['TagCollection']['id']),
|
||||
'target_type' => 'tag_collection',
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
<?php
|
||||
// When viewing remote server or feed event
|
||||
if (isset($preview) && $preview) {
|
||||
$mayModify = false;
|
||||
$isAclTagger = false;
|
||||
$static_tags_only = true;
|
||||
} else {
|
||||
$preview = false;
|
||||
}
|
||||
$tagAccess = $this->Acl->canModifyTag($event);
|
||||
if (empty($local_tag_off) || !empty($event)) {
|
||||
$localTagAccess = $this->Acl->canModifyTag($event, true);
|
||||
} else {
|
||||
$localTagAccess = false;
|
||||
|
||||
if ($target_type === 'event' || $target_type === 'attribute') {
|
||||
$tagAccess = $this->Acl->canModifyTag($event);
|
||||
if (empty($local_tag_off) || !empty($event)) {
|
||||
$localTagAccess = $this->Acl->canModifyTag($event, true);
|
||||
} else {
|
||||
$localTagAccess = false;
|
||||
}
|
||||
}
|
||||
|
||||
$editButtonsEnabled = empty($static_tags_only) && $tagAccess;
|
||||
|
@ -110,16 +111,19 @@ $generatePopover = function (array $cluster) use ($normalizeKey) {
|
|||
]
|
||||
];
|
||||
if ($editButtonsEnabled || ($editButtonsLocalEnabled && $cluster['local'])) {
|
||||
$action_items[] = [
|
||||
'onClick' => sprintf(
|
||||
"openGenericModal('%s/tags/modifyTagRelationship/%s/%s')",
|
||||
$baseurl,
|
||||
h($target_type),
|
||||
h($cluster[$target_type . '_tag_id'])
|
||||
),
|
||||
'class' => 'useCursorPointer black fas fa-project-diagram',
|
||||
'title' => __('Modify tag relationship')
|
||||
];
|
||||
if ($target_type !== 'tag_collection') {
|
||||
$action_items[] = [
|
||||
'url' => sprintf(
|
||||
"%s/tags/modifyTagRelationship/%s/%s",
|
||||
$baseurl,
|
||||
h($target_type),
|
||||
h($cluster[$target_type . '_tag_id'])
|
||||
),
|
||||
'onClick' => false,
|
||||
'class' => 'useCursorPointer black fas fa-project-diagram modal-open',
|
||||
'title' => __('Modify tag relationship')
|
||||
];
|
||||
}
|
||||
$action_items[] = [
|
||||
'url' => $baseurl . '/galaxy_clusters/detach/' . intval($target_id) . '/' . h($target_type) . '/' . h($cluster['tag_id']),
|
||||
'onClick' => sprintf(
|
||||
|
@ -129,7 +133,7 @@ $generatePopover = function (array $cluster) use ($normalizeKey) {
|
|||
),
|
||||
'class' => 'black fas fa-trash',
|
||||
'aria_label' => __('Detach'),
|
||||
'title' => __('Are you sure you want to detach %s from this event?', h($cluster['value'])),
|
||||
'title' => __('Are you sure you want to detach %s from this %s?', h($cluster['value']), $target_type),
|
||||
];
|
||||
}
|
||||
foreach ($action_items as $action_item) {
|
||||
|
|
|
@ -4,9 +4,7 @@ $event = $row['Event'];
|
|||
|
||||
echo '<div id="attribute_' . intval($attribute['id']) . '_galaxy">';
|
||||
echo $this->element('galaxyQuickViewNew', array(
|
||||
'mayModify' => $mayModify,
|
||||
'isAclTagger' => $isAclTagger,
|
||||
'data' => (!empty($attribute['Galaxy']) ? $attribute['Galaxy'] : array()),
|
||||
'data' => !empty($attribute['Galaxy']) ? $attribute['Galaxy'] : array(),
|
||||
'event' => ['Event' => $event],
|
||||
'target_id' => $attribute['id'],
|
||||
'target_type' => 'attribute',
|
||||
|
|
|
@ -3,8 +3,6 @@ if ($scope === 'event') {
|
|||
echo '<span class="title-section">' . __('Galaxies') . '</span>';
|
||||
}
|
||||
echo $this->element('galaxyQuickViewNew', [
|
||||
'mayModify' => $mayModify,
|
||||
'isAclTagger' => $isAclTagger,
|
||||
'data' => $object['Galaxy'],
|
||||
'event' => $object,
|
||||
'target_id' => $scope == 'event' ? $object['Event']['id'] : $object['Attribute']['id'],
|
||||
|
|
Loading…
Reference in New Issue