Merge branch 'ent-10074-content-type-cannot-be-modified-on-snmp-alert-with-email-action' into 'develop'

Ent 10074 content type cannot be modified on snmp alert with email action

See merge request artica/pandorafms!5362
This commit is contained in:
Diego Muñoz-Reja 2023-01-04 16:06:16 +00:00
commit 14e703d1c3
2 changed files with 10 additions and 4 deletions

View File

@ -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,
'',
'',

View File

@ -1599,6 +1599,10 @@ $(document).ready (function () {
name: "get_recovery_fields",
value: "0"
});
values.push({
name: "content_type",
value: "<?php echo $al_field4; ?>"
})
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
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();
}
}