mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Added control for autocomplete input icon
This commit is contained in:
parent
2a7aa8c1e5
commit
0a7c960630
@ -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';
|
||||||
@ -3336,6 +3339,7 @@ function print_SLA_list($width, $action, $idItem=null)
|
|||||||
$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['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';
|
||||||
@ -3371,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';
|
||||||
@ -4894,6 +4899,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.' = {};
|
||||||
|
|
||||||
@ -5194,8 +5199,7 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//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 {
|
||||||
@ -5229,6 +5232,8 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||||||
|
|
||||||
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,15 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||||||
response(data);
|
response(data);
|
||||||
|
|
||||||
//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;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setInputBackground("'.$input_id.'", "'.$icon_image.'");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
//---END source-----------------------------------------
|
//---END source-----------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user