#11964 Fix snmp alerts editor

This commit is contained in:
miguel angel rasteu 2023-08-30 11:57:40 +02:00
parent d006028ce9
commit 6305d13a86
2 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,7 @@ if (is_ajax()) {
if (!empty($field_description)) {
// If the value is 5, this because severity in snmp alerts is not permit to show.
if (($i > 5) && ($command['id'] == 3)) {
if (($i > 5) && ($command['id'] === 3)) {
$fdesc = $field_description.' <br><span class="normal xx-small">'.sprintf(
__('Field %s'),
($i - 1)
@ -118,7 +118,7 @@ if (is_ajax()) {
}
} else {
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it.
if (($i > 5) && ($command['id'] == 3)) {
if (($i > 5) && ($command['id'] === 3)) {
if (substr_count($command['command'], '_field'.($i - 1).'_') > 0) {
$fdesc = sprintf(__('Field %s'), ($i - 1));
} else {

View File

@ -2312,7 +2312,7 @@ $(document).ready (function () {
// The row provided has a predefined class. We delete it.
$('#table_macros-field' + i)
.removeAttr('class');
if(old_value && i != 4){
if(old_value){
$("[name=field" + i + "_value]").val(old_value).trigger('change');
}
$('#table_macros-field').show();