diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8efb04e3bd..f90226b707 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.732-190304 +Version: 7.0NG.732-190307 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index c7557f0d52..19e8634366 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.732-190304" +pandora_version="7.0NG.732-190307" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 1c1f752bf1..dfc55dae4b 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.732'; -use constant AGENT_BUILD => '190304'; +use constant AGENT_BUILD => '190307'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index ef9ee4f7ad..3e212a7139 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.732 -%define release 190304 +%define release 190307 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index efeae74a32..8e7f60697d 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.732 -%define release 190304 +%define release 190307 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index ebb5b1dd57..3ef65442bb 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.732" -PI_BUILD="190304" +PI_BUILD="190307" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index a5487ef6d8..303d32ebe3 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190304} +{190307} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 58cda95583..1cf874d803 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.732(Build 190304)") +#define PANDORA_VERSION ("7.0NG.732(Build 190307)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 28ee13d794..e30768134c 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.732(Build 190304))" + VALUE "ProductVersion", "(7.0NG.732(Build 190307))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 255d7df8b3..db5f4731d4 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.732-190304 +Version: 7.0NG.732-190307 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 53c0254375..a6c6534ff2 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.732-190304" +pandora_version="7.0NG.732-190307" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index d8377484c3..bb4e671cda 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1900,14 +1900,16 @@ CREATE TABLE IF NOT EXISTS `tevent_extended` ( -- ----------------------------------------------------- -- Table `tgis_map_layer_groups` -- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `tgis_map_layer_groups` ( - `layer_id` INT NOT NULL, - `group_id` MEDIUMINT(4) UNSIGNED NOT NULL, - `agent_id` INT(10) UNSIGNED NOT NULL COMMENT 'Used to link the position to the group', - PRIMARY KEY (`layer_id`, `group_id`), - FOREIGN KEY (`layer_id`) REFERENCES `tgis_map_layer` (`id_tmap_layer`) ON DELETE CASCADE, - FOREIGN KEY (`group_id`) REFERENCES `tgrupo` (`id_grupo`) ON DELETE CASCADE, - FOREIGN KEY (`agent_id`) REFERENCES `tagente` (`id_agente`) ON DELETE CASCADE +CREATE TABLE `tgis_map_layer_groups` ( + `layer_id` int(11) NOT NULL, + `group_id` mediumint(4) unsigned NOT NULL, + `agent_id` int(10) unsigned NOT NULL COMMENT 'Used to link the position to the group', + PRIMARY KEY (`layer_id`,`group_id`), + KEY `group_id` (`group_id`), + KEY `agent_id` (`agent_id`), + CONSTRAINT `tgis_map_layer_groups_ibfk_1` FOREIGN KEY (`layer_id`) REFERENCES `tgis_map_layer` (`id_tmap_layer`) ON DELETE CASCADE, + CONSTRAINT `tgis_map_layer_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `tgrupo` (`id_grupo`) ON DELETE CASCADE, + CONSTRAINT `tgis_map_layer_groups_ibfk_3` FOREIGN KEY (`agent_id`) REFERENCES `tagente` (`id_agente`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- diff --git a/pandora_console/general/footer.php b/pandora_console/general/footer.php index a9a251d177..48d0613c98 100644 --- a/pandora_console/general/footer.php +++ b/pandora_console/general/footer.php @@ -1,16 +1,19 @@ '; +echo ''; require_once $config['homedir'].'/include/functions_update_manager.php'; @@ -40,9 +43,9 @@ if ($current_package == 0) { echo sprintf(__('%s %s - Build %s - MR %s', get_product_name(), $pandora_version, $build_package_version, $config['MR'])); -echo '
'; -echo ''.__('Page generated at').' '.date($config['date_format']); -echo '
® '.get_copyright_notice().''; +echo ' '; +echo ''.__('Page generated at').' '.date($config['date_format']); +echo '
® '.get_copyright_notice().''; if (isset($config['debug'])) { $cache_info = []; diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 3d7ce7dd6e..cfbf070a6a 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -1,7 +1,7 @@ - - - - - - -
- - +
+ '.notifications_print_ball( + $notifications_numbers['notifications'], + $notifications_numbers['last_id'] + ).'
'; + + + // ======= Alerts =============================================== + $check_minor_release_available = false; + $pandora_management = check_acl($config['id_user'], 0, 'PM'); + + $check_minor_release_available = db_check_minor_relase_available(); + + if ($check_minor_release_available) { + if (users_is_admin($config['id_user'])) { + if ($config['language'] == 'es') { + set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas.
'.__('Sobre actualización de revisión menor').'', 'Revisión/es menor/es disponible/s'); } else { - if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo)) { - $custom_logo = ENTERPRISE_DIR.'/'.$custom_logo; - } - - $logo_title = get_product_name().' Enterprise'; + set_pandora_error_for_header('There are one or more minor releases waiting for update. '.__('About minor release update').'', 'minor release/s available'); } - - echo html_print_image( - $custom_logo, - true, - [ - 'alt' => $logo_title, - 'border' => '0', - ] - ); - ?> - -
- id = 'header_table'; - $table->class = 'none'; - $table->cellpadding = 0; - $table->cellspacing = 0; - $table->head = []; - $table->data = []; - $table->style['clippy'] = $table->style[1] = $table->style[4] = $table->style[5] = $table->style[6] = $table->style[8] = $table->style[9] = $table->style['qr'] = $table->style['notifications'] = 'width: 22px; text-align:center; height: 22px; padding-right: 9px;padding-left: 9px;'; - $table->style[7] = 'width: 20px; padding-right: 9px;'; - $table->style['searchbar'] = 'width: 180px; min-width: 180px;'; - $table->style[11] = 'padding-left: 10px; padding-right: 5px;width: 16px;'; - $table->width = '100%'; - $table->styleTable = 'margin: auto; margin-top: 0px;'; - $table->rowclass[0] = ''; - - $acl_head_search = true; - if ($config['acl_enterprise'] == 1 && !users_is_admin()) { - $acl_head_search = db_get_sql( - "SELECT sec FROM tusuario - INNER JOIN tusuario_perfil ON tusuario.id_user = tusuario_perfil.id_usuario - INNER JOIN tprofile_view ON tprofile_view.id_profile = tusuario_perfil.id_perfil - WHERE tusuario.id_user = '".$config['id_user']."' AND (sec = '*' OR sec = 'head_search')" - ); } + } - if ($acl_head_search) { - $table->data[0][11] = ui_print_help_tip(__('Blank characters are used as AND conditions'), true); - // Search bar - $search_bar = '
'; - if (!isset($config['search_keywords'])) { + // Chat messages + $header_chat = "'; + + + // Search + $acl_head_search = true; + if ($config['acl_enterprise'] == 1 && !users_is_admin()) { + $acl_head_search = db_get_sql( + "SELECT sec FROM tusuario + INNER JOIN tusuario_perfil ON tusuario.id_user = tusuario_perfil.id_usuario + INNER JOIN tprofile_view ON tprofile_view.id_profile = tusuario_perfil.id_perfil + WHERE tusuario.id_user = '".$config['id_user']."' AND (sec = '*' OR sec = 'head_search')" + ); + } + + if ($acl_head_search) { + // Search bar + $search_bar = ''; + if (!isset($config['search_keywords'])) { + $search_bar .= ''; + } else { + if (strlen($config['search_keywords']) == 0) { $search_bar .= ''; } else { - if (strlen($config['search_keywords']) == 0) { - $search_bar .= ''; - } else { - $search_bar .= ''; - } + $search_bar .= ''; } - - $search_bar .= ''; - - // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; - $search_bar .= ""; - $search_bar .= '
'; - - $table->data[0]['searchbar'] = $search_bar; } - if ($config['show_qr_code_header'] == 0) { - $show_qr_code_header = 'display: none;'; + $search_bar .= 'data[0]['qr'] = ''; + $search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" + onkeyup="javascript: fieldKeyWordEmpty = false;" + style="margin-top:5px;" class="search_input" />'; - echo "'; - ?> - - data[0]['clippy'] = ''.html_print_image( - 'images/clippy_icon.png', - true, - [ - 'id' => 'clippy', - 'class' => 'clippy', - 'alt' => __('%s assistant', get_product_name()), - 'title' => __( - '%s assistant', - get_product_name() - ), - ] - ).''; + // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; + $search_bar .= ""; + $search_bar .= ''; + + $header_searchbar = ''; + } + + + // ======= Autorefresh code ============================= + $autorefresh_txt = ''; + $autorefresh_additional = ''; + + $ignored_params = [ + 'agent_config' => false, + 'code' => false, + ]; + + if (!isset($_GET['sec2'])) { + $_GET['sec2'] = ''; + } + + if (!isset($_GET['refr'])) { + $_GET['refr'] = null; + } + + $select = db_process_sql("SELECT autorefresh_white_list,time_autorefresh FROM tusuario WHERE id_user = '".$config['id_user']."'"); + $autorefresh_list = json_decode($select[0]['autorefresh_white_list']); + + if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) { + $do_refresh = true; + if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') { + if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) { + $do_refresh = false; } - - // ======= Autorefresh code ============================= - $autorefresh_txt = ''; - $autorefresh_additional = ''; - - $ignored_params = [ - 'agent_config' => false, - 'code' => false, - ]; - - if (!isset($_GET['sec2'])) { - $_GET['sec2'] = ''; - } - - if (!isset($_GET['refr'])) { - $_GET['refr'] = null; - } - - $select = db_process_sql("SELECT autorefresh_white_list,time_autorefresh FROM tusuario WHERE id_user = '".$config['id_user']."'"); - $autorefresh_list = json_decode($select[0]['autorefresh_white_list']); - - if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) { - $do_refresh = true; - if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') { - if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) { - $do_refresh = false; - } - } - - if ($do_refresh) { - $autorefresh_img = html_print_image('images/header_refresh.png', true, ['class' => 'bot', 'alt' => 'lightning', 'title' => __('Configure autorefresh')]); - - if ($_GET['refr']) { - $autorefresh_txt .= ' ('.date('i:s', $config['refr']).')'; - } - - $ignored_params['refr'] = ''; - $values = get_refresh_time_array(); - $autorefresh_additional = ''; - unset($values); - - $autorefresh_link_open_img = ''; - - if ($_GET['refr']) { - $autorefresh_link_open_txt = ''; - } else { - $autorefresh_link_open_txt = ''; - } - - $autorefresh_link_close = ''; - } else { - $autorefresh_img = html_print_image('images/header_refresh_disabled.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); - - $ignored_params['refr'] = false; - - $autorefresh_link_open_img = ''; - $autorefresh_link_open_txt = ''; - $autorefresh_link_close = ''; - } - } else { - $autorefresh_img = html_print_image('images/header_refresh_disabled.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); - - $ignored_params['refr'] = false; - - $autorefresh_link_open_img = ''; - $autorefresh_link_open_txt = ''; - $autorefresh_link_close = ''; - } - - $table->data[0][1] = $autorefresh_link_open_img.$autorefresh_img.$autorefresh_link_close; - $table->data[0][2] = $autorefresh_link_open_txt.$autorefresh_txt.$autorefresh_link_close.$autorefresh_additional; - // ====================================================== - $pandora_management = check_acl($config['id_user'], 0, 'PM'); - - // Main help icon - if (!$config['disable_help']) { - $table->data[0][4] = ''.html_print_image( - 'images/header_help.png', - true, - [ - 'title' => __('Main help'), - 'id' => 'helpmodal', - 'class' => 'modalpopup', - ] - ).''; - } - - $notifications_numbers = notifications_get_counters(); - $table->data[0]['notifications'] = notifications_print_ball( - $notifications_numbers['notifications'], - $notifications_numbers['last_id'] - ); - - // Logout - $table->data[0][5] = ''; - $table->data[0][5] .= html_print_image('images/header_logout.png', true, ['alt' => __('Logout'), 'class' => 'bot', 'title' => __('Logout')]); - $table->data[0][5] .= ''; - - // User - if (is_user_admin($config['id_user']) == 1) { - $table->data[0][6] = html_print_image('images/header_user_admin.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); - } else { - $table->data[0][6] = html_print_image('images/header_user.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); - } - - $table->data[0][6] = ''.$table->data[0][6].''; - - $table->data[0][7] = ' ('.$config['id_user'].')'; - - // Chat messages - $table->data[0][8] = "'; - - html_print_table($table); - - unset($table); - ?> -
+ if ($do_refresh) { + $autorefresh_img = html_print_image('images/header_refresh_gray.png', true, ['class' => 'bot', 'alt' => 'lightning', 'title' => __('Configure autorefresh')]); + + if ($_GET['refr']) { + $autorefresh_txt .= ' ('.date('i:s', $config['refr']).')'; + } + + $ignored_params['refr'] = ''; + $values = get_refresh_time_array(); + $autorefresh_additional = ''; + unset($values); + + $autorefresh_link_open_img = ''; + + if ($_GET['refr']) { + $autorefresh_link_open_txt = ''; + } else { + $autorefresh_link_open_txt = ''; + } + + $autorefresh_link_close = ''; + $display_counter = 'display:block'; + } else { + $autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); + + $ignored_params['refr'] = false; + + $autorefresh_link_open_img = ''; + $autorefresh_link_open_txt = ''; + $autorefresh_link_close = ''; + + $display_counter = 'display:none'; + } + } else { + $autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); + + $ignored_params['refr'] = false; + + $autorefresh_link_open_img = ''; + $autorefresh_link_open_txt = ''; + $autorefresh_link_close = ''; + + $display_counter = 'display:none'; + } + + $header_autorefresh = '
'.$autorefresh_link_open_img.$autorefresh_img.$autorefresh_link_close.'
'; + $header_autorefresh_counter = '
'.$autorefresh_link_open_txt.$autorefresh_txt.$autorefresh_link_close.$autorefresh_additional.'
'; + + + // qr + if ($config['show_qr_code_header'] == 0) { + $show_qr_code_header = 'display: none;'; + } else { + $show_qr_code_header = 'display: inline;'; + } + + $header_qr = '
'.html_print_image( + 'images/qrcode_icon_gray.png', + true, + [ + 'alt' => __('QR Code of the page'), + 'title' => __('QR Code of the page'), + ] + ).'
'; + + echo "'; + ?> + + __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); + } else { + $header_user = html_print_image('images/header_user_green.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); + } + + $header_user = '
'.$header_user.' ('.$config['id_user'].')
'; + + // Logout + $header_logout = '
'; + $header_logout .= html_print_image('images/header_logout_gray.png', true, ['alt' => __('Logout'), 'class' => 'bot', 'title' => __('Logout')]); + $header_logout .= '
'; + + echo '
'.$header_autorefresh, $header_autorefresh_counter, $header_qr, $header_chat.'
+
'.$header_searchbar, $header_discovery.'
+
'.$header_user, $header_logout.'
'; + ?> + + + -; + \ No newline at end of file + diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index d0e2070583..21c9713a48 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -80,7 +80,7 @@ if (!empty($all_data)) { $data['server_sanity'] = format_numeric((100 - $data['module_sanity']), 1); } ?> - +
diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index 27aa2f69bd..cb5126b621 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -16,16 +16,80 @@ if (! isset($config['id_user'])) { exit(); } +?> + +'; +echo ''; // menu_container ui_require_jquery_file('cookie'); -$config_fixed_menu = false; -if (isset($config['fixed_menu'])) { - $config_fixed_menu = $config['fixed_menu']; -} - $config_fixed_header = false; if (isset($config['fixed_header'])) { $config_fixed_header = $config['fixed_header']; @@ -64,25 +126,35 @@ if (isset($config['fixed_header'])) { @@ -348,182 +191,199 @@ $(document).ready( function() { handsIn = 0; handsIn2 = 0; - if(!click_display){ - $('.menu_icon').mouseenter(function() { + +/** + * Positionate the submenu elements. Add a negative top. + * + * @param int index It is the position of li.menu_icon in the ul. + * @param string id_submenu It is the id of first level submenu. + * @param string id_submenu2 It is the id of second level submenu. + * @param int item_height It is the height of a menu item (28 o 35). + * + * @return (int) The position (in px). + */ +function menu_calculate_top(index, id_submenu, id_submenu2, item_height){ + + var level1 = index; + var level2 = $('#'+id_submenu+' ul.submenu > li').length; + var level3 = $('#'+id_submenu2+' > li.sub_subMenu').length; + var item_height = item_height; + + level2--; + if (id_submenu2 !== false) { + // If level3 is set, the position is calculated like box is in the center. + // wiouth considering level2 box can be moved. + level3--; + total = (level1 + level3); + comp = level3; + } else { + total = (level1 + level2); + comp = level2; + } + + // Positionate in the middle + if (total > 12 && ((total < 18) || ((level1 - comp) <= 4))) { + return - ( Math.floor(comp / 2) * item_height); + } + + // Positionate in the bottom + if (total >= 18) { + return (- comp * item_height); + } + + // return 0 by default + return 0; +} + + +/** + * Get the menu items to be positioned. + * + * @param string item It is the selector of the current element. + * + * @return Add the top position in a inline style. + */ +function get_menu_items(item){ + var item_height = parseInt(item.css('min-height')); + var id_submenu = item.attr('id'); + var id_submenu2 = false; + var index = item.index(); + + if(item.parent().hasClass('godmode')){ + index = index+6; // This is because the menu has divided in two parts. + } + var top_submenu = menu_calculate_top(index, id_submenu, id_submenu2, item_height); + top_submenu = top_submenu+'px'; + $('#'+id_submenu+' ul.submenu').css('top', top_submenu); + + $('.has_submenu').mouseenter(function() { + id_submenu2 = item.attr('id'); + id_submenu2 = $('#'+id_submenu2+' ul.submenu2').attr('id'); + var top_submenu2 = menu_calculate_top(index, id_submenu, id_submenu2, item_height); + top_submenu2 = top_submenu2+'px'; + $('#'+id_submenu2).css('top', top_submenu2); + }); +} + +/* + * Show and hide submenus + */ +if(!click_display){ + $('.menu_icon').mouseenter(function() { + table_hover = $(this); + handsIn = 1; + openTime = new Date().getTime(); + $("ul#sub"+table_hover[0].id).show(); + get_menu_items(table_hover); + if( typeof(table_noHover) != 'undefined') + if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id ) + $("ul#sub"+table_noHover[0].id).hide(); + }).mouseleave(function() { + table_noHover = $(this); + handsIn = 0; + setTimeout(function() { + opened = new Date().getTime() - openTime; + if(opened > 3000 && handsIn == 0) { + openTime = 4000; + $("ul#sub"+table_noHover[0].id).hide(); + } + }, 2500); + }); +}else{ + $(document).ready(function() { + if (autohidden_menu) { + $('.menu_icon').on("click", function() { + if( typeof(table_hover) != 'undefined'){ + $("ul#sub"+table_hover[0].id).hide(); + } table_hover = $(this); handsIn = 1; openTime = new Date().getTime(); $("ul#sub"+table_hover[0].id).show(); - if( typeof(table_noHover) != 'undefined') - if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id ) - $("ul#sub"+table_noHover[0].id).hide(); + get_menu_items(table_hover); }).mouseleave(function() { table_noHover = $(this); handsIn = 0; setTimeout(function() { opened = new Date().getTime() - openTime; - if(opened > 3000 && handsIn == 0) { - openTime = 4000; - $("ul#sub"+table_hover[0].id).hide(); + if(opened > 5000 && handsIn == 0) { + openTime = 6000; + $("ul#sub"+table_noHover[0].id).hide(); } - }, 2500); + }, 5500); }); + } else { + $('.menu_icon').on("click", function() { + if( typeof(table_hover) != 'undefined'){ + $("ul#sub"+table_hover[0].id).hide(); + } + table_hover = $(this); + handsIn = 1; + openTime = new Date().getTime(); + $("ul#sub"+table_hover[0].id).show(); + get_menu_items(table_hover); + }); + } + }); +} + +$('.has_submenu').mouseenter(function() { + table_hover2 = $(this); + handsIn2 = 1; + openTime2 = new Date().getTime(); + $("#sub"+table_hover2[0].id).show(); + if( typeof(table_noHover2) != 'undefined') + if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id ) + $("ul#sub"+table_noHover2[0].id).hide(); +}).mouseleave(function() { + table_noHover2 = table_hover2; + handsIn2 = 0; + setTimeout(function() { + opened = new Date().getTime() - openTime2; + if(opened >= 3000 && handsIn2 == 0) { + openTime2 = 4000; + $("ul#sub"+table_hover2[0].id).hide(); + } + }, 3500); +}); + +$(document).ready(function() { + + if(!click_display){ + $('#container').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + }); }else{ - $(document).ready(function() { - if (autohidden_menu) { - $('.menu_icon').on("click", function() { - if( typeof(table_hover) != 'undefined'){ - $("ul#sub"+table_hover[0].id).hide(); - } - table_hover = $(this); - handsIn = 1; - openTime = new Date().getTime(); - $("ul#sub"+table_hover[0].id).show(); - }).mouseleave(function() { - table_noHover = $(this); - handsIn = 0; - setTimeout(function() { - opened = new Date().getTime() - openTime; - if(opened > 5000 && handsIn == 0) { - openTime = 6000; - $("ul#sub"+table_hover[0].id).hide(); - } - }, 5500); - }); - } else { - $('.menu_icon').on("click", function() { - if( typeof(table_hover) != 'undefined'){ - $("ul#sub"+table_hover[0].id).hide(); - } - table_hover = $(this); - handsIn = 1; - openTime = new Date().getTime(); - $("ul#sub"+table_hover[0].id).show(); - }); - } + $('#main').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); }); } -- $('.has_submenu').mouseenter(function() { - table_hover2 = $(this); - handsIn2 = 1; - openTime2 = new Date().getTime(); - $("#sub"+table_hover2[0].id).show(); - if( typeof(table_noHover2) != 'undefined') - if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id ) - $("ul#sub"+table_noHover2[0].id).hide(); - }).mouseleave(function() { - table_noHover2 = table_hover2; - handsIn2 = 0; - setTimeout(function() { - opened = new Date().getTime() - openTime2; - if(opened >= 3000 && handsIn2 == 0) { - openTime2 = 4000; - $("ul#sub"+table_hover2[0].id).hide(); - } - }, 3500); - }); - - $(document).ready(function() { - if (!classic_menu) { - //Daniel maya 02/06/2016 Display menu with click --INI - if(!click_display){ - $('#container').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '45px'); - $('li.menu_icon').removeClass( " no_hidden_menu"); - $('ul.submenu').css('left', '44px'); - $('div#title_menu').hide(); - }); - }else{ - $('#main').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '45px'); - $('li.menu_icon').removeClass( " no_hidden_menu"); - $('ul.submenu').css('left', '44px'); - $('div#title_menu').hide(); - }); - } - //Daniel maya 02/06/2016 Display menu with click --END - } - else { - if(!click_display){ - $('#container').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '145px'); - $('ul.submenu').css('left', '144px'); - }); - }else{ - $('#main').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '145px'); - $('ul.submenu').css('left', '144px'); - }); - } - } + + $('div.menu>ul>li>ul>li>a').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + }); - if (classic_menu) { - $('div.menu>ul>li>ul>li>a').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('ul.submenu').css('left', '144px'); - }); - - $('div.menu>ul>li>ul>li>ul>li>a').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('ul.submenu').css('left', '144px'); - }); - } - else { - $('div.menu>ul>li>ul>li>a').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '45px'); - $('li.menu_icon').removeClass( " no_hidden_menu"); - $('ul.submenu').css('left', '44px'); - $('div#title_menu').hide(); - }); - - $('div.menu>ul>li>ul>li>ul>li>a').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '45px'); - $('li.menu_icon').removeClass( " no_hidden_menu"); - $('ul.submenu').css('left', '44px'); - $('div#title_menu').hide(); - }); - } + $('div.menu>ul>li>ul>li>ul>li>a').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); }); +}); - diff --git a/pandora_console/general/mysqlerr.php b/pandora_console/general/mysqlerr.php new file mode 100644 index 0000000000..40da530386 --- /dev/null +++ b/pandora_console/general/mysqlerr.php @@ -0,0 +1,113 @@ + + + + + + + +
+ +
+ + + +
+ +
+ /images/mysqlerr.png'> +
+ +
+
+ +
+ +
+
+
+ +
+ + + \ No newline at end of file diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index cdb75816cc..e02ec79270 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -43,7 +43,7 @@ if (is_ajax()) { if ($type_auth != 'mysql') { // Fallback to local authentication $row = []; - $row['name'] = __('Fallback to local authentication').ui_print_help_tip(__('Enable this option if you want to fallback to local authentication when remote (ldap etc...) authentication failed.'), true); + $row['name'] = __('Fallback to local authentication').ui_print_help_tip(__('Enable this option if you want to fallback to local authentication when remote (ldap etc...) authentication failed. Only available when \'Save password\' is enabled.'), true); $row['control'] = html_print_checkbox_switch('fallback_local_auth', 1, $config['fallback_local_auth'], true); $table->data['fallback_local_auth'] = $row; diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 85047cd488..f2042193fb 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -120,15 +120,6 @@ if (enterprise_installed()) { $row++; } -$table_behaviour->data[$row][0] = __('Classic menu mode').ui_print_help_tip(__('Text menu options always visible, don\'t hide'), true); -$table_behaviour->data[$row][1] = html_print_checkbox_switch( - 'classic_menu', - 1, - $config['classic_menu'], - true -); -$row++; - echo '
'; echo ''.__('Behaviour configuration').''; html_print_table($table_behaviour); @@ -227,45 +218,65 @@ $table_styles->data[$row][1] = html_print_select( $table_styles->data[$row][1] .= ' '.html_print_button(__('View'), 'login_background_preview', false, '', 'class="sub camera logo_preview"', true); $row++; -$table_styles->data[$row][0] = __('Custom logo (header)').ui_print_help_icon('custom_logo', true); -if (enterprise_installed()) { - $ent_files = list_files('enterprise/images/custom_logo', 'png', 1, 0); - $open_files = list_files('images/custom_logo', 'png', 1, 0); - $table_styles->data[$row][1] = html_print_select( - array_merge($ent_files, $open_files), - 'custom_logo', - $config['custom_logo'], - '', - '', - '', - true, - false, - true, - '', - $open, - 'width:240px' - ); -} else { - $table_styles->data[$row][1] = html_print_select( - list_files('images/custom_logo', 'png', 1, 0), - 'custom_logo', - $config['custom_logo'], - '', - '', - '', - true, - false, - true, - '', - $open, - 'width:240px' - ); +/** + * Print a select for the custom logos. + * + * @param string $name This is the name for the select + * @param string $logo This is the option in $config (path) + * @return string Print the select + */ +function logo_custom_enterprise($name, $logo) +{ + if (enterprise_installed()) { + $ent_files = list_files('enterprise/images/custom_logo', 'png', 1, 0); + $open_files = list_files('images/custom_logo', 'png', 1, 0); + + $select = html_print_select( + array_merge($ent_files, $open_files), + $name, + $logo, + '', + '', + '', + true, + false, + true, + '', + $open, + 'width:240px' + ); + return $select; + } else { + $select = html_print_select( + list_files('images/custom_logo', 'png', 1, 0), + $name, + $logo, + '', + '', + '', + true, + false, + true, + '', + $open, + 'width:240px' + ); + return $select; + } } + +$table_styles->data[$row][0] = __('Custom logo (menu)').ui_print_help_icon('custom_logo', true); +$table_styles->data[$row][1] = logo_custom_enterprise('custom_logo', $config['custom_logo']); $table_styles->data[$row][1] .= ' '.html_print_button(__('View'), 'custom_logo_preview', $open, '', 'class="sub camera logo_preview"', true, false, $open, 'visualmodal'); $row++; +$table_styles->data[$row][0] = __('Custom logo collapsed (menu)').ui_print_help_icon('custom_logo_collapsed', true); +$table_styles->data[$row][1] = logo_custom_enterprise('custom_logo_collapsed', $config['custom_logo_collapsed']); +$table_styles->data[$row][1] .= ' '.html_print_button(__('View'), 'custom_logo_collapsed_preview', $open, '', 'class="sub camera logo_preview"', true, false, $open, 'visualmodal'); +$row++; + $table_styles->data[$row][0] = __('Custom logo (header white background)'); if (enterprise_installed()) { $ent_files = list_files('enterprise/images/custom_logo', 'png', 1, 0); @@ -524,745 +535,737 @@ $table_styles->data[$row][1] = html_print_checkbox_switch( ); $row++; -$table_styles->data[$row][0] = __('Fixed menu'); -$table_styles->data[$row][1] = html_print_checkbox_switch( - 'fixed_menu', - 1, - $config['fixed_menu'], - true -); -$row++; -// For 5.1 Autohidden menu feature -$table_styles->data['autohidden'][0] = __('Autohidden menu'); -$table_styles->data['autohidden'][1] = html_print_checkbox_switch( - 'autohidden_menu', - 1, - $config['autohidden_menu'], - true -); + // For 5.1 Autohidden menu feature + $table_styles->data['autohidden'][0] = __('Autohidden menu'); + $table_styles->data['autohidden'][1] = html_print_checkbox_switch( + 'autohidden_menu', + 1, + $config['autohidden_menu'], + true + ); -$table_styles->data[$row][0] = __('Visual effects and animation'); -$table_styles->data[$row][1] = html_print_checkbox_switch( - 'visual_animation', - 1, - $config['visual_animation'], - true -); + $table_styles->data[$row][0] = __('Visual effects and animation'); + $table_styles->data[$row][1] = html_print_checkbox_switch( + 'visual_animation', + 1, + $config['visual_animation'], + true + ); -echo '
'; -echo ''.__('Style configuration').''; -html_print_table($table_styles); -echo '
'; -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// GIS CONFIGURATION -// ---------------------------------------------------------------------- -$table_gis = new stdClass(); -$table_gis->width = '100%'; -$table_gis->class = 'databox filters'; -$table_gis->style[0] = 'font-weight: bold;'; -$table_gis->size[0] = '50%'; -$table_gis->data = []; + echo '
'; + echo ''.__('Style configuration').''; + html_print_table($table_styles); + echo '
'; + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- + // GIS CONFIGURATION + // ---------------------------------------------------------------------- + $table_gis = new stdClass(); + $table_gis->width = '100%'; + $table_gis->class = 'databox filters'; + $table_gis->style[0] = 'font-weight: bold;'; + $table_gis->size[0] = '50%'; + $table_gis->data = []; -$table_gis->data[$row][0] = __('GIS Labels').ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true); -$table_gis->data[$row][1] = html_print_checkbox_switch( - 'gis_label', - 1, - $config['gis_label'], - true -); -$row++; + $table_gis->data[$row][0] = __('GIS Labels').ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true); + $table_gis->data[$row][1] = html_print_checkbox_switch( + 'gis_label', + 1, + $config['gis_label'], + true + ); + $row++; -$listIcons = gis_get_array_list_icons(); -$arraySelectIcon = []; -foreach ($listIcons as $index => $value) { - $arraySelectIcon[$index] = $index; -} + $listIcons = gis_get_array_list_icons(); + $arraySelectIcon = []; + foreach ($listIcons as $index => $value) { + $arraySelectIcon[$index] = $index; + } -$table_gis->data[$row][0] = __('Default icon in GIS').ui_print_help_tip(__('Agent icon for GIS Maps. If set to "none", group icon will be used'), true); -$table_gis->data[$row][1] = html_print_select( - $arraySelectIcon, - 'gis_default_icon', - $config['gis_default_icon'], - '', - __('Agent icon group'), - '', - true -); -$table_gis->data[$row][1] .= ' '.html_print_button(__('View'), 'gis_icon_preview', false, '', 'class="sub camera logo_preview"', true); -$row++; + $table_gis->data[$row][0] = __('Default icon in GIS').ui_print_help_tip(__('Agent icon for GIS Maps. If set to "none", group icon will be used'), true); + $table_gis->data[$row][1] = html_print_select( + $arraySelectIcon, + 'gis_default_icon', + $config['gis_default_icon'], + '', + __('Agent icon group'), + '', + true + ); + $table_gis->data[$row][1] .= ' '.html_print_button(__('View'), 'gis_icon_preview', false, '', 'class="sub camera logo_preview"', true); + $row++; -echo '
'; -echo ''.__('GIS configuration').''; -html_print_table($table_gis); -echo '
'; -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// FONT AND TEXT CONFIGURATION -// ---------------------------------------------------------------------- -$table_font = new stdClass(); -$table_font->width = '100%'; -$table_font->class = 'databox filters'; -$table_font->style[0] = 'font-weight: bold;'; -$table_font->size[0] = '50%'; -$table_font->data = []; + echo '
'; + echo ''.__('GIS configuration').''; + html_print_table($table_gis); + echo '
'; + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- + // FONT AND TEXT CONFIGURATION + // ---------------------------------------------------------------------- + $table_font = new stdClass(); + $table_font->width = '100%'; + $table_font->class = 'databox filters'; + $table_font->style[0] = 'font-weight: bold;'; + $table_font->size[0] = '50%'; + $table_font->data = []; -$table_font->data[$row][0] = __('Font path'); -$fonts = load_fonts(); -$table_font->data[$row][1] = html_print_select( - $fonts, - 'fontpath', - io_safe_output($config['fontpath']), - '', - '', - 0, - true -); - -$row++; - -$table_font->data[$row][0] = __('Font size'); - -$font_size_array = [ - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - 11 => 11, - 12 => 12, - 13 => 13, - 14 => 14, - 15 => 15, -]; - -$table_font->data[$row][1] = html_print_select( - $font_size_array, - 'font_size', - $config['font_size'], - '', - '', - 0, - true -); -$row++; - -$table_font->data[$row][0] = __('Agent size text').ui_print_help_tip(__('When the agent name has a lot of characters, it is needed to truncate it into N characters in some sections in %s Console', get_product_name()), true); -$table_font->data[$row][1] = __('Small:').html_print_input_text('agent_size_text_small', $config['agent_size_text_small'], '', 3, 3, true); -$table_font->data[$row][1] .= ' '.__('Normal:').html_print_input_text('agent_size_text_medium', $config['agent_size_text_medium'], '', 3, 3, true); -$row++; - -$table_font->data[$row][0] = __('Module size text').ui_print_help_tip(__('When the module name has a lot of characters, it is needed to truncate it into N characters in some sections in %s Console', get_product_name()), true); -$table_font->data[$row][1] = __('Small:').html_print_input_text('module_size_text_small', $config['module_size_text_small'], '', 3, 3, true); -$table_font->data[$row][1] .= ' '.__('Normal:').html_print_input_text('module_size_text_medium', $config['module_size_text_medium'], '', 3, 3, true); -$row++; - -$table_font->data[$row][0] = __('Description size text').ui_print_help_tip(__('If the description name has a lot of characters, in some places in %s Console it is necessary to truncate it to N characters.', get_product_name()), true); -$table_font->data[$row][1] = html_print_input_text('description_size_text', $config['description_size_text'], '', 3, 3, true); -$row++; - -$table_font->data[$row][0] = __('Item title size text').ui_print_help_tip(__('When the item title name has a lot of characters, it is needed to truncate it into N characters in some sections in %s Console.', get_product_name()), true); -$table_font->data[$row][1] = html_print_input_text( - 'item_title_size_text', - $config['item_title_size_text'], - '', - 3, - 3, - true -); -$row++; - -$table_font->data[$row][0] = __('Show unit along with value in reports').ui_print_help_tip(__('This enabling this, max, min and avg values will be shown with units.'), true); -$table_font->data[$row][1] = html_print_checkbox_switch( - 'simple_module_value', - 1, - $config['simple_module_value'], - true -); -$row++; - -echo '
'; -echo ''.__('Font and Text configuration').''; -html_print_table($table_font); -echo '
'; -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// CHARS CONFIGURATION -// ---------------------------------------------------------------------- -$table_chars = new stdClass(); -$table_chars->width = '100%'; -$table_chars->class = 'databox filters'; -$table_chars->style[0] = 'font-weight: bold;'; -$table_chars->size[0] = '50%'; -$table_chars->data = []; - -$table_chars->data[$row][0] = __('Graph color #1'); -$table_chars->data[$row][1] = html_print_input_text('graph_color1', $config['graph_color1'], '', 8, 8, true); -$row++; - -$table_chars->data[$row][0] = __('Graph color #2'); -$table_chars->data[$row][1] = html_print_input_text('graph_color2', $config['graph_color2'], '', 8, 8, true); -$row++; - -$table_chars->data[$row][0] = __('Graph color #3'); -$table_chars->data[$row][1] = html_print_input_text('graph_color3', $config['graph_color3'], '', 8, 8, true); -$row++; - -$table_chars->data[$row][0] = __('Graph color #4'); -$table_chars->data[$row][1] = html_print_input_text('graph_color4', $config['graph_color4'], '', 8, 8, true); -$row++; - -$table_chars->data[$row][0] = __('Graph color #5'); -$table_chars->data[$row][1] = html_print_input_text('graph_color5', $config['graph_color5'], '', 8, 8, true); -$row++; - -$table_chars->data[$row][0] = __('Graph color #6'); -$table_chars->data[$row][1] = html_print_input_text('graph_color6', $config['graph_color6'], '', 8, 8, true); -$row++; - -$table_chars->data[$row][0] = __('Graph color #7'); -$table_chars->data[$row][1] = html_print_input_text('graph_color7', $config['graph_color7'], '', 8, 8, true); -$row++; - -$table_chars->data[$row][0] = __('Graph color #8'); -$table_chars->data[$row][1] = html_print_input_text('graph_color8', $config['graph_color8'], '', 8, 8, true); -$row++; - -$table_chars->data[$row][0] = __('Graph color #9'); -$table_chars->data[$row][1] = html_print_input_text('graph_color9', $config['graph_color9'], '', 8, 8, true); -$row++; - -$table_chars->data[$row][0] = __('Graph color #10'); -$table_chars->data[$row][1] = html_print_input_text('graph_color10', $config['graph_color10'], '', 8, 8, true); -$row++; - -$table_chars->data[$row][0] = __('Value to interface graphics'); -$table_chars->data[$row][1] = html_print_input_text('interface_unit', $config['interface_unit'], '', 20, 20, true); -$row++; - -$disabled_graph_precision = false; -if (!enterprise_installed()) { - $disabled_graph_precision = true; -} - -$table_chars->data[$row][0] = __('Data precision'); -$table_chars->data[$row][0] .= ui_print_help_tip(__('Number of decimals shown. It must be a number between 0 and 5, except in graphs.'), true); -$table_chars->data[$row][1] = html_print_input_text('graph_precision', $config['graph_precision'], '', 5, 5, true, $disabled_graph_precision, false, 'onChange="change_precision()"'); -$row++; - -if (!isset($config['short_module_graph_data'])) { - $config['short_module_graph_data'] = true; -} - -$table_chars->data[$row][0] = __('Data precision in graphs'); -$table_chars->data[$row][0] .= ui_print_help_tip(__('Number of decimals shown. If the field is empty, it will show all the decimals'), true); -$table_chars->data[$row][1] = html_print_input_text('short_module_graph_data', $config['short_module_graph_data'], '', 5, 5, true, $disabled_graph_precision, false, 'onChange="change_precision()"'); -$row++; - -$table_chars->data[$row][0] = __('Default line thickness for the Custom Graph.'); -$table_chars->data[$row][1] = html_print_input_text( - 'custom_graph_width', - $config['custom_graph_width'], - '', - 5, - 5, - true -); -$row++; - -$table_chars->data[$row][0] = __('Use round corners'); -$table_chars->data[$row][1] = html_print_checkbox_switch( - 'round_corner', - 1, - $config['round_corner'], - true -); -$row++; - -$table_chars->data[$row][0] = __('Type of module charts'); -$table_chars->data[$row][1] = __('Area').' '.html_print_radio_button( - 'type_module_charts', - 'area', - '', - $config['type_module_charts'] == 'area', - true -).'  '; -$table_chars->data[$row][1] .= __('Line').' '.html_print_radio_button( - 'type_module_charts', - 'line', - '', - $config['type_module_charts'] != 'area', - true -); -$row++; - -$table_chars->data[$row][0] = __('Type of interface charts'); -$table_chars->data[$row][1] = __('Area').' '.html_print_radio_button( - 'type_interface_charts', - 'area', - '', - $config['type_interface_charts'] == 'area', - true -).'  '; -$table_chars->data[$row][1] .= __('Line').' '.html_print_radio_button( - 'type_interface_charts', - 'line', - '', - $config['type_interface_charts'] != 'area', - true -); -$row++; - -$table_chars->data[$row][0] = __('Percentile'); -$table_chars->data[$row][0] .= ui_print_help_tip(__('Show percentile 95 in graphs'), true); -$table_chars->data[$row][1] = html_print_input_text('percentil', $config['percentil'], '', 20, 20, true); -$row++; - -$table_chars->data[$row][0] = __('Graph TIP view:'); -$table_chars->data[$row][0] .= ui_print_help_tip(__('This option may cause performance issues'), true); - -$options_full_escale = []; -$options_full_escale[0] = __('None'); -$options_full_escale[1] = __('All'); -$options_full_escale[2] = __('On Boolean graphs'); - -$table_chars->data[$row][1] = html_print_select($options_full_escale, 'full_scale_option', $config['full_scale_option'], '', '', 0, true, false, false); -$row++; - - -$table_chars->data[$row][0] = __('Show only average'); -$table_chars->data[$row][0] .= ui_print_help_tip(__('If enabled, the module graphs will only show the average value, otherwise it will show three sets of data showing maximums, averages and minimums.'), true); - -$options_soft_graphs = []; -$options_soft_graphs[0] = __('Standard mode'); -$options_soft_graphs[1] = __('Classic mode'); - -$table_chars->data[$row][1] = html_print_select($options_soft_graphs, 'type_mode_graph', $config['type_mode_graph'], '', '', 0, true, false, false); -$row++; - -$table_chars->data[$row][0] = __('Zoom graphs:'); - -$options_zoom_graphs = []; -$options_zoom_graphs[1] = 'x1'; -$options_zoom_graphs[2] = 'x2'; -$options_zoom_graphs[3] = 'x3'; -$options_zoom_graphs[4] = 'x4'; -$options_zoom_graphs[5] = 'x5'; - -$table_chars->data[$row][1] = html_print_select($options_zoom_graphs, 'zoom_graph', $config['zoom_graph'], '', '', 0, true, false, false); -$row++; - -$table_chars->data[$row][0] = __('Graph image height'); -$table_chars->data[$row][0] .= ui_print_help_tip( - __('This is the height in pixels of the module graph or custom graph in the reports (both: HTML and PDF)'), - true -); -$table_chars->data[$row][1] = html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true); -$row++; - -/* $table_font->data[$row][0] = __('Font path'); $fonts = load_fonts(); - $table_font->data[$row][1] = html_print_select($fonts, 'fontpath', - io_safe_output($config["fontpath"]), '', '', 0, true); + $table_font->data[$row][1] = html_print_select( + $fonts, + 'fontpath', + io_safe_output($config['fontpath']), + '', + '', + 0, + true + ); $row++; -*/ -echo '
'; -echo ''.__('Charts configuration').''; -html_print_table($table_chars); -echo '
'; -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// Visual Consoles -// ---------------------------------------------------------------------- -$table_vc = new stdClass(); -$table_vc->width = '100%'; -$table_vc->class = 'databox filters'; -$table_vc->style[0] = 'font-weight: bold'; -$table_vc->size[0] = '50%'; -$table_vc->data = []; + $table_font->data[$row][0] = __('Font size'); -$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); -$row++; + $font_size_array = [ + 1 => 1, + 2 => 2, + 3 => 3, + 4 => 4, + 5 => 5, + 6 => 6, + 7 => 7, + 8 => 8, + 9 => 9, + 10 => 10, + 11 => 11, + 12 => 12, + 13 => 13, + 14 => 14, + 15 => 15, + ]; -$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] = ""; -$row++; + $table_font->data[$row][1] = html_print_select( + $font_size_array, + 'font_size', + $config['font_size'], + '', + '', + 0, + true + ); + $row++; -if (empty($config['vc_line_thickness'])) { - $config['vc_line_thickness'] = 2; -} + $table_font->data[$row][0] = __('Agent size text').ui_print_help_tip(__('When the agent name has a lot of characters, it is needed to truncate it into N characters in some sections in %s Console', get_product_name()), true); + $table_font->data[$row][1] = __('Small:').html_print_input_text('agent_size_text_small', $config['agent_size_text_small'], '', 3, 3, true); + $table_font->data[$row][1] .= ' '.__('Normal:').html_print_input_text('agent_size_text_medium', $config['agent_size_text_medium'], '', 3, 3, true); + $row++; -$table_vc->data[$row][0] = __('Default line thickness for the Visual Console').ui_print_help_tip(__('This interval will affect to the lines between elements on the Visual Console'), true); -$table_vc->data[$row][1] = html_print_input_text('vc_line_thickness', $config['vc_line_thickness'], '', 5, 5, true); + $table_font->data[$row][0] = __('Module size text').ui_print_help_tip(__('When the module name has a lot of characters, it is needed to truncate it into N characters in some sections in %s Console', get_product_name()), true); + $table_font->data[$row][1] = __('Small:').html_print_input_text('module_size_text_small', $config['module_size_text_small'], '', 3, 3, true); + $table_font->data[$row][1] .= ' '.__('Normal:').html_print_input_text('module_size_text_medium', $config['module_size_text_medium'], '', 3, 3, true); + $row++; + + $table_font->data[$row][0] = __('Description size text').ui_print_help_tip(__('If the description name has a lot of characters, in some places in %s Console it is necessary to truncate it to N characters.', get_product_name()), true); + $table_font->data[$row][1] = html_print_input_text('description_size_text', $config['description_size_text'], '', 3, 3, true); + $row++; + + $table_font->data[$row][0] = __('Item title size text').ui_print_help_tip(__('When the item title name has a lot of characters, it is needed to truncate it into N characters in some sections in %s Console.', get_product_name()), true); + $table_font->data[$row][1] = html_print_input_text( + 'item_title_size_text', + $config['item_title_size_text'], + '', + 3, + 3, + true + ); + $row++; + + $table_font->data[$row][0] = __('Show unit along with value in reports').ui_print_help_tip(__('This enabling this, max, min and avg values will be shown with units.'), true); + $table_font->data[$row][1] = html_print_checkbox_switch( + 'simple_module_value', + 1, + $config['simple_module_value'], + true + ); + $row++; + + echo '
'; + echo ''.__('Font and Text configuration').''; + html_print_table($table_font); + echo '
'; + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- + // CHARS CONFIGURATION + // ---------------------------------------------------------------------- + $table_chars = new stdClass(); + $table_chars->width = '100%'; + $table_chars->class = 'databox filters'; + $table_chars->style[0] = 'font-weight: bold;'; + $table_chars->size[0] = '50%'; + $table_chars->data = []; + + $table_chars->data[$row][0] = __('Graph color #1'); + $table_chars->data[$row][1] = html_print_input_text('graph_color1', $config['graph_color1'], '', 8, 8, true); + $row++; + + $table_chars->data[$row][0] = __('Graph color #2'); + $table_chars->data[$row][1] = html_print_input_text('graph_color2', $config['graph_color2'], '', 8, 8, true); + $row++; + + $table_chars->data[$row][0] = __('Graph color #3'); + $table_chars->data[$row][1] = html_print_input_text('graph_color3', $config['graph_color3'], '', 8, 8, true); + $row++; + + $table_chars->data[$row][0] = __('Graph color #4'); + $table_chars->data[$row][1] = html_print_input_text('graph_color4', $config['graph_color4'], '', 8, 8, true); + $row++; + + $table_chars->data[$row][0] = __('Graph color #5'); + $table_chars->data[$row][1] = html_print_input_text('graph_color5', $config['graph_color5'], '', 8, 8, true); + $row++; + + $table_chars->data[$row][0] = __('Graph color #6'); + $table_chars->data[$row][1] = html_print_input_text('graph_color6', $config['graph_color6'], '', 8, 8, true); + $row++; + + $table_chars->data[$row][0] = __('Graph color #7'); + $table_chars->data[$row][1] = html_print_input_text('graph_color7', $config['graph_color7'], '', 8, 8, true); + $row++; + + $table_chars->data[$row][0] = __('Graph color #8'); + $table_chars->data[$row][1] = html_print_input_text('graph_color8', $config['graph_color8'], '', 8, 8, true); + $row++; + + $table_chars->data[$row][0] = __('Graph color #9'); + $table_chars->data[$row][1] = html_print_input_text('graph_color9', $config['graph_color9'], '', 8, 8, true); + $row++; + + $table_chars->data[$row][0] = __('Graph color #10'); + $table_chars->data[$row][1] = html_print_input_text('graph_color10', $config['graph_color10'], '', 8, 8, true); + $row++; + + $table_chars->data[$row][0] = __('Value to interface graphics'); + $table_chars->data[$row][1] = html_print_input_text('interface_unit', $config['interface_unit'], '', 20, 20, true); + $row++; + + $disabled_graph_precision = false; + if (!enterprise_installed()) { + $disabled_graph_precision = true; + } + + $table_chars->data[$row][0] = __('Data precision'); + $table_chars->data[$row][0] .= ui_print_help_tip(__('Number of decimals shown. It must be a number between 0 and 5, except in graphs.'), true); + $table_chars->data[$row][1] = html_print_input_text('graph_precision', $config['graph_precision'], '', 5, 5, true, $disabled_graph_precision, false, 'onChange="change_precision()"'); + $row++; + + if (!isset($config['short_module_graph_data'])) { + $config['short_module_graph_data'] = true; + } + + $table_chars->data[$row][0] = __('Data precision in graphs'); + $table_chars->data[$row][0] .= ui_print_help_tip(__('Number of decimals shown. If the field is empty, it will show all the decimals'), true); + $table_chars->data[$row][1] = html_print_input_text('short_module_graph_data', $config['short_module_graph_data'], '', 5, 5, true, $disabled_graph_precision, false, 'onChange="change_precision()"'); + $row++; + + $table_chars->data[$row][0] = __('Default line thickness for the Custom Graph.'); + $table_chars->data[$row][1] = html_print_input_text( + 'custom_graph_width', + $config['custom_graph_width'], + '', + 5, + 5, + true + ); + $row++; + + $table_chars->data[$row][0] = __('Use round corners'); + $table_chars->data[$row][1] = html_print_checkbox_switch( + 'round_corner', + 1, + $config['round_corner'], + true + ); + $row++; + + $table_chars->data[$row][0] = __('Type of module charts'); + $table_chars->data[$row][1] = __('Area').' '.html_print_radio_button( + 'type_module_charts', + 'area', + '', + $config['type_module_charts'] == 'area', + true + ).'  '; + $table_chars->data[$row][1] .= __('Line').' '.html_print_radio_button( + 'type_module_charts', + 'line', + '', + $config['type_module_charts'] != 'area', + true + ); + $row++; + + $table_chars->data[$row][0] = __('Type of interface charts'); + $table_chars->data[$row][1] = __('Area').' '.html_print_radio_button( + 'type_interface_charts', + 'area', + '', + $config['type_interface_charts'] == 'area', + true + ).'  '; + $table_chars->data[$row][1] .= __('Line').' '.html_print_radio_button( + 'type_interface_charts', + 'line', + '', + $config['type_interface_charts'] != 'area', + true + ); + $row++; + + $table_chars->data[$row][0] = __('Percentile'); + $table_chars->data[$row][0] .= ui_print_help_tip(__('Show percentile 95 in graphs'), true); + $table_chars->data[$row][1] = html_print_input_text('percentil', $config['percentil'], '', 20, 20, true); + $row++; + + $table_chars->data[$row][0] = __('Graph TIP view:'); + $table_chars->data[$row][0] .= ui_print_help_tip(__('This option may cause performance issues'), true); + + $options_full_escale = []; + $options_full_escale[0] = __('None'); + $options_full_escale[1] = __('All'); + $options_full_escale[2] = __('On Boolean graphs'); + + $table_chars->data[$row][1] = html_print_select($options_full_escale, 'full_scale_option', $config['full_scale_option'], '', '', 0, true, false, false); + $row++; -echo '
'; -echo ''.__('Visual consoles configuration').''; + $table_chars->data[$row][0] = __('Show only average'); + $table_chars->data[$row][0] .= ui_print_help_tip(__('If enabled, the module graphs will only show the average value, otherwise it will show three sets of data showing maximums, averages and minimums.'), true); + + $options_soft_graphs = []; + $options_soft_graphs[0] = __('Standard mode'); + $options_soft_graphs[1] = __('Classic mode'); + + $table_chars->data[$row][1] = html_print_select($options_soft_graphs, 'type_mode_graph', $config['type_mode_graph'], '', '', 0, true, false, false); + $row++; + + $table_chars->data[$row][0] = __('Zoom graphs:'); + + $options_zoom_graphs = []; + $options_zoom_graphs[1] = 'x1'; + $options_zoom_graphs[2] = 'x2'; + $options_zoom_graphs[3] = 'x3'; + $options_zoom_graphs[4] = 'x4'; + $options_zoom_graphs[5] = 'x5'; + + $table_chars->data[$row][1] = html_print_select($options_zoom_graphs, 'zoom_graph', $config['zoom_graph'], '', '', 0, true, false, false); + $row++; + + $table_chars->data[$row][0] = __('Graph image height'); + $table_chars->data[$row][0] .= ui_print_help_tip( + __('This is the height in pixels of the module graph or custom graph in the reports (both: HTML and PDF)'), + true + ); + $table_chars->data[$row][1] = html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true); + $row++; + + /* + $table_font->data[$row][0] = __('Font path'); + $fonts = load_fonts(); + $table_font->data[$row][1] = html_print_select($fonts, 'fontpath', + io_safe_output($config["fontpath"]), '', '', 0, true); + + $row++; + */ + + echo '
'; + echo ''.__('Charts configuration').''; + html_print_table($table_chars); + echo '
'; + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- + // Visual Consoles + // ---------------------------------------------------------------------- + $table_vc = new stdClass(); + $table_vc->width = '100%'; + $table_vc->class = 'databox filters'; + $table_vc->style[0] = 'font-weight: bold'; + $table_vc->size[0] = '50%'; + $table_vc->data = []; + + $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); + $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] = ""; + $row++; + + if (empty($config['vc_line_thickness'])) { + $config['vc_line_thickness'] = 2; + } + + $table_vc->data[$row][0] = __('Default line thickness for the Visual Console').ui_print_help_tip(__('This interval will affect to the lines between elements on the Visual Console'), true); + $table_vc->data[$row][1] = html_print_input_text('vc_line_thickness', $config['vc_line_thickness'], '', 5, 5, true); + + + echo '
'; + echo ''.__('Visual consoles configuration').''; html_print_table($table_vc); -echo '
'; + echo '
'; -// ---------------------------------------------------------------------- -// 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 = []; + // ---------------------------------------------------------------------- + // 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 = []; -$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] = ""; + $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] = ""; -echo '
'; -echo ''.__('Services configuration').''; + echo '
'; + echo ''.__('Services configuration').''; html_print_table($table_ser); -echo '
'; + echo '
'; -// ---------------------------------------------------------------------- -// OTHER CONFIGURATION -// ---------------------------------------------------------------------- -$table_other = new stdClass(); -$table_other->width = '100%'; -$table_other->class = 'databox filters'; -$table_other->style[0] = 'font-weight: bold;'; -$table_other->size[0] = '50%'; -$table_other->data = []; + // ---------------------------------------------------------------------- + // OTHER CONFIGURATION + // ---------------------------------------------------------------------- + $table_other = new stdClass(); + $table_other->width = '100%'; + $table_other->class = 'databox filters'; + $table_other->style[0] = 'font-weight: bold;'; + $table_other->size[0] = '50%'; + $table_other->data = []; -// Enrique (27/01/2017) New feature: Show report info on top of reports -$table_other->data[$row][0] = __('Show report info with description').ui_print_help_tip( - __('Custom report description info. It will be applied to all reports and templates by default.'), - true -); -$table_other->data[$row][1] = html_print_checkbox_switch( - 'custom_report_info', - 1, - $config['custom_report_info'], - true -); -$row++; + // Enrique (27/01/2017) New feature: Show report info on top of reports + $table_other->data[$row][0] = __('Show report info with description').ui_print_help_tip( + __('Custom report description info. It will be applied to all reports and templates by default.'), + true + ); + $table_other->data[$row][1] = html_print_checkbox_switch( + 'custom_report_info', + 1, + $config['custom_report_info'], + true + ); + $row++; -// ---------------------------------------------------------------------- -// Juanma (07/05/2014) New feature: Table for custom front page for reports -$table_other->data[$row][0] = __('Custom report front page').ui_print_help_tip( - __('Custom report front page. It will be applied to all reports and templates by default.'), - true -); -$table_other->data[$row][1] = html_print_checkbox( - 'custom_report_front', - 1, - $config['custom_report_front'], - true -); + // ---------------------------------------------------------------------- + // Juanma (07/05/2014) New feature: Table for custom front page for reports + $table_other->data[$row][0] = __('Custom report front page').ui_print_help_tip( + __('Custom report front page. It will be applied to all reports and templates by default.'), + true + ); + $table_other->data[$row][1] = html_print_checkbox( + 'custom_report_front', + 1, + $config['custom_report_front'], + true + ); -$row++; -// ---------------------------------------------------------------------- -$dirItems = scandir($config['homedir'].'/images/custom_logo'); -foreach ($dirItems as $entryDir) { - if (strstr($entryDir, '.jpg') !== false || strstr($entryDir, '.png') !== false) { - $customLogos['images/custom_logo/'.$entryDir] = $entryDir; - } -} - -$_fonts = []; -$dirFonts = scandir(_MPDF_TTFONTPATH); -foreach ($dirFonts as $entryDir) { - if (strstr($entryDir, '.ttf') !== false) { - $_fonts[$entryDir] = $entryDir; - } -} - -// Font -$table_other->data['custom_report_front-font'][0] = __('Custom report front').' - '.__('Font family'); -$table_other->data['custom_report_front-font'][1] = html_print_select( - $_fonts, - 'custom_report_front_font', - $config['custom_report_front_font'], - false, - __('Default'), - '', - true -); - -// Logo -$table_other->data['custom_report_front-logo'][0] = __('Custom report front').' - '.__('Custom logo').ui_print_help_tip( - __("The dir of custom logos is in your www Console in 'images/custom_logo'. You can upload more files (ONLY JPEG AND PNG) in upload tool in console."), - true -); -$table_other->data['custom_report_front-logo'][1] = html_print_select( - $customLogos, - 'custom_report_front_logo', - io_safe_output($config['custom_report_front_logo']), - 'showPreview()', - __('Default'), - '', - true -); -// Preview -$table_other->data['custom_report_front-preview'][0] = __('Custom report front').' - '.'Preview'; -if (empty($config['custom_report_front_logo'])) { - $config['custom_report_front_logo'] = 'images/pandora_logo_white.jpg'; -} - -$table_other->data['custom_report_front-preview'][1] = ''.html_print_image($config['custom_report_front_logo'], true).''; - -// Header -$table_other->data['custom_report_front-header'][0] = __('Custom report front').' - '.__('Header'); -$table_other->data['custom_report_front-header'][1] = html_print_textarea( - 'custom_report_front_header', - 5, - 15, - $config['custom_report_front_header'], - 'style="width: 38em;"', - true -); - -// First page -$table_other->data['custom_report_front-first_page'][0] = __('Custom report front').' - '.__('First page'); -$custom_report_front_firstpage = str_replace( - '(_URLIMAGE_)', - ui_get_full_url(false, true, false, false), - $config['custom_report_front_firstpage'] -); -$table_other->data['custom_report_front-first_page'][1] = html_print_textarea( - 'custom_report_front_firstpage', - 15, - 15, - $custom_report_front_firstpage, - 'style="width: 38em; height: 20em;"', - true -); - -// Footer -$table_other->data['custom_report_front-footer'][0] = __('Custom report front').' - '.__('Footer'); -$table_other->data['custom_report_front-footer'][1] = html_print_textarea( - 'custom_report_front_footer', - 5, - 15, - $config['custom_report_front_footer'], - 'style="width: 38em;"', - true -); - - - - -$table_other->data[$row][0] = __('Show QR Code icon in the header'); -$table_other->data[$row][1] = html_print_checkbox_switch( - 'show_qr_code_header', - 1, - $config['show_qr_code_header'], - true -); -$row++; - -$table_other->data[$row][0] = __('Custom graphviz directory').ui_print_help_tip(__('Custom directory where the graphviz binaries are stored.'), true); -$table_other->data[$row][1] = html_print_input_text( - 'graphviz_bin_dir', - $config['graphviz_bin_dir'], - '', - 50, - 255, - true -); - -$row++; - -$table_other->data[$row][0] = __('Networkmap max width'); -$table_other->data[$row][1] = html_print_input_text( - 'networkmap_max_width', - $config['networkmap_max_width'], - '', - 10, - 20, - true -); -$row++; - - - -$table_other->data[$row][0] = __('Show only the group name'); -$table_other->data[$row][0] .= ui_print_help_tip( - __('Show the group name instead the group icon.'), - true -); -$table_other->data[$row][1] = html_print_checkbox_switch( - 'show_group_name', - 1, - $config['show_group_name'], - true -); -$row++; - -$table_other->data[$row][0] = __('Date format string').ui_print_help_icon('date_format', true); -$table_other->data[$row][1] = ''.__('Example').' '.date($config['date_format']); -$table_other->data[$row][1] .= html_print_input_text('date_format', $config['date_format'], '', 30, 100, true); -$row++; - -if ($config['prominent_time'] == 'comparation') { - $timestamp = false; - $comparation = true; -} else if ($config['prominent_time'] == 'timestamp') { - $timestamp = true; - $comparation = false; -} - -$table_other->data[$row][0] = __('Timestamp or time comparation').ui_print_help_icon('time_stamp-comparation', true); -$table_other->data[$row][1] = __('Comparation in rollover').' '; -$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'comparation', '', $comparation, true); -$table_other->data[$row][1] .= '
'.__('Timestamp in rollover').' '; -$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'timestamp', '', $timestamp, true); - -$row++; - -// ---------------------------------------------------------------------- -// CUSTOM VALUES POST PROCESS -// ---------------------------------------------------------------------- -$table_other->data[$row][0] = __('Custom values post process'); -$table_other->data[$row][1] = ''; -$table_other->data[$row][1] .= __('Value').': '.html_print_input_text('custom_value', '', '', 25, 50, true); -$table_other->data[$row][1] .= ' '.__('Text').': '.html_print_input_text('custom_text', '', '', 25, 50, true); -$table_other->data[$row][1] .= ' '; -$table_other->data[$row][1] .= html_print_input_hidden( - 'custom_value_add', - '', - true -); -$table_other->data[$row][1] .= html_print_button( - __('Add'), - 'custom_value_add_btn', - false, - '', - 'class="sub next"', - true -); - -$table_other->data[$row][1] .= '

'; - -$table_other->data[$row][1] .= __('Delete custom values').': '; -$table_other->data[$row][1] .= html_print_select( - post_process_get_custom_values(), - 'custom_values', - '', - '', - '', - '', - true -); -$count_custom_postprocess = post_process_get_custom_values(); -$table_other->data[$row][1] .= html_print_button( - __('Delete'), - 'custom_values_del_btn', - empty($count_custom_postprocess), - '', - 'class="sub cancel"', - true -); -// This hidden field will be filled from jQuery before submit -$table_other->data[$row][1] .= html_print_input_hidden( - 'custom_value_to_delete', - '', - true -); -$table_other->data[$row][1] .= '
'; -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// CUSTOM INTERVAL VALUES -// ---------------------------------------------------------------------- -$row++; -$table_other->data[$row][0] = __('Interval values'); -$units = [ - 1 => __('seconds'), - SECONDS_1MINUTE => __('minutes'), - SECONDS_1HOUR => __('hours'), - SECONDS_1DAY => __('days'), - SECONDS_1MONTH => __('months'), - SECONDS_1YEAR => __('years'), -]; -$table_other->data[$row][1] = __('Add new custom value to intervals').': '; -$table_other->data[$row][1] .= html_print_input_text('interval_value', '', '', 5, 5, true); -$table_other->data[$row][1] .= html_print_select($units, 'interval_unit', 1, '', '', '', true, false, false); -$table_other->data[$row][1] .= html_print_button(__('Add'), 'interval_add_btn', false, '', 'class="sub next"', true); -$table_other->data[$row][1] .= '

'; - -$table_other->data[$row][1] .= __('Delete interval').': '; -$table_other->data[$row][1] .= html_print_select(get_periods(false, false), 'intervals', '', '', '', '', true); -$table_other->data[$row][1] .= html_print_button(__('Delete'), 'interval_del_btn', empty($config['interval_values']), '', 'class="sub cancel"', true); - -$table_other->data[$row][1] .= html_print_input_hidden('interval_values', $config['interval_values'], true); -// This hidden field will be filled from jQuery before submit -$table_other->data[$row][1] .= html_print_input_hidden('interval_to_delete', '', true); -// ---------------------------------------------------------------------- -$row++; - -$common_dividers = [ - ';' => ';', - ',' => ',', - '|' => '|', -]; -$table_other->data[$row][0] = __('CSV divider'); -if ($config['csv_divider'] != ';' && $config['csv_divider'] != ',' && $config['csv_divider'] != '|') { - $table_other->data[$row][1] = html_print_input_text('csv_divider', $config['csv_divider'], '', 20, 255, true); - $table_other->data[$row][1] .= ''.html_print_image('images/default_list.png', true, ['id' => 'select']).''; -} else { - $table_other->data[$row][1] = html_print_select($common_dividers, 'csv_divider', $config['csv_divider'], '', '', '', true, false, false); - $table_other->data[$row][1] .= ''.html_print_image('images/pencil.png', true, ['id' => 'pencil']).''; -} - -$row++; - - -echo '
'; -echo ''.__('Other configuration').''; -html_print_table($table_other); -echo '
'; - - -echo '
'; -html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"'); -echo '
'; -echo ''; - -ui_require_css_file('color-picker', 'include/styles/js/'); -ui_require_jquery_file('colorpicker'); - - -function load_fonts() -{ - global $config; - - $home = str_replace('\\', '/', $config['homedir']); - $dir = scandir($home.'/include/fonts/'); - - $fonts = []; - - foreach ($dir as $file) { - if (strstr($file, '.ttf') !== false) { - $fonts[$home.'/include/fonts/'.$file] = $file; + $row++; + // ---------------------------------------------------------------------- + $dirItems = scandir($config['homedir'].'/images/custom_logo'); + foreach ($dirItems as $entryDir) { + if (strstr($entryDir, '.jpg') !== false || strstr($entryDir, '.png') !== false) { + $customLogos['images/custom_logo/'.$entryDir] = $entryDir; } } - return $fonts; -} + $_fonts = []; + $dirFonts = scandir(_MPDF_TTFONTPATH); + foreach ($dirFonts as $entryDir) { + if (strstr($entryDir, '.ttf') !== false) { + $_fonts[$entryDir] = $entryDir; + } + } + + // Font + $table_other->data['custom_report_front-font'][0] = __('Custom report front').' - '.__('Font family'); + $table_other->data['custom_report_front-font'][1] = html_print_select( + $_fonts, + 'custom_report_front_font', + $config['custom_report_front_font'], + false, + __('Default'), + '', + true + ); + + // Logo + $table_other->data['custom_report_front-logo'][0] = __('Custom report front').' - '.__('Custom logo').ui_print_help_tip( + __("The dir of custom logos is in your www Console in 'images/custom_logo'. You can upload more files (ONLY JPEG AND PNG) in upload tool in console."), + true + ); + $table_other->data['custom_report_front-logo'][1] = html_print_select( + $customLogos, + 'custom_report_front_logo', + io_safe_output($config['custom_report_front_logo']), + 'showPreview()', + __('Default'), + '', + true + ); + // Preview + $table_other->data['custom_report_front-preview'][0] = __('Custom report front').' - '.'Preview'; + if (empty($config['custom_report_front_logo'])) { + $config['custom_report_front_logo'] = 'images/pandora_logo_white.jpg'; + } + + $table_other->data['custom_report_front-preview'][1] = ''.html_print_image($config['custom_report_front_logo'], true).''; + + // Header + $table_other->data['custom_report_front-header'][0] = __('Custom report front').' - '.__('Header'); + $table_other->data['custom_report_front-header'][1] = html_print_textarea( + 'custom_report_front_header', + 5, + 15, + $config['custom_report_front_header'], + 'style="width: 38em;"', + true + ); + + // First page + $table_other->data['custom_report_front-first_page'][0] = __('Custom report front').' - '.__('First page'); + $custom_report_front_firstpage = str_replace( + '(_URLIMAGE_)', + ui_get_full_url(false, true, false, false), + $config['custom_report_front_firstpage'] + ); + $table_other->data['custom_report_front-first_page'][1] = html_print_textarea( + 'custom_report_front_firstpage', + 15, + 15, + $custom_report_front_firstpage, + 'style="width: 38em; height: 20em;"', + true + ); + + // Footer + $table_other->data['custom_report_front-footer'][0] = __('Custom report front').' - '.__('Footer'); + $table_other->data['custom_report_front-footer'][1] = html_print_textarea( + 'custom_report_front_footer', + 5, + 15, + $config['custom_report_front_footer'], + 'style="width: 38em;"', + true + ); -ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/'); -ui_require_javascript_file('pandora'); -?> + + $table_other->data[$row][0] = __('Show QR Code icon in the header'); + $table_other->data[$row][1] = html_print_checkbox_switch( + 'show_qr_code_header', + 1, + $config['show_qr_code_header'], + true + ); + $row++; + + $table_other->data[$row][0] = __('Custom graphviz directory').ui_print_help_tip(__('Custom directory where the graphviz binaries are stored.'), true); + $table_other->data[$row][1] = html_print_input_text( + 'graphviz_bin_dir', + $config['graphviz_bin_dir'], + '', + 50, + 255, + true + ); + + $row++; + + $table_other->data[$row][0] = __('Networkmap max width'); + $table_other->data[$row][1] = html_print_input_text( + 'networkmap_max_width', + $config['networkmap_max_width'], + '', + 10, + 20, + true + ); + $row++; + + + + $table_other->data[$row][0] = __('Show only the group name'); + $table_other->data[$row][0] .= ui_print_help_tip( + __('Show the group name instead the group icon.'), + true + ); + $table_other->data[$row][1] = html_print_checkbox_switch( + 'show_group_name', + 1, + $config['show_group_name'], + true + ); + $row++; + + $table_other->data[$row][0] = __('Date format string').ui_print_help_icon('date_format', true); + $table_other->data[$row][1] = ''.__('Example').' '.date($config['date_format']); + $table_other->data[$row][1] .= html_print_input_text('date_format', $config['date_format'], '', 30, 100, true); + $row++; + + if ($config['prominent_time'] == 'comparation') { + $timestamp = false; + $comparation = true; + } else if ($config['prominent_time'] == 'timestamp') { + $timestamp = true; + $comparation = false; + } + + $table_other->data[$row][0] = __('Timestamp or time comparation').ui_print_help_icon('time_stamp-comparation', true); + $table_other->data[$row][1] = __('Comparation in rollover').' '; + $table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'comparation', '', $comparation, true); + $table_other->data[$row][1] .= '
'.__('Timestamp in rollover').' '; + $table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'timestamp', '', $timestamp, true); + + $row++; + + // ---------------------------------------------------------------------- + // CUSTOM VALUES POST PROCESS + // ---------------------------------------------------------------------- + $table_other->data[$row][0] = __('Custom values post process'); + $table_other->data[$row][1] = ''; + $table_other->data[$row][1] .= __('Value').': '.html_print_input_text('custom_value', '', '', 25, 50, true); + $table_other->data[$row][1] .= ' '.__('Text').': '.html_print_input_text('custom_text', '', '', 25, 50, true); + $table_other->data[$row][1] .= ' '; + $table_other->data[$row][1] .= html_print_input_hidden( + 'custom_value_add', + '', + true + ); + $table_other->data[$row][1] .= html_print_button( + __('Add'), + 'custom_value_add_btn', + false, + '', + 'class="sub next"', + true + ); + + $table_other->data[$row][1] .= '

'; + + $table_other->data[$row][1] .= __('Delete custom values').': '; + $table_other->data[$row][1] .= html_print_select( + post_process_get_custom_values(), + 'custom_values', + '', + '', + '', + '', + true + ); + $count_custom_postprocess = post_process_get_custom_values(); + $table_other->data[$row][1] .= html_print_button( + __('Delete'), + 'custom_values_del_btn', + empty($count_custom_postprocess), + '', + 'class="sub cancel"', + true + ); + // This hidden field will be filled from jQuery before submit + $table_other->data[$row][1] .= html_print_input_hidden( + 'custom_value_to_delete', + '', + true + ); + $table_other->data[$row][1] .= '
'; + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- + // CUSTOM INTERVAL VALUES + // ---------------------------------------------------------------------- + $row++; + $table_other->data[$row][0] = __('Interval values'); + $units = [ + 1 => __('seconds'), + SECONDS_1MINUTE => __('minutes'), + SECONDS_1HOUR => __('hours'), + SECONDS_1DAY => __('days'), + SECONDS_1MONTH => __('months'), + SECONDS_1YEAR => __('years'), + ]; + $table_other->data[$row][1] = __('Add new custom value to intervals').': '; + $table_other->data[$row][1] .= html_print_input_text('interval_value', '', '', 5, 5, true); + $table_other->data[$row][1] .= html_print_select($units, 'interval_unit', 1, '', '', '', true, false, false); + $table_other->data[$row][1] .= html_print_button(__('Add'), 'interval_add_btn', false, '', 'class="sub next"', true); + $table_other->data[$row][1] .= '

'; + + $table_other->data[$row][1] .= __('Delete interval').': '; + $table_other->data[$row][1] .= html_print_select(get_periods(false, false), 'intervals', '', '', '', '', true); + $table_other->data[$row][1] .= html_print_button(__('Delete'), 'interval_del_btn', empty($config['interval_values']), '', 'class="sub cancel"', true); + + $table_other->data[$row][1] .= html_print_input_hidden('interval_values', $config['interval_values'], true); + // This hidden field will be filled from jQuery before submit + $table_other->data[$row][1] .= html_print_input_hidden('interval_to_delete', '', true); + // ---------------------------------------------------------------------- + $row++; + + $common_dividers = [ + ';' => ';', + ',' => ',', + '|' => '|', + ]; + $table_other->data[$row][0] = __('CSV divider'); + if ($config['csv_divider'] != ';' && $config['csv_divider'] != ',' && $config['csv_divider'] != '|') { + $table_other->data[$row][1] = html_print_input_text('csv_divider', $config['csv_divider'], '', 20, 255, true); + $table_other->data[$row][1] .= ''.html_print_image('images/default_list.png', true, ['id' => 'select']).''; + } else { + $table_other->data[$row][1] = html_print_select($common_dividers, 'csv_divider', $config['csv_divider'], '', '', '', true, false, false); + $table_other->data[$row][1] .= ''.html_print_image('images/pencil.png', true, ['id' => 'pencil']).''; + } + + $row++; + + + echo '
'; + echo ''.__('Other configuration').''; + html_print_table($table_other); + echo '
'; + + + echo '
'; + html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"'); + echo '
'; + echo ''; + + ui_require_css_file('color-picker', 'include/styles/js/'); + ui_require_jquery_file('colorpicker'); + + + function load_fonts() + { + global $config; + + $home = str_replace('\\', '/', $config['homedir']); + $dir = scandir($home.'/include/fonts/'); + + $fonts = []; + + foreach ($dir as $file) { + if (strstr($file, '.ttf') !== false) { + $fonts[$home.'/include/fonts/'.$file] = $file; + } + } + + return $fonts; + } + + + ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/'); + ui_require_javascript_file('pandora'); + + ?>