Merge branch 'ent-7258-spinner-infinito-agentes-report-sla-items' into 'develop'
Fix bugs with SLA item reports Closes pandora_enterprise#7258 See merge request artica/pandorafms!4000
This commit is contained in:
commit
3d8f0b58d6
|
@ -3326,6 +3326,9 @@ function print_SLA_list($width, $action, $idItem=null)
|
|||
<input id="hidden-id_agent_sla" name="id_agent_sla" value="" type="hidden">
|
||||
<input id="hidden-id_server" name="id_server" value="" type="hidden">
|
||||
<?php
|
||||
// Set autocomplete image.
|
||||
$autocompleteImage = html_print_image(($config['style'] === 'pandora_black') ? 'images/agent_mc.menu.png' : 'images/search_agent.png', true, false, true);
|
||||
// Params for agent autocomplete input.
|
||||
$params = [];
|
||||
$params['show_helptip'] = true;
|
||||
$params['input_name'] = 'agent_sla';
|
||||
|
@ -3335,6 +3338,8 @@ 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;
|
||||
$params['icon_image'] = $autocompleteImage;
|
||||
if ($meta) {
|
||||
$params['use_input_id_server'] = true;
|
||||
$params['input_id_server_id'] = 'hidden-id_server';
|
||||
|
@ -3370,6 +3375,7 @@ function print_SLA_list($width, $action, $idItem=null)
|
|||
$params['javascript_is_function_select'] = true;
|
||||
$params['selectbox_id'] = 'id_agent_module_failover';
|
||||
$params['add_none_module'] = false;
|
||||
$params['icon_image'] = $autocompleteImage;
|
||||
if ($meta) {
|
||||
$params['use_input_id_server'] = true;
|
||||
$params['input_id_server_id'] = 'hidden-id_server';
|
||||
|
@ -4734,8 +4740,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 = [];
|
||||
|
@ -4892,6 +4900,7 @@ function addSLARow() {
|
|||
$("input[name=id_agent_failover]").val('');
|
||||
$("input[name=id_server]").val('');
|
||||
$("input[name=agent_sla]").val('');
|
||||
$("input[name=agent_sla]").css("background","url('<?php echo $autocompleteImage; ?>') right center no-repeat")
|
||||
$("input[name=agent_failover]").val('');
|
||||
$("#id_agent_module_sla").empty();
|
||||
$("#id_agent_module_sla").attr('disabled', 'true');
|
||||
|
|
|
@ -5178,6 +5178,11 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||
$javascript_function_change = '';
|
||||
// Default value.
|
||||
$javascript_function_change .= '
|
||||
function setInputBackground(inputId, image) {
|
||||
$("#"+inputId)
|
||||
.css("background","url(\'"+image+"\') right center no-repeat");
|
||||
}
|
||||
|
||||
function set_functions_change_autocomplete_'.$input_name.'() {
|
||||
var cache_'.$input_name.' = {};
|
||||
|
||||
|
@ -5192,10 +5197,9 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||
if (cache_'.$input_name.'[groupId] == null) {
|
||||
cache_'.$input_name.'[groupId] = {};
|
||||
}
|
||||
|
||||
|
||||
//Set loading
|
||||
$("#'.$input_id.'")
|
||||
.css("background","url(\"'.$spinner_image.'\") right center no-repeat");
|
||||
setInputBackground("'.$input_id.'", "'.$spinner_image.'");
|
||||
|
||||
//Function to call when the source
|
||||
if ('.((int) !empty($javascript_function_action_into_source_js_call)).') {
|
||||
|
@ -5209,8 +5213,7 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||
response(cache_'.$input_name.'[groupId][term]);
|
||||
|
||||
//Set icon
|
||||
$("#'.$input_id.'")
|
||||
.css("background","url(\"'.$icon_image.'\") right center no-repeat '.$icon_image.'");
|
||||
setInputBackground("'.$input_id.'", "'.$icon_image.'");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
@ -5228,7 +5231,9 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||
response(cache_'.$input_name.'[groupId][oldterm]);
|
||||
|
||||
found = true;
|
||||
|
||||
|
||||
//Set icon
|
||||
setInputBackground("'.$input_id.'", "'.$icon_image.'");
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
@ -5244,8 +5249,7 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||
|
||||
if (found) {
|
||||
//Set icon
|
||||
$("#'.$input_id.'")
|
||||
.css("background","url(\"'.$icon_image.'\") right center no-repeat");
|
||||
setInputBackground("'.$input_id.'", "'.$icon_image.'");
|
||||
|
||||
select_item_click = 0;
|
||||
|
||||
|
@ -5263,16 +5267,13 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||
response(data);
|
||||
|
||||
//Set icon
|
||||
$("#'.$input_id.'")
|
||||
.css("background",
|
||||
"url(\"'.$icon_image.'\") right center no-repeat");
|
||||
|
||||
select_item_click = 0;
|
||||
setInputBackground("'.$input_id.'", "'.$icon_image.'");
|
||||
select_item_click = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return;
|
||||
},
|
||||
//---END source-----------------------------------------
|
||||
|
@ -5451,15 +5452,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 +5542,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",
|
||||
|
|
Loading…
Reference in New Issue