mirror of https://github.com/MISP/MISP
fix: Fixed a bug that didn't correctly handle validation errors on the attribute add popup, fixes #1875
parent
76c0cb4e52
commit
2ade58ce63
|
@ -109,13 +109,14 @@
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var fieldsArray = new Array('AttributeCategory', 'AttributeType', 'AttributeValue', 'AttributeDistribution', 'AttributeComment', 'AttributeToIds', 'AttributeBatchImport', 'AttributeSharingGroupId');
|
||||||
<?php
|
<?php
|
||||||
$formInfoTypes = array('distribution' => 'Distribution', 'category' => 'Category', 'type' => 'Type');
|
$formInfoTypes = array('distribution' => 'Distribution', 'category' => 'Category', 'type' => 'Type');
|
||||||
echo 'var formInfoFields = ' . json_encode($formInfoTypes) . PHP_EOL;
|
echo 'var formInfoFields = ' . json_encode($formInfoTypes) . PHP_EOL;
|
||||||
foreach ($formInfoTypes as $formInfoType => $humanisedName) {
|
foreach ($formInfoTypes as $formInfoType => $humanisedName) {
|
||||||
echo 'var ' . $formInfoType . 'FormInfoValues = {' . PHP_EOL;
|
echo 'var ' . $formInfoType . 'FormInfoValues = {' . PHP_EOL;
|
||||||
foreach ($info[$formInfoType] as $key => $formInfoData) {
|
foreach ($info[$formInfoType] as $key => $formInfoData) {
|
||||||
echo '"' . $key . '": "<span class=\"blue bold\">' . h($formInfoData['key']) . '</span>: ' . h($formInfoData['desc']) . '<br />",' . PHP_EOL;
|
echo '"' . $key . '": "<span class=\"blue bold\">' . h($formInfoData['key']) . '</span>: ' . h($formInfoData['desc']) . '<br />",' . PHP_EOL;
|
||||||
}
|
}
|
||||||
echo '}' . PHP_EOL;
|
echo '}' . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
@ -157,11 +158,10 @@ $(document).ready(function() {
|
||||||
$('#SGContainer').hide();
|
$('#SGContainer').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#AttributeCategory, #AttributeType, #AttributeDistribution").change(function() {
|
$("#AttributeCategory, #AttributeType, #AttributeDistribution").change(function() {
|
||||||
initPopoverContent('Attribute');
|
initPopoverContent('Attribute');
|
||||||
});
|
});
|
||||||
|
|
||||||
<?php if ($ajax): ?>
|
<?php if ($ajax): ?>
|
||||||
$('#cancel_attribute_add').click(function() {
|
$('#cancel_attribute_add').click(function() {
|
||||||
cancelPopoverForm();
|
cancelPopoverForm();
|
||||||
|
|
|
@ -67,13 +67,14 @@
|
||||||
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'addAttribute', 'event' => $event));
|
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'addAttribute', 'event' => $event));
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var fieldsArray = new Array('AttributeCategory', 'AttributeType', 'AttributeValue', 'AttributeDistribution', 'AttributeComment', 'AttributeToIds', 'AttributeBatchImport', 'AttributeSharingGroupId');
|
||||||
<?php
|
<?php
|
||||||
$formInfoTypes = array('distribution' => 'Distribution', 'category' => 'Category', 'type' => 'Type');
|
$formInfoTypes = array('distribution' => 'Distribution', 'category' => 'Category', 'type' => 'Type');
|
||||||
echo 'var formInfoFields = ' . json_encode($formInfoTypes) . PHP_EOL;
|
echo 'var formInfoFields = ' . json_encode($formInfoTypes) . PHP_EOL;
|
||||||
foreach ($formInfoTypes as $formInfoType => $humanisedName) {
|
foreach ($formInfoTypes as $formInfoType => $humanisedName) {
|
||||||
echo 'var ' . $formInfoType . 'FormInfoValues = {' . PHP_EOL;
|
echo 'var ' . $formInfoType . 'FormInfoValues = {' . PHP_EOL;
|
||||||
foreach ($info[$formInfoType] as $key => $formInfoData) {
|
foreach ($info[$formInfoType] as $key => $formInfoData) {
|
||||||
echo '"' . $key . '": "<span class=\"blue bold\">' . h($formInfoData['key']) . '</span>: ' . h($formInfoData['desc']) . '<br />",' . PHP_EOL;
|
echo '"' . $key . '": "<span class=\"blue bold\">' . h($formInfoData['key']) . '</span>: ' . h($formInfoData['desc']) . '<br />",' . PHP_EOL;
|
||||||
}
|
}
|
||||||
echo '}' . PHP_EOL;
|
echo '}' . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +102,7 @@ $(document).ready(function() {
|
||||||
if ($('#AttributeDistribution').val() == 4) $('#SGContainer').show();
|
if ($('#AttributeDistribution').val() == 4) $('#SGContainer').show();
|
||||||
else $('#SGContainer').hide();
|
else $('#SGContainer').hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#AttributeCategory").on('change', function(e) {
|
$("#AttributeCategory").on('change', function(e) {
|
||||||
formCategoryChanged('Attribute');
|
formCategoryChanged('Attribute');
|
||||||
if ($(this).val() === 'Attribution' || $(this).val() === 'Targeting data') {
|
if ($(this).val() === 'Attribution' || $(this).val() === 'Targeting data') {
|
||||||
|
@ -114,7 +115,7 @@ $(document).ready(function() {
|
||||||
$('#SGContainer').hide();
|
$('#SGContainer').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#AttributeCategory, #AttributeType, #AttributeDistribution").change(function() {
|
$("#AttributeCategory, #AttributeType, #AttributeDistribution").change(function() {
|
||||||
initPopoverContent('Attribute');
|
initPopoverContent('Attribute');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue