From b3975d1797c9cdeaae0e754fa2db6aa617360183 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 25 Jan 2010 15:29:33 +0000 Subject: [PATCH] 2010-01-25 Miguel de Dios * pandoradb.sql: add the group column for SLA purposes. * operation/agentes/gis_view.php: page for GIS data in agents view. * operation/agentes/ver_agente.php: add the tab for GIS data. * operation/menu.php, godmode/menu.php: change the lines for show the entries in menu, now show the entries gis when it's set on. * godmode/setup/setup.php: add the field to set on or off the GIS features in the Pandora Console. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2303 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 +++ pandora_console/godmode/menu.php | 13 ++-- pandora_console/godmode/setup/setup.php | 4 ++ .../operation/agentes/gis_view.php | 29 +++++++++ .../operation/agentes/ver_agente.php | 62 ++++++++++++------- pandora_console/operation/menu.php | 42 +++++++------ pandora_console/pandoradb.sql | 1 + 7 files changed, 112 insertions(+), 49 deletions(-) create mode 100644 pandora_console/operation/agentes/gis_view.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 960b4fd718..8d82fec6c5 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2010-01-25 Miguel de Dios + + * pandoradb.sql: add the group column for SLA purposes. + * operation/agentes/gis_view.php: page for GIS data in agents view. + * operation/agentes/ver_agente.php: add the tab for GIS data. + * operation/menu.php, godmode/menu.php: change the lines for show the + entries in menu, now show the entries gis when it's set on. + * godmode/setup/setup.php: add the field to set on or off the GIS features + in the Pandora Console. + 2010-01-25 Miguel de Dios * include/config_process.php: small fix for to erase a alert message in php diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 9d6a422efa..140aafa4a3 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -122,10 +122,12 @@ if (give_acl ($config['id_user'], 0, "IW")) { $menu["gmap"]["sec2"] = "godmode/reporting/map_builder"; $menu["gmap"]["id"] = "god-map"; - $menu["godgismaps"]["text"] = __('GIS Maps'); - $menu["godgismaps"]["sec2"] = "godmode/gis_maps/index"; - $menu["godgismaps"]["refr"] = 60; - $menu["godgismaps"]["id"] = "god-gismaps"; + if ($config['activate_gis']) { + $menu["godgismaps"]["text"] = __('GIS Maps'); + $menu["godgismaps"]["sec2"] = "godmode/gis_maps/index"; + $menu["godgismaps"]["refr"] = 60; + $menu["godgismaps"]["id"] = "god-gismaps"; + } } if (give_acl ($config['id_user'], 0, "PM")) { @@ -166,7 +168,8 @@ if (give_acl ($config['id_user'], 0, "PM")) { $sub = array (); - $sub["godmode/setup/gis"]["text"] = __('Map GIS'); + if ($config['activate_gis']) + $sub["godmode/setup/gis"]["text"] = __('Map GIS'); $sub["godmode/setup/setup_visuals"]["text"] = __('Visual styles'); $sub["godmode/setup/file_manager"]["text"] = __('File manager'); $sub["godmode/setup/links"]["text"] = __('Links'); diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 1399f39fb2..9a1aa657b4 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -119,6 +119,10 @@ $table->data[15][0] = __('IP list with API access') . $list_ACL_IPs_for_API = get_parameter('list_ACL_IPs_for_API', implode("\n", $config['list_ACL_IPs_for_API'])); $table->data[15][1] = print_textarea('list_ACL_IPs_for_API', 10, 15, $list_ACL_IPs_for_API, null, true); +$table->data[16][0] = __('Enable GIS features in Pandora Console'); +$table->data[16][1] = __('Yes').' '.print_radio_button ('activate_gis', 1, '', $config["activate_gis"], true).'  '; +$table->data[16][1] .= __('No').' '.print_radio_button ('activate_gis', 0, '', $config["activate_gis"], true); + enterprise_hook ('setup'); echo '
'; diff --git a/pandora_console/operation/agentes/gis_view.php b/pandora_console/operation/agentes/gis_view.php new file mode 100644 index 0000000000..5f6f8023d9 --- /dev/null +++ b/pandora_console/operation/agentes/gis_view.php @@ -0,0 +1,29 @@ + \ No newline at end of file diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index ef1589fea3..45bca3f063 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -253,36 +253,50 @@ echo ""; + } else { + echo "
  • "; + } + echo " "; + echo "
  • "; +} + echo ""; echo ""; echo ""; echo "
    "; switch ($tab) { -case "sla": - require ("sla_view.php"); - break; -case "manage": - require ("estado_generalagente.php"); - break; -case "main": - require ("estado_generalagente.php"); - require ("estado_monitores.php"); - require ("alerts_status.php"); - require ("status_events.php"); - break; -case "data_view": - require ("datos_agente.php"); - break; -case "data": - require ("estado_ultimopaquete.php"); - break; -case "alert": - require ("alerts_status.php"); - break; -case "inventory": - enterprise_include ('operation/agentes/agent_inventory.php'); - break; + case "gis": + require ("gis_view.php"); + break; + case "sla": + require ("sla_view.php"); + break; + case "manage": + require ("estado_generalagente.php"); + break; + case "main": + require ("estado_generalagente.php"); + require ("estado_monitores.php"); + require ("alerts_status.php"); + require ("status_events.php"); + break; + case "data_view": + require ("datos_agente.php"); + break; + case "data": + require ("estado_ultimopaquete.php"); + break; + case "alert": + require ("alerts_status.php"); + break; + case "inventory": + enterprise_include ('operation/agentes/agent_inventory.php'); + break; } ?> diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 7f20729f1d..20210ebc4a 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -61,28 +61,30 @@ if (give_acl ($config['id_user'], 0, "AR")) { //End of view agents //INI GIS Maps - $menu["gismaps"]["text"] = __('GIS Maps'); - $menu["gismaps"]["sec2"] = "operation/gis_maps/index"; - $menu["gismaps"]["refr"] = 60; - $menu["gismaps"]["id"] = "oper-gismaps"; - - $sub = array (); - - $gisMaps = get_db_all_rows_in_table ('tgis_map', 'map_name'); - if ($gisMaps === false) { - $gisMaps = array (); - } - $id = (int) get_parameter ('id', -1); - - foreach ($gisMaps as $gisMap) { - if (! give_acl ($config["id_user"], $gisMap["group_id"], "AR")) { - continue; + if ($config['activate_gis']) { + $menu["gismaps"]["text"] = __('GIS Maps'); + $menu["gismaps"]["sec2"] = "operation/gis_maps/index"; + $menu["gismaps"]["refr"] = 60; + $menu["gismaps"]["id"] = "oper-gismaps"; + + $sub = array (); + + $gisMaps = get_db_all_rows_in_table ('tgis_map', 'map_name'); + if ($gisMaps === false) { + $gisMaps = array (); } - $sub["operation/gis_maps/render_view&id=".$gisMap["id_tgis_map"]]["text"] = mb_substr ($gisMap["map_name"], 0, 15); - $sub["operation/gis_maps/render_view&id=".$gisMap["id_tgis_map"]]["refr"] = 0; + $id = (int) get_parameter ('id', -1); + + foreach ($gisMaps as $gisMap) { + if (! give_acl ($config["id_user"], $gisMap["group_id"], "AR")) { + continue; + } + $sub["operation/gis_maps/render_view&id=".$gisMap["id_tgis_map"]]["text"] = mb_substr ($gisMap["map_name"], 0, 15); + $sub["operation/gis_maps/render_view&id=".$gisMap["id_tgis_map"]]["refr"] = 0; + } + + $menu["gismaps"]["sub"] = $sub; } - - $menu["gismaps"]["sub"] = $sub; //END GIS Maps //Visual console diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 6a16bd244f..1f4c7b1452 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -917,6 +917,7 @@ CREATE TABLE IF NOT EXISTS `tgis_map_connection` ( `initial_longitude` DOUBLE NULL COMMENT 'longitude of the center of the map when it\'s loaded' , `initial_latitude` DOUBLE NULL COMMENT 'latitude of the center of the map when it\'s loaded' , `initial_altitude` DOUBLE NULL COMMENT 'altitude of the center of the map when it\'s loaded' , + `group_id` INT(10) NOT NULL DEFAULT 0 COMMENT 'Group that owns the map', PRIMARY KEY (`id_tmap_connection`) ) ENGINE = InnoDB COMMENT = 'Table to store the map connection information';