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
pandora_console
|
@ -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_agent_sla" name="id_agent_sla" value="" type="hidden">
|
||||||
<input id="hidden-id_server" name="id_server" value="" type="hidden">
|
<input id="hidden-id_server" name="id_server" value="" type="hidden">
|
||||||
<?php
|
<?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 = [];
|
||||||
$params['show_helptip'] = true;
|
$params['show_helptip'] = true;
|
||||||
$params['input_name'] = 'agent_sla';
|
$params['input_name'] = 'agent_sla';
|
||||||
|
@ -3335,6 +3338,8 @@ function print_SLA_list($width, $action, $idItem=null)
|
||||||
$params['javascript_is_function_select'] = true;
|
$params['javascript_is_function_select'] = true;
|
||||||
$params['selectbox_id'] = 'id_agent_module_sla';
|
$params['selectbox_id'] = 'id_agent_module_sla';
|
||||||
$params['add_none_module'] = false;
|
$params['add_none_module'] = false;
|
||||||
|
$params['check_only_empty_javascript_on_blur_function'] = true;
|
||||||
|
$params['icon_image'] = $autocompleteImage;
|
||||||
if ($meta) {
|
if ($meta) {
|
||||||
$params['use_input_id_server'] = true;
|
$params['use_input_id_server'] = true;
|
||||||
$params['input_id_server_id'] = 'hidden-id_server';
|
$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['javascript_is_function_select'] = true;
|
||||||
$params['selectbox_id'] = 'id_agent_module_failover';
|
$params['selectbox_id'] = 'id_agent_module_failover';
|
||||||
$params['add_none_module'] = false;
|
$params['add_none_module'] = false;
|
||||||
|
$params['icon_image'] = $autocompleteImage;
|
||||||
if ($meta) {
|
if ($meta) {
|
||||||
$params['use_input_id_server'] = true;
|
$params['use_input_id_server'] = true;
|
||||||
$params['input_id_server_id'] = 'hidden-id_server';
|
$params['input_id_server_id'] = 'hidden-id_server';
|
||||||
|
@ -4734,8 +4740,10 @@ function addSLARow() {
|
||||||
var serviceId = $("select#id_service>option:selected").val();
|
var serviceId = $("select#id_service>option:selected").val();
|
||||||
var serviceName = $("select#id_service>option:selected").text();
|
var serviceName = $("select#id_service>option:selected").text();
|
||||||
|
|
||||||
if (((idAgent != '') && (slaMin != '') && (slaMax != '')
|
if ((((idAgent != '') && (idAgent > 0))
|
||||||
&& (slaLimit != '')) || serviceId != '') {
|
&& ((idModule != '') && (idModule > 0)))
|
||||||
|
|| serviceId != null)
|
||||||
|
{
|
||||||
if (nameAgent != '') {
|
if (nameAgent != '') {
|
||||||
//Truncate nameAgent
|
//Truncate nameAgent
|
||||||
var params = [];
|
var params = [];
|
||||||
|
@ -4892,6 +4900,7 @@ function addSLARow() {
|
||||||
$("input[name=id_agent_failover]").val('');
|
$("input[name=id_agent_failover]").val('');
|
||||||
$("input[name=id_server]").val('');
|
$("input[name=id_server]").val('');
|
||||||
$("input[name=agent_sla]").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('');
|
$("input[name=agent_failover]").val('');
|
||||||
$("#id_agent_module_sla").empty();
|
$("#id_agent_module_sla").empty();
|
||||||
$("#id_agent_module_sla").attr('disabled', 'true');
|
$("#id_agent_module_sla").attr('disabled', 'true');
|
||||||
|
|
|
@ -5178,6 +5178,11 @@ function ui_print_agent_autocomplete_input($parameters)
|
||||||
$javascript_function_change = '';
|
$javascript_function_change = '';
|
||||||
// Default value.
|
// Default value.
|
||||||
$javascript_function_change .= '
|
$javascript_function_change .= '
|
||||||
|
function setInputBackground(inputId, image) {
|
||||||
|
$("#"+inputId)
|
||||||
|
.css("background","url(\'"+image+"\') right center no-repeat");
|
||||||
|
}
|
||||||
|
|
||||||
function set_functions_change_autocomplete_'.$input_name.'() {
|
function set_functions_change_autocomplete_'.$input_name.'() {
|
||||||
var cache_'.$input_name.' = {};
|
var cache_'.$input_name.' = {};
|
||||||
|
|
||||||
|
@ -5192,10 +5197,9 @@ function ui_print_agent_autocomplete_input($parameters)
|
||||||
if (cache_'.$input_name.'[groupId] == null) {
|
if (cache_'.$input_name.'[groupId] == null) {
|
||||||
cache_'.$input_name.'[groupId] = {};
|
cache_'.$input_name.'[groupId] = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set loading
|
//Set loading
|
||||||
$("#'.$input_id.'")
|
setInputBackground("'.$input_id.'", "'.$spinner_image.'");
|
||||||
.css("background","url(\"'.$spinner_image.'\") right center no-repeat");
|
|
||||||
|
|
||||||
//Function to call when the source
|
//Function to call when the source
|
||||||
if ('.((int) !empty($javascript_function_action_into_source_js_call)).') {
|
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]);
|
response(cache_'.$input_name.'[groupId][term]);
|
||||||
|
|
||||||
//Set icon
|
//Set icon
|
||||||
$("#'.$input_id.'")
|
setInputBackground("'.$input_id.'", "'.$icon_image.'");
|
||||||
.css("background","url(\"'.$icon_image.'\") right center no-repeat '.$icon_image.'");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -5228,7 +5231,9 @@ function ui_print_agent_autocomplete_input($parameters)
|
||||||
response(cache_'.$input_name.'[groupId][oldterm]);
|
response(cache_'.$input_name.'[groupId][oldterm]);
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
|
//Set icon
|
||||||
|
setInputBackground("'.$input_id.'", "'.$icon_image.'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -5244,8 +5249,7 @@ function ui_print_agent_autocomplete_input($parameters)
|
||||||
|
|
||||||
if (found) {
|
if (found) {
|
||||||
//Set icon
|
//Set icon
|
||||||
$("#'.$input_id.'")
|
setInputBackground("'.$input_id.'", "'.$icon_image.'");
|
||||||
.css("background","url(\"'.$icon_image.'\") right center no-repeat");
|
|
||||||
|
|
||||||
select_item_click = 0;
|
select_item_click = 0;
|
||||||
|
|
||||||
|
@ -5263,16 +5267,13 @@ function ui_print_agent_autocomplete_input($parameters)
|
||||||
response(data);
|
response(data);
|
||||||
|
|
||||||
//Set icon
|
//Set icon
|
||||||
$("#'.$input_id.'")
|
setInputBackground("'.$input_id.'", "'.$icon_image.'");
|
||||||
.css("background",
|
select_item_click = 0;
|
||||||
"url(\"'.$icon_image.'\") right center no-repeat");
|
|
||||||
|
|
||||||
select_item_click = 0;
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
//---END source-----------------------------------------
|
//---END source-----------------------------------------
|
||||||
|
@ -5451,15 +5452,23 @@ function ui_print_agent_autocomplete_input($parameters)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('.((int) $check_only_empty_javascript_on_blur_function).') {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (select_item_click) {
|
if (select_item_click) {
|
||||||
|
select_item_click = 0;
|
||||||
|
$("#'.$input_id.'")
|
||||||
|
.css("background",
|
||||||
|
"url(\"'.$icon_image.'\") right center no-repeat");
|
||||||
return;
|
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
|
//Set loading
|
||||||
$("#'.$input_id.'")
|
$("#'.$input_id.'")
|
||||||
.css("background",
|
.css("background",
|
||||||
|
@ -5533,7 +5542,7 @@ function ui_print_agent_autocomplete_input($parameters)
|
||||||
if ('.((int) !empty($javascript_function_action_after_select_js_call)).') {
|
if ('.((int) !empty($javascript_function_action_after_select_js_call)).') {
|
||||||
'.$javascript_function_action_after_select_js_call.'
|
'.$javascript_function_action_after_select_js_call.'
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set icon
|
//Set icon
|
||||||
$("#'.$input_id.'")
|
$("#'.$input_id.'")
|
||||||
.css("background",
|
.css("background",
|
||||||
|
|
Loading…
Reference in New Issue