Added favourite services configuration tokens

This commit is contained in:
fermin831 2018-09-19 16:56:58 +02:00
parent 8979890964
commit e318d9539c
2 changed files with 38 additions and 8 deletions

View File

@ -741,8 +741,8 @@ $table_vc->style[0] = 'font-weight: bold';
$table_vc->size[0] = '50%';
$table_vc->data = array ();
$vc_favourite_view_array[0] = 'Classic view';
$vc_favourite_view_array[1] = 'View of favorites';
$vc_favourite_view_array[0] = __('Classic view');
$vc_favourite_view_array[1] = __('View of favorites');
$table_vc->data[$row][0] = __('Type of view of visual consoles') .
ui_print_help_tip(__('Allows you to directly display the list of favorite visual consoles'), true);
$table_vc->data[$row][1] = html_print_select($vc_favourite_view_array, 'vc_favourite_view', $config["vc_favourite_view"], '', '', 0, true);
@ -750,7 +750,6 @@ $row++;
$table_vc->data[$row][0] = __('Number of favorite visual consoles to show in the menu') .
ui_print_help_tip(__('If the number is 0 it will not show the pull-down menu and maximum 25 favorite consoles'), true);
//$table_vc->data[$row][1] = html_print_input_text ('vc_menu_items', $config["vc_menu_items"], '', 5, 5, true);
$table_vc->data[$row][1] = "<input type ='number' value=".$config["vc_menu_items"]." size='5' name='vc_menu_items' min='0' max='25'>";
$row++;
@ -763,8 +762,26 @@ $table_vc->data[$row][1] = html_print_input_text ('vc_line_thickness', $config["
echo "<fieldset>";
echo "<legend>" . __('Visual consoles configuration') . "</legend>";
html_print_table ($table_vc);
echo "</fieldset>";
echo "</fieldset>";
//----------------------------------------------------------------------
// Services
//----------------------------------------------------------------------
$table_ser = new stdClass();
$table_ser->width = '100%';
$table_ser->class = "databox filters";
$table_ser->style[0] = 'font-weight: bold';
$table_ser->size[0] = '50%';
$table_ser->data = array ();
$table_ser->data['number'][0] = __('Number of favorite services to show in the menu') .
ui_print_help_tip(__('If the number is 0 it will not show the pull-down menu and maximum 25 favorite services'), true);
$table_ser->data['number'][1] = "<input type ='number' value=".$config["ser_menu_items"]." size='5' name='ser_menu_items' min='0' max='25'>";
echo "<fieldset>";
echo "<legend>" . __('Services configuration') . "</legend>";
html_print_table ($table_ser);
echo "</fieldset>";
//----------------------------------------------------------------------
// OTHER CONFIGURATION

View File

@ -530,7 +530,7 @@ function config_update_config () {
$error_update[] = __('Product name');
if (!config_update_value ('rb_copyright_notice', (string) get_parameter ('rb_copyright_notice')))
$error_update[] = __('Copyright notice');
if (!config_update_value ('meta_custom_logo', (string) get_parameter ('meta_custom_logo')))
$error_update[] = __('Custom logo metaconsole');
if (!config_update_value ('meta_custom_logo_white_bg', (string) get_parameter ('meta_custom_logo_white_bg')))
@ -545,7 +545,7 @@ function config_update_config () {
$error_update[] = __('Custom title2 login metaconsole');
if (!config_update_value ('meta_login_background', (string) get_parameter ('meta_login_background')))
$error_update[] = __('Login background metaconsole');
if (!config_update_value ('meta_custom_docs_url', (string) get_parameter ('meta_custom_docs_url')))
$error_update[] = __('Custom Docs url');
if (!config_update_value ('meta_custom_support_url', (string) get_parameter ('meta_custom_support_url')))
@ -553,13 +553,16 @@ function config_update_config () {
if (!config_update_value ('vc_refr', get_parameter('vc_refr')))
$error_update[] = __('Default interval for refresh on Visual Console');
if (!config_update_value ('vc_favourite_view', (int) get_parameter('vc_favourite_view', 5)))
if (!config_update_value ('vc_favourite_view', (int) get_parameter('vc_favourite_view', 0)))
$error_update[] = __('Default line favourite_view for the Visual Console');
if (!config_update_value ('vc_menu_items', (int) get_parameter('vc_menu_items', 10)))
$error_update[] = __('Default line menu items for the Visual Console');
if (!config_update_value ('vc_line_thickness', (int) get_parameter('vc_line_thickness')))
$error_update[] = __('Default line thickness for the Visual Console');
if (!config_update_value ('ser_menu_items', (int) get_parameter('ser_menu_items', 10)))
$error_update[] = __('Default line menu items for the Services');
if (!config_update_value ('agent_size_text_small', get_parameter('agent_size_text_small')))
$error_update[] = __('Agent size text');
if (!config_update_value ('agent_size_text_medium', get_parameter('agent_size_text_medium')))
@ -1300,6 +1303,16 @@ function config_process_config () {
config_update_value ('meta_custom_title2_login', __('METACONSOLE'));
}
if (!isset($config['vc_favourite_view'])) {
config_update_value('vc_favourite_view', 0);
}
if (!isset($config['vc_menu_items'])) {
config_update_value('vc_menu_items', 10);
}
if (!isset($config['ser_menu_items'])) {
config_update_value('ser_menu_items', 10);
}
if (!isset ($config['history_db_enabled'])) {
config_update_value ( 'history_db_enabled', false);
}
@ -2010,7 +2023,7 @@ function config_process_config () {
if (!isset($config['ehorus_req_timeout'])) {
config_update_value('ehorus_req_timeout', 5);
}
/* Finally, check if any value was overwritten in a form */
config_update_config();
}