Fix bugs with SLA item reports

This commit is contained in:
Jose Gonzalez 2021-04-06 15:25:43 +02:00
parent 247343c0b6
commit 2a7aa8c1e5
2 changed files with 21 additions and 10 deletions

View File

@ -3335,6 +3335,7 @@ function print_SLA_list($width, $action, $idItem=null)
$params['javascript_is_function_select'] = true;
$params['selectbox_id'] = 'id_agent_module_sla';
$params['add_none_module'] = false;
$params['check_only_empty_javascript_on_blur_function'] = true;
if ($meta) {
$params['use_input_id_server'] = true;
$params['input_id_server_id'] = 'hidden-id_server';
@ -4733,8 +4734,10 @@ function addSLARow() {
var serviceId = $("select#id_service>option:selected").val();
var serviceName = $("select#id_service>option:selected").text();
if (((idAgent != '') && (slaMin != '') && (slaMax != '')
&& (slaLimit != '')) || serviceId != '') {
if ((((idAgent != '') && (idAgent > 0))
&& ((idModule != '') && (idModule > 0)))
|| serviceId != null)
{
if (nameAgent != '') {
//Truncate nameAgent
var params = [];

View File

@ -5451,15 +5451,23 @@ function ui_print_agent_autocomplete_input($parameters)
return;
}
if ('.((int) $check_only_empty_javascript_on_blur_function).') {
return
}
if (select_item_click) {
select_item_click = 0;
$("#'.$input_id.'")
.css("background",
"url(\"'.$icon_image.'\") right center no-repeat");
return;
}
} else {
// Clear selectbox if item is not selected.
$("#'.$selectbox_id.'").empty();
$("#'.$selectbox_id.'").append($("<option value=0>'.__('Select an Agent first').'</option>"));
$("#'.$selectbox_id.'").attr("disabled", "disabled");
// Not allow continue on blur .
if ('.((int) $check_only_empty_javascript_on_blur_function).') {
return
}
}
//Set loading
$("#'.$input_id.'")
.css("background",
@ -5533,7 +5541,7 @@ function ui_print_agent_autocomplete_input($parameters)
if ('.((int) !empty($javascript_function_action_after_select_js_call)).') {
'.$javascript_function_action_after_select_js_call.'
}
//Set icon
$("#'.$input_id.'")
.css("background",