mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Fixed the preview alert action in the form editor. TICKET: #1944
(cherry picked from commit b7264f61c34c12f95dbfd0d67cf354740bf27a6e) Conflicts: pandora_console/godmode/alerts/alert_commands.php pandora_console/godmode/alerts/configure_alert_action.php
This commit is contained in:
parent
7883e08af5
commit
db6e59c9bb
@ -123,13 +123,13 @@ if (is_ajax ()) {
|
|||||||
if (!empty($fv)) {
|
if (!empty($fv)) {
|
||||||
foreach ($fv as $fv_option) {
|
foreach ($fv as $fv_option) {
|
||||||
$fv_option = explode(',', $fv_option);
|
$fv_option = explode(',', $fv_option);
|
||||||
|
|
||||||
if (empty($fv_option))
|
if (empty($fv_option))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!isset($fv_option[1]))
|
if (!isset($fv_option[1]))
|
||||||
$fv_option[1] = $fv_option[0];
|
$fv_option[1] = $fv_option[0];
|
||||||
|
|
||||||
$fields_value_select[$fv_option[0]] = $fv_option[1];
|
$fields_value_select[$fv_option[0]] = $fv_option[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,33 +8,44 @@ function parse_alert_command (command, classs) {
|
|||||||
classs = 'fields';
|
classs = 'fields';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var nfield = 1;
|
var nfield = 1;
|
||||||
$('.' + classs).each(function() {
|
$('.' + classs).each(function() {
|
||||||
|
|
||||||
// Only render values different from ''
|
// Only render values different from ''
|
||||||
if ($(this).val() == '') {
|
if ($(this).val() == '') {
|
||||||
|
|
||||||
nfield++;
|
nfield++;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var field = '_field' + nfield + '_';
|
var field = '_field' + nfield + '_';
|
||||||
nfield++;
|
|
||||||
var regex = new RegExp(field,"gi");
|
var regex = new RegExp(field, "gi");
|
||||||
|
|
||||||
|
|
||||||
command = command.replace (regex, $(this).val());
|
command = command.replace (regex, $(this).val());
|
||||||
|
|
||||||
|
nfield++;
|
||||||
});
|
});
|
||||||
|
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_command_preview (original_command) {
|
function render_command_preview (original_command) {
|
||||||
$("#textarea_command_preview").text (parse_alert_command (original_command, ''));
|
$("#textarea_command_preview")
|
||||||
|
.text(parse_alert_command (original_command, ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_command_recovery_preview (original_command) {
|
function render_command_recovery_preview (original_command) {
|
||||||
$("#textarea_command_recovery_preview").text (parse_alert_command (original_command, 'recovery'));
|
$("#textarea_command_recovery_preview")
|
||||||
|
.text(parse_alert_command (original_command, 'recovery'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_command_description (command_description) {
|
function render_command_description (command_description) {
|
||||||
if (command_description != '') {
|
if (command_description != '') {
|
||||||
command_description = '<br>'+command_description;
|
command_description = '<br>' + command_description;
|
||||||
}
|
}
|
||||||
$("#command_description").html(command_description);
|
$("#command_description").html(command_description);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user