fix parameter macros in event responses

This commit is contained in:
alejandro-campos 2020-08-13 14:10:57 +02:00
parent a60715a985
commit 90ea61f753
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].startsWith("_")
) {
response_param = response_params[i];
}
target = target.replace(
"_" + response_params[i] + "_",
response_param,
$("#" + response_params[i]).val()
);
} else {