From 707763f5e29569a0dad970e949480bc61098f581 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 29 Dec 2022 14:55:30 +0100 Subject: [PATCH] #10074 snmp alert edit content_type --- pandora_console/godmode/alerts/alert_commands.php | 5 +++-- pandora_console/godmode/snmpconsole/snmp_alert.php | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index 121828de32..24d07a392f 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -40,6 +40,7 @@ $update_command = (bool) get_parameter('update_command'); $create_command = (bool) get_parameter('create_command'); $delete_command = (bool) get_parameter('delete_command'); $copy_command = (bool) get_parameter('copy_command'); +$content_type = (string) get_parameter('content_type', 'text/plain'); $url = 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands'; @@ -226,7 +227,7 @@ if (is_ajax()) { 'field'.$i.'_value', 'text/plain', '', - '', + $content_type == 'text/plain', $is_management_allowed, '', '', @@ -238,7 +239,7 @@ if (is_ajax()) { 'field'.$i.'_value', 'text/html', '', - 'text/html', + $content_type == 'text/html', $is_management_allowed, '', '', diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index 35fcaf172c..6ac7252512 100755 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -1599,6 +1599,10 @@ $(document).ready (function () { name: "get_recovery_fields", value: "0" }); + values.push({ + name: "content_type", + value: "" + }) jQuery.post (, values, function (data, status) { @@ -1624,8 +1628,9 @@ $(document).ready (function () { // The row provided has a predefined class. We delete it. $('#table_macros-field' + i) .removeAttr('class'); - - $("[name=field" + i + "_value]").val(old_value).trigger('change'); + if(old_value && i != 4){ + $("[name=field" + i + "_value]").val(old_value).trigger('change'); + } $('#table_macros-field').show(); } }