fix parameter macros in event responses
This commit is contained in:
parent
a60715a985
commit
90ea61f753
|
@ -937,11 +937,16 @@ if ($perform_event_response) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$target = get_parameter('target', '');
|
||||||
$response_id = get_parameter('response_id');
|
$response_id = get_parameter('response_id');
|
||||||
$event_id = (int) get_parameter('event_id');
|
$event_id = (int) get_parameter('event_id');
|
||||||
$server_id = (int) get_parameter('server_id', 0);
|
$server_id = (int) get_parameter('server_id', 0);
|
||||||
|
|
||||||
|
if (empty($target)) {
|
||||||
$command = events_get_response_target($event_id, $response_id, $server_id);
|
$command = events_get_response_target($event_id, $response_id, $server_id);
|
||||||
|
} else {
|
||||||
|
$command = $target;
|
||||||
|
}
|
||||||
|
|
||||||
$event_response = db_get_row('tevent_response', 'id', $response_id);
|
$event_response = db_get_row('tevent_response', 'id', $response_id);
|
||||||
|
|
||||||
|
|
|
@ -363,8 +363,17 @@ function get_response_target(
|
||||||
if (response_params.length > 1 || response_params[0] != "") {
|
if (response_params.length > 1 || response_params[0] != "") {
|
||||||
for (var i = 0; i < response_params.length; i++) {
|
for (var i = 0; i < response_params.length; i++) {
|
||||||
if (!response_command) {
|
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(
|
target = target.replace(
|
||||||
"_" + response_params[i] + "_",
|
response_param,
|
||||||
$("#" + response_params[i]).val()
|
$("#" + response_params[i]).val()
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue