Merge branch 'ent-6201-10495-macro-en-event-response-no-funciona' into 'develop'

Ent 6201 10495 macro en event response no funciona

See merge request artica/pandorafms!3403
This commit is contained in:
Daniel Rodriguez 2020-08-14 11:47:11 +02:00
commit 4ada69a804
2 changed files with 16 additions and 2 deletions

View File

@ -937,11 +937,16 @@ if ($perform_event_response) {
return;
}
$target = get_parameter('target', '');
$response_id = get_parameter('response_id');
$event_id = (int) get_parameter('event_id');
$server_id = (int) get_parameter('server_id', 0);
$command = events_get_response_target($event_id, $response_id, $server_id);
if (empty($target)) {
$command = events_get_response_target($event_id, $response_id, $server_id);
} else {
$command = $target;
}
$event_response = db_get_row('tevent_response', 'id', $response_id);

View File

@ -363,8 +363,17 @@ function get_response_target(
if (response_params.length > 1 || response_params[0] != "") {
for (var i = 0; i < response_params.length; i++) {
if (!response_command) {
var response_param = "_" + response_params[i] + "_";
if (
response_params[i].startsWith("_") &&
response_params[i].endsWith("_")
) {
response_param = response_params[i];
}
target = target.replace(
"_" + response_params[i] + "_",
response_param,
$("#" + response_params[i]).val()
);
} else {