2020-10-17 16:01:33 +02:00
|
|
|
<div class="index" style="margin-bottom: 2em">
|
2019-03-20 11:31:09 +01:00
|
|
|
<h2><?php echo h($title); ?></h2>
|
|
|
|
<?php
|
2019-04-15 17:12:53 +02:00
|
|
|
$event_id = $event['Event']['id'];
|
2020-08-16 13:31:31 +02:00
|
|
|
$url = $baseurl . '/events/handleModuleResults/' . $event_id;
|
2019-04-02 22:27:33 +02:00
|
|
|
echo $this->Form->create('Event', array('url' => $url, 'class' => 'mainForm'));
|
2019-03-22 22:31:56 +01:00
|
|
|
$formSettings = array(
|
|
|
|
'type' => 'hidden',
|
|
|
|
'value' => json_encode($event, true)
|
|
|
|
);
|
2019-03-28 10:19:36 +01:00
|
|
|
echo $this->Form->input('data', $formSettings);
|
2019-04-04 16:16:56 +02:00
|
|
|
echo $this->Form->input('JsonObject', array(
|
|
|
|
'label' => false,
|
|
|
|
'type' => 'text',
|
|
|
|
'style' => 'display:none;',
|
|
|
|
'value' => ''
|
|
|
|
));
|
|
|
|
echo $this->Form->input('default_comment', array(
|
|
|
|
'label' => false,
|
|
|
|
'type' => 'text',
|
|
|
|
'style' => 'display:none;',
|
|
|
|
'value' => $importComment
|
|
|
|
));
|
2019-04-02 22:27:33 +02:00
|
|
|
echo $this->Form->end();
|
2019-03-20 11:31:09 +01:00
|
|
|
$objects_array = array();
|
2019-04-26 14:56:40 +02:00
|
|
|
foreach (array('Attribute', 'Object') as $field) {
|
|
|
|
if (!empty($event[$field])) {
|
|
|
|
$objects_array[] = strtolower($field) . 's';
|
|
|
|
}
|
2019-03-20 11:31:09 +01:00
|
|
|
}
|
2019-04-26 14:56:40 +02:00
|
|
|
if (empty($objects_array)) {
|
|
|
|
echo '<p>Results from the enrichment module for this attribute are empty.</p>';
|
|
|
|
} else {
|
2020-10-17 16:01:33 +02:00
|
|
|
$scope = implode(' and ', $objects_array);
|
2019-04-30 10:02:00 +02:00
|
|
|
echo '<p>Below you can see the ' . $scope . ' that are to be created from the results of the enrichment module.</p>';
|
2019-06-21 12:25:12 +02:00
|
|
|
$table_data = array(array('key' => __('Event ID'), 'value' => $event_id));
|
|
|
|
$event_metadata = $event['Event'];
|
|
|
|
if (!empty($event_metadata['uuid'])) {
|
2020-10-17 16:01:33 +02:00
|
|
|
$table_data[] = array(
|
|
|
|
'key' => __('Event UUID'),
|
|
|
|
'html' => '<span class="quickSelect">'. h($event_metadata['uuid']) . '</span>',
|
|
|
|
);
|
2019-06-21 12:25:12 +02:00
|
|
|
}
|
|
|
|
if (!empty($event_metadata['orgc_id']) && !empty($event_metadata['orgc_name'])) {
|
|
|
|
$table_data[] = array('key' => __('Event creator org'), 'html' => sprintf(
|
2019-06-11 13:51:53 +02:00
|
|
|
'<a href=%s/organisations/view/%s>%s</a>',
|
|
|
|
$baseurl,
|
|
|
|
h($event['Event']['orgc_id']),
|
|
|
|
h($event['Event']['orgc_name'])
|
2019-06-21 12:25:12 +02:00
|
|
|
));
|
|
|
|
}
|
|
|
|
if (!empty($event_metadata['info'])) {
|
|
|
|
array('key' => __('Event info'), 'value' => $event['Event']['info']);
|
|
|
|
}
|
2019-06-11 13:51:53 +02:00
|
|
|
$attributes_count = isset($event['Attribute']) ? count($event['Attribute']) : 0;
|
|
|
|
$objects_count = isset($event['Object']) ? count($event['Object']) : 0;
|
|
|
|
if (!empty($event['Object'])) {
|
|
|
|
foreach ($event['Object'] as $object) {
|
|
|
|
if (!empty($object['Attribute'])) {
|
|
|
|
$attributes_count += count($object['Attribute']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-07-19 16:22:16 +02:00
|
|
|
$count = __n('%s (%s object)', '%s (%s objects)', $objects_count, $attributes_count, $objects_count);
|
2019-06-17 17:19:59 +02:00
|
|
|
if (!empty($event['Tag'])) {
|
|
|
|
$table_data[] = array(
|
|
|
|
'key' => __('Tags'),
|
|
|
|
'html' => sprintf(
|
|
|
|
'<span class="eventTagContainer">%s</span>',
|
|
|
|
$this->element('ajaxTags', array(
|
|
|
|
'event' => $event,
|
|
|
|
'tags' => $event['Tag'],
|
|
|
|
'tagAccess' => ($isSiteAdmin || $me['org_id'] == $event['Event']['orgc_id']),
|
|
|
|
'static_tags_only' => 1
|
|
|
|
))
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2019-06-11 13:51:53 +02:00
|
|
|
$table_data[] = array('key' => __('#Resolved Attributes'), 'value' => $count);
|
|
|
|
echo $this->element('genericElements/viewMetaTable', array('table_data' => $table_data));
|
2019-03-20 11:31:09 +01:00
|
|
|
}
|
2019-04-02 22:27:33 +02:00
|
|
|
$attributeFields = array('category', 'type', 'value', 'uuid');
|
2019-04-29 17:11:37 +02:00
|
|
|
$header_present = false;
|
2019-06-19 17:20:48 +02:00
|
|
|
$typesWithData = array('attachment', 'malware-sample');
|
2019-04-16 14:26:18 +02:00
|
|
|
if (!empty($event['Object'])) {
|
2019-04-02 22:27:33 +02:00
|
|
|
?>
|
2020-10-17 16:01:33 +02:00
|
|
|
<table class="table table-striped table-condensed">
|
2019-04-29 17:11:37 +02:00
|
|
|
<tbody>
|
2019-04-02 22:27:33 +02:00
|
|
|
<tr>
|
2019-12-16 16:22:28 +01:00
|
|
|
<th><?php echo __('Import');?></th>
|
2019-04-29 17:11:37 +02:00
|
|
|
<th><?php echo __('Category');?></th>
|
|
|
|
<th><?php echo __('Type');?></th>
|
|
|
|
<th><?php echo __('Value');?></th>
|
2019-12-16 16:22:28 +01:00
|
|
|
<th class="hidden"><?php echo __('UUID');?></th>
|
2019-06-14 18:16:09 +02:00
|
|
|
<th><?php echo __('Tags');?></th>
|
2019-04-29 17:11:37 +02:00
|
|
|
<th><?php echo __('IDS');?></th>
|
|
|
|
<th><?php echo __('Disable Correlation');?></th>
|
|
|
|
<th><?php echo __('Comment');?></th>
|
|
|
|
<th><?php echo __('Distribution');?></th>
|
2019-04-02 22:27:33 +02:00
|
|
|
</tr>
|
2019-04-29 17:11:37 +02:00
|
|
|
<?php
|
|
|
|
$header_present = true;
|
|
|
|
foreach ($event['Object'] as $o => $object) {
|
|
|
|
?>
|
2020-10-17 16:01:33 +02:00
|
|
|
<tbody class="MISPObject">
|
|
|
|
<tr class="tableHighlightBorderTop borderBlue blueRow" tabindex="0">
|
2019-12-16 16:22:28 +01:00
|
|
|
<td class="short" style="width:40px;text-align:center;">
|
|
|
|
<input type="checkbox" class="ImportMISPObject" checked />
|
|
|
|
</td>
|
|
|
|
<td colspan="6">
|
2019-04-29 17:11:37 +02:00
|
|
|
<?php if(!empty($object['id'])) { ?>
|
|
|
|
<span class="bold"><?php echo __('ID: ');?></span><span class="ObjectID"><?php echo h($object['id']); ?></span><br />
|
|
|
|
<?php } ?>
|
|
|
|
<span class="bold"><?php echo __('Name: ');?></span><span class="ObjectName"><?php echo h($object['name']); ?></span>
|
|
|
|
<span class="fa fa-expand useCursorPointer" title="<?php echo __('Expand or Collapse');?>" role="button" tabindex="0" aria-label="<?php echo __('Expand or Collapse');?>" data-toggle="collapse" data-target="#Object_<?php echo $o; ?>_collapsible"></span><br />
|
|
|
|
<div id="Object_<?php echo $o; ?>_collapsible" class="collapse">
|
2019-08-02 16:55:24 +02:00
|
|
|
<?php
|
|
|
|
if (!empty($object['description'])) {
|
|
|
|
echo '<span class="bold">Description: </span><span class="ObjectDescription">' . h($object['description']) . '</span><br/>';
|
|
|
|
}
|
|
|
|
if (!empty($object['template_uuid'])) {
|
|
|
|
echo '<span class="bold">Template UUID: </span><span class="TemplateUUID">' . h($object['template_uuid']) . '</span><br/>';
|
|
|
|
}
|
|
|
|
if (!empty($object['template_version'])) {
|
|
|
|
echo '<span class="bold">Template version: </span><span class="TemplateVersion">' . h($object['template_version']) . '</span><br/>';
|
|
|
|
}
|
|
|
|
?>
|
2019-04-29 17:11:37 +02:00
|
|
|
<span class="bold"><?php echo __('UUID: ');?></span><span class="ObjectUUID"><?php echo h($object['uuid']); ?></span><br />
|
|
|
|
<span class="bold"><?php echo __('Meta Category: ');?></span><span class="ObjectMetaCategory"><?php echo h($object['meta-category']); ?></span>
|
|
|
|
</div>
|
|
|
|
<span class="bold"><?php echo __('References: ')?></span>
|
|
|
|
<?php
|
|
|
|
if (!empty($object['ObjectReference'])) {
|
|
|
|
echo sizeof($object['ObjectReference']);
|
|
|
|
?>
|
|
|
|
<span class="fa fa-expand useCursorPointer" title="<?php echo __('Expand or Collapse');?>" role="button" tabindex="0" aria-label="<?php echo __('Expand or Collapse');?>" data-toggle="collapse" data-target="#Object_<?php echo $o; ?>_references_collapsible"></span>
|
|
|
|
<div id="Object_<?php echo $o; ?>_references_collapsible" class="collapse">
|
|
|
|
<?php
|
2019-04-01 16:37:03 +02:00
|
|
|
foreach ($object['ObjectReference'] as $reference) {
|
2019-04-29 17:11:37 +02:00
|
|
|
echo ' <span class="ObjectReference">';
|
|
|
|
echo '<span class="Relationship">' . h($reference['relationship_type']) . ' </span>';
|
2019-04-01 16:37:03 +02:00
|
|
|
$referenced_uuid = $reference['referenced_uuid'];
|
|
|
|
foreach ($event['Object'] as $object_reference) {
|
|
|
|
if ($referenced_uuid === $object_reference['uuid']) {
|
|
|
|
$name = $object_reference['name'];
|
2019-04-29 17:11:37 +02:00
|
|
|
$category = $object_reference['meta-category'];
|
|
|
|
$objectType = 'Object';
|
2019-04-01 16:37:03 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!isset($name)) {
|
|
|
|
foreach ($event['Attribute'] as $attribute_reference) {
|
|
|
|
if ($referenced_uuid === $attribute_reference['uuid']) {
|
|
|
|
$name = $attribute_reference['type'];
|
2019-04-29 17:11:37 +02:00
|
|
|
$category = $attribute_reference['category'];
|
|
|
|
$objectType = 'Attribute';
|
2019-04-01 16:37:03 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!isset($name)) {
|
|
|
|
$name = '';
|
2019-04-29 17:11:37 +02:00
|
|
|
$category = '';
|
|
|
|
$objectType = '';
|
2019-04-01 16:37:03 +02:00
|
|
|
}
|
|
|
|
}
|
2019-04-29 17:11:37 +02:00
|
|
|
echo $objectType . ' <span class="ReferencedUUID">' . $referenced_uuid . '</span> (' . $name . ': ' . $category . ')</span><br />';
|
2019-04-01 16:37:03 +02:00
|
|
|
unset($name);
|
|
|
|
}
|
2019-04-29 17:11:37 +02:00
|
|
|
echo '</div>';
|
|
|
|
} else {
|
|
|
|
echo 0;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</td>
|
2019-08-08 15:50:09 +02:00
|
|
|
<td class="short">
|
|
|
|
<input type="text" class="ObjectComment" style="padding:0px;height:20px;margin-bottom:0px;" placeholder="<?php echo h($importComment); ?>" <?php if (!empty($object['comment'])) echo 'value="' . h($object['comment']) . '"';?>/>
|
|
|
|
</td>
|
2019-04-29 17:11:37 +02:00
|
|
|
<td style="width:60px;text-align:center;">
|
|
|
|
<select class="ObjectDistribution" style="padding:0px;height:20px;margin-bottom:0px;">
|
|
|
|
<?php
|
|
|
|
foreach ($distributions as $distKey => $distValue) {
|
|
|
|
echo '<option value="' . h($distKey) . '" ' . ($distKey == $object['distribution'] ? 'selected="selected"' : '') . '>' . h($distValue) . '</option>';
|
2019-04-04 14:20:00 +02:00
|
|
|
}
|
2019-04-29 17:11:37 +02:00
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<div style="display:none;">
|
|
|
|
<select class='ObjectSharingGroup' style='padding:0px;height:20px;margin-top:3px;margin-bottom:0px;'>
|
|
|
|
<?php
|
|
|
|
foreach ($sgs as $sgKey => $sgValue) {
|
|
|
|
echo '<option value="' . h($sgKey) . '" ' . ($sgKey == $object['sharing_group_id'] ? 'selected="selected"' : '') . '>' . h($sgValue) . '</option>';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
2019-04-04 14:20:00 +02:00
|
|
|
if (!empty($object['Attribute'])) {
|
2019-04-29 17:11:37 +02:00
|
|
|
$last_attribute = end($object['Attribute']);
|
2019-04-02 22:27:33 +02:00
|
|
|
foreach ($object['Attribute'] as $a => $attribute) {
|
2019-04-29 17:11:37 +02:00
|
|
|
$border_position = ($attribute == $last_attribute ? 'Bottom' : 'Center');
|
|
|
|
?>
|
|
|
|
<tr class="ObjectAttribute tableHighlightBorder<?php echo $border_position; ?> borderBlue">
|
2019-12-16 16:22:28 +01:00
|
|
|
<td class="short" style="width:40px;text-align:center;"><input type="checkbox" class="ImportMISPObjectAttribute" checked /></td>
|
2019-04-29 17:11:37 +02:00
|
|
|
<td class="ObjectCategory"><?php echo (isset($attribute['category']) ? h($attribute['category']) : ''); ?></td>
|
|
|
|
<td class="short">
|
2020-10-17 16:01:33 +02:00
|
|
|
<span class="ObjectRelation bold"><?php echo h($attribute['object_relation']); ?></span>
|
2019-04-29 17:11:37 +02:00
|
|
|
<span class="AttributeType"><?php echo h($attribute['type']); ?></span>
|
|
|
|
</td>
|
2020-10-17 16:01:33 +02:00
|
|
|
<td class="AttributeValue limitedWidth"><?= $this->element('Events/View/value_field', ['object' => $attribute]); ?></td>
|
2019-08-02 15:18:11 +02:00
|
|
|
<?php
|
|
|
|
if (in_array($attribute['type'], $typesWithData)) {
|
|
|
|
if (!empty($attribute['data'])) {
|
|
|
|
echo "<input class='AttributeData' type='hidden' value='" . h($attribute['data']) . "'/>";
|
|
|
|
}
|
|
|
|
if (!empty($attribute['encrypt'])) {
|
|
|
|
echo "<input class='AttributeEncrypt' type='hidden' value='" . h($attribute['encrypt']) . "'/>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2019-12-16 16:22:28 +01:00
|
|
|
<td class="AttributeUuid short hidden"><?php echo h($attribute['uuid']); ?></td>
|
2019-06-14 18:16:09 +02:00
|
|
|
<td style="max-width:150px;width:10px;">
|
|
|
|
<?php if (!empty($attribute['Tag'])) { ?>
|
|
|
|
<span class="objectAttributeTagContainer">
|
|
|
|
<?php
|
|
|
|
foreach ($attribute['Tag'] as $tag) {
|
|
|
|
$tagText = explode('=', $tag['name']);
|
|
|
|
$tagText = trim(end($tagText), "\"");
|
|
|
|
$color = !empty($tag['colour']) ? $tag['colour'] : '#0088cc';
|
|
|
|
?>
|
|
|
|
<span style="display:inline-block;">
|
|
|
|
<span style="padding:1px;display:flex;white-space:nowrap;margin-right:2px;word-wrap:break-word;">
|
|
|
|
<span class="objectAttributeTag" style="display:inline-block;background-color:<?php echo h($color); ?>;color:white;" title="<?php echo h($tag['name']); ?>">
|
|
|
|
<?php echo h($tagText); ?>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<?php } ?>
|
|
|
|
</span>
|
|
|
|
<?php } ?>
|
|
|
|
</td>
|
2019-04-02 22:27:33 +02:00
|
|
|
<td class="short" style="width:40px;text-align:center;">
|
2019-04-16 14:26:18 +02:00
|
|
|
<input type="checkbox" class="AttributeToIds" <?php if (!empty($attribute['to_ids'])) echo 'checked'; ?>/>
|
2019-04-03 22:54:09 +02:00
|
|
|
</td>
|
|
|
|
<td class="short" style="width:40px;text-align:center;">
|
2019-04-16 14:26:18 +02:00
|
|
|
<input type="checkbox" class="AttributeDisableCorrelation" <?php if (!empty($attribute['disable_correlation'])) echo 'checked'; ?>/>
|
2019-04-02 22:27:33 +02:00
|
|
|
</td>
|
|
|
|
<td class="short">
|
2019-04-16 14:26:18 +02:00
|
|
|
<input type="text" class="AttributeComment" style="padding:0px;height:20px;margin-bottom:0px;" placeholder="<?php echo h($importComment); ?>" <?php if (!empty($attribute['comment'])) echo 'value="' . h($attribute['comment']) . '"';?>/>
|
2019-04-02 22:27:33 +02:00
|
|
|
</td>
|
|
|
|
<td class="short" style="width:40px;text-align:center;">
|
2019-04-03 22:54:09 +02:00
|
|
|
<select class='AttributeDistribution' style='padding:0px;height:20px;margin-bottom:0px;'>
|
2019-04-02 22:27:33 +02:00
|
|
|
<?php
|
|
|
|
foreach ($distributions as $distKey => $distValue) {
|
2019-04-04 14:21:10 +02:00
|
|
|
echo '<option value="' . h($distKey) . '" ' . ($distKey == $attribute['distribution'] ? 'selected="selected"' : '') . '>' . h($distValue) . '</option>';
|
2019-03-20 11:31:09 +01:00
|
|
|
}
|
2019-04-02 22:27:33 +02:00
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<div style="display:none;">
|
2019-04-03 22:54:09 +02:00
|
|
|
<select class='AttributeSharingGroup' style='padding:0px;height:20px;margin-top:3px;margin-bottom:0px;'>
|
2019-04-02 22:27:33 +02:00
|
|
|
<?php
|
|
|
|
foreach ($sgs as $sgKey => $sgValue) {
|
2019-04-04 14:21:10 +02:00
|
|
|
echo '<option value="' . h($sgKey) . '" ' . ($sgKey == $attribute['sharing_group_id'] ? 'selected="selected"' : '') . '>' . h($sgValue) . '</option>';
|
2019-04-02 22:27:33 +02:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<?php
|
|
|
|
echo '</tr>';
|
2019-03-20 11:31:09 +01:00
|
|
|
}
|
2019-04-02 22:27:33 +02:00
|
|
|
}
|
2020-10-17 16:01:33 +02:00
|
|
|
echo '<tr><td colspan="9"></td></tr>';
|
2019-04-02 22:27:33 +02:00
|
|
|
?>
|
2019-04-29 17:11:37 +02:00
|
|
|
</tbody>
|
|
|
|
<?php
|
|
|
|
}
|
2019-04-09 10:46:21 +02:00
|
|
|
}
|
2019-04-16 14:26:18 +02:00
|
|
|
if (!empty($event['Attribute'])) {
|
2019-05-06 20:16:47 +02:00
|
|
|
if (!$header_present) {
|
|
|
|
?>
|
|
|
|
<table class='table table-striped table-condensed'>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
2019-12-16 16:22:28 +01:00
|
|
|
<th><?php echo __('Import');?></th>
|
2019-05-06 20:16:47 +02:00
|
|
|
<th><?php echo __('Category');?></th>
|
|
|
|
<th><?php echo __('Type');?></th>
|
|
|
|
<th><?php echo __('Value');?></th>
|
2019-12-16 16:22:28 +01:00
|
|
|
<th class="hidden"><?php echo __('UUID');?></th>
|
2019-06-14 18:16:09 +02:00
|
|
|
<th><?php echo __('Tags');?></th>
|
2019-05-06 20:16:47 +02:00
|
|
|
<th><?php echo __('IDS');?></th>
|
|
|
|
<th><?php echo __('Disable Correlation');?></th>
|
|
|
|
<th><?php echo __('Comment');?></th>
|
|
|
|
<th><?php echo __('Distribution');?></th>
|
|
|
|
</tr>
|
2019-05-10 16:17:26 +02:00
|
|
|
<?php
|
2019-05-06 20:16:47 +02:00
|
|
|
}
|
2019-04-02 22:27:33 +02:00
|
|
|
foreach ($event['Attribute'] as $a => $attribute) {
|
2019-12-16 16:22:28 +01:00
|
|
|
?>
|
|
|
|
<tr class="MISPAttribute">
|
|
|
|
<td class="short" style="width:40px;text-align:center;"><input type="checkbox" class="ImportMISPAttribute" checked /></td>
|
|
|
|
<?php
|
2019-04-29 10:38:34 +02:00
|
|
|
foreach (array('category', 'type') as $field) {
|
|
|
|
$field_header = 'class="Attribute' . ucfirst($field);
|
|
|
|
if (isset($attribute[$field])) {
|
|
|
|
if (is_array($attribute[$field])) {
|
|
|
|
echo '<td class="short" style="width:40px;text-align:center;"><select ' . $field_header . 'Select" style="padding:0px;height:20px;margin-bottom:0px;">';
|
|
|
|
foreach ($attribute[$field] as $v => $value) {
|
2020-01-07 14:33:25 +01:00
|
|
|
echo '<option value="' . h($value) . '">' . h($value) . '</option>';
|
2019-04-29 10:38:34 +02:00
|
|
|
}
|
|
|
|
echo '</select></td>';
|
|
|
|
} else {
|
|
|
|
echo '<td ' . $field_header . '">' . h($attribute[$field]) . '</td>';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
echo '<td ' . $field_header . '"></td>';
|
|
|
|
}
|
|
|
|
}
|
2019-05-10 16:17:26 +02:00
|
|
|
?>
|
2020-10-17 16:01:33 +02:00
|
|
|
<td class="AttributeValue limitedWidth"><?= $this->element('Events/View/value_field', ['object' => $attribute]); ?></td>
|
2019-08-02 15:18:11 +02:00
|
|
|
<?php
|
|
|
|
if (in_array($attribute['type'], $typesWithData)) {
|
|
|
|
if (!empty($attribute['data'])) {
|
|
|
|
echo "<input class='AttributeData' type='hidden' value='" . h($attribute['data']) . "'/>";
|
|
|
|
}
|
|
|
|
if (!empty($attribute['encrypt'])) {
|
|
|
|
echo "<input class='AttributeEncrypt' type='hidden' value='" . h($attribute['encrypt']) . "'/>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2019-12-16 16:22:28 +01:00
|
|
|
<td class="AttributeUuid short hidden"><?php echo h($attribute['uuid']); ?></td>
|
2019-06-14 18:16:09 +02:00
|
|
|
<td style="max-width:150px;width:10px;">
|
|
|
|
<?php if (!empty($attribute['Tag'])) { ?>
|
|
|
|
<span class="attributeTagContainer">
|
|
|
|
<?php
|
|
|
|
foreach ($attribute['Tag'] as $tag) {
|
|
|
|
$tagText = explode('=', $tag['name']);
|
|
|
|
$tagText = trim(end($tagText), "\"");
|
|
|
|
$color = !empty($tag['colour']) ? $tag['colour'] : '#0088cc';
|
|
|
|
?>
|
|
|
|
<span style="display:inline-block;">
|
|
|
|
<span style="padding:1px;display:flex;white-space:nowrap;margin-right:2px;word-wrap:break-word;">
|
|
|
|
<span class="attributeTag" style="display:inline-block;background-color:<?php echo h($color); ?>;color:white;" title="<?php echo h($tag['name']); ?>">
|
|
|
|
<?php echo h($tagText); ?>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<?php } ?>
|
|
|
|
</span>
|
|
|
|
<?php } ?>
|
|
|
|
</td>
|
2019-03-21 17:40:48 +01:00
|
|
|
<td class="short" style="width:40px;text-align:center;">
|
2019-04-03 22:54:09 +02:00
|
|
|
<input type="checkbox" class="AttributeToIds" <?php if (isset($attribute['to_ids']) && $attribute['to_ids']) echo 'checked'; ?>/>
|
|
|
|
</td>
|
|
|
|
<td class="short" style="width:40px;text-align:center;">
|
|
|
|
<input type="checkbox" class="AttributeDisableCorrelation" <?php if (isset($attribute['disable_correlation']) && $attribute['disable_correlation']) echo 'checked'; ?>/>
|
2019-03-21 17:40:48 +01:00
|
|
|
</td>
|
|
|
|
<td class="short">
|
2019-04-16 14:26:18 +02:00
|
|
|
<input type="text" class="AttributeComment" style="padding:0px;height:20px;margin-bottom:0px;" placeholder="<?php echo h($importComment); ?>" <?php if (!empty($attribute['comment'])) echo 'value="' . h($attribute['comment']) . '"';?>/>
|
2019-03-21 17:40:48 +01:00
|
|
|
</td>
|
|
|
|
<td class="short" style="width:40px;text-align:center;">
|
2019-04-03 22:54:09 +02:00
|
|
|
<select class='AttributeDistribution' style='padding:0px;height:20px;margin-bottom:0px;'>
|
2019-03-21 17:40:48 +01:00
|
|
|
<?php
|
2019-04-02 22:27:33 +02:00
|
|
|
foreach ($distributions as $distKey => $distValue) {
|
2019-04-04 14:21:10 +02:00
|
|
|
echo '<option value="' . h($distKey) . '" ' . ($distKey == $attribute['distribution'] ? 'selected="selected"' : '') . '>' . h($distValue) . '</option>';
|
2019-04-02 22:27:33 +02:00
|
|
|
}
|
2019-03-21 17:40:48 +01:00
|
|
|
?>
|
|
|
|
</select>
|
2019-03-26 10:05:15 +01:00
|
|
|
<div style="display:none;">
|
2019-04-03 22:54:09 +02:00
|
|
|
<select class='AttributeSharingGroup' style='padding:0px;height:20px;margin-top:3px;margin-bottom:0px;'>
|
2019-03-25 17:06:58 +01:00
|
|
|
<?php
|
2019-04-02 22:27:33 +02:00
|
|
|
foreach ($sgs as $sgKey => $sgValue) {
|
2019-04-04 14:21:10 +02:00
|
|
|
echo '<option value="' . h($sgKey) . '" ' . ($sgKey == $attribute['sharing_group_id'] ? 'selected="selected"' : '') . '>' . h($sgValue) . '</option>';
|
2019-04-02 22:27:33 +02:00
|
|
|
}
|
2019-03-25 17:06:58 +01:00
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</div>
|
2019-03-21 17:40:48 +01:00
|
|
|
</td>
|
2019-04-30 10:02:00 +02:00
|
|
|
<?php
|
2019-04-02 22:27:33 +02:00
|
|
|
echo '</tr>';
|
2019-03-20 11:31:09 +01:00
|
|
|
}
|
2019-04-30 10:02:00 +02:00
|
|
|
}
|
|
|
|
?>
|
2019-04-29 17:11:37 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-10-17 16:01:33 +02:00
|
|
|
|
|
|
|
<button class="btn btn-primary" style="float:left;" onClick="moduleResultsSubmit('<?php echo h($event_id); ?>');"><?php echo __('Submit'); ?></button>
|
|
|
|
<a href="<?php echo $baseurl . '/events/view/' . h($event['Event']['id']); ?>" style="margin-left:10px;" class="btn btn-inverse"><?php echo __('Cancel');?></a>
|
2019-03-20 11:31:09 +01:00
|
|
|
</div>
|
2019-03-25 17:06:58 +01:00
|
|
|
<script type="text/javascript">
|
2020-10-17 16:01:33 +02:00
|
|
|
$(function() {
|
|
|
|
$('.AttributeDistribution, .ObjectDistribution').change(function() {
|
2019-03-29 18:31:27 +01:00
|
|
|
if ($(this).val() == 4) {
|
|
|
|
$(this).next().show();
|
|
|
|
} else {
|
|
|
|
$(this).next().hide();
|
|
|
|
}
|
2020-10-17 16:01:33 +02:00
|
|
|
}).change();
|
2019-03-25 17:06:58 +01:00
|
|
|
});
|
|
|
|
</script>
|
2019-04-04 14:51:13 +02:00
|
|
|
<?php
|
2020-10-17 16:01:33 +02:00
|
|
|
if (!isset($menuItem)) {
|
|
|
|
$menuItem = 'freetextResults';
|
|
|
|
}
|
|
|
|
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event', 'menuItem' => $menuItem));
|