From 8c1f0183e5c414441dcc5cadaac62adf4ac1c699 Mon Sep 17 00:00:00 2001 From: esanchezm Date: Tue, 12 Aug 2008 14:41:53 +0000 Subject: [PATCH] 2008-08-12 Esteban Sanchez * godmode/db/db_purge.php: Use print_help_tip() to show help tip. * godmode/profiles/profile_list.php: Use print_help_tip(). Removed deprecated $help_label. * godmode/users/configure_user.php: Better code to show user level radio buttons and help. * include/functions_db.php: Removed deprecated function load_lang_file(). * operation/agentes/datos_agente.php, ajax.php, operation/reporting/reporting_viewer_pdf.php, reporting/stat_win.php, operation/agentes/exportdata.php: Removed inclusion of old language files. * include/languages/index.pot: Regenerated and added header. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1009 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 22 ++++- pandora_console/ajax.php | 9 -- pandora_console/godmode/db/db_purge.php | 5 +- .../godmode/profiles/profile_list.php | 97 ++++++++++--------- .../godmode/users/configure_user.php | 14 +-- pandora_console/include/functions_db.php | 15 --- pandora_console/include/languages/index.pot | 78 +++++++-------- .../operation/agentes/datos_agente.php | 3 +- .../operation/agentes/exportdata.php | 2 +- .../reporting/reporting_viewer_pdf.php | 1 - pandora_console/reporting/stat_win.php | 1 - 11 files changed, 122 insertions(+), 125 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c3c0142d7f..a857615d5c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,6 +1,26 @@ +2008-08-12 Esteban Sanchez + + * godmode/db/db_purge.php: Use print_help_tip() to show help tip. + + * godmode/profiles/profile_list.php: Use print_help_tip(). Removed + deprecated $help_label. + + * godmode/users/configure_user.php: Better code to show user level + radio buttons and help. + + * include/functions_db.php: Removed deprecated function + load_lang_file(). + + * operation/agentes/datos_agente.php, ajax.php, + operation/reporting/reporting_viewer_pdf.php, reporting/stat_win.php, + operation/agentes/exportdata.php: Removed inclusion of old + language files. + + * include/languages/index.pot: Regenerated and added header. + 2008-08-12 Evi Vanoost - * operation/menu.php: Made short tag, normal tag + * operation/menu.php: Made short tag, normal tag * include/functions.php: Got rid of references to language files diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index c58b8bbca6..fce9c4738c 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -20,20 +20,11 @@ // Silk icon set 1.3 (cc) Mark James, http://www.famfamfam.com/lab/icons/silk/ // Pandora FMS uses Pear Image::Graph code - if ((! file_exists("include/config.php")) || (! is_readable("include/config.php"))) { exit; } require_once ('include/config.php'); - -// Check for correct language file presence -if (file_exists ('include/languages/language_'.$config['language'].'.php')) { - include 'include/languages/language_'.$config['language'].'.php'; -} else { - include "include/languages/language_en.php"; -} - require_once ('include/functions.php'); require_once ('include/functions_db.php'); diff --git a/pandora_console/godmode/db/db_purge.php b/pandora_console/godmode/db/db_purge.php index 8825986ab5..5cd0d85052 100644 --- a/pandora_console/godmode/db/db_purge.php +++ b/pandora_console/godmode/db/db_purge.php @@ -119,9 +119,10 @@ while ($row=mysql_fetch_array($result_t)){ } ?> -  + + '> -  +
".__('Profile successfully created').""; else { @@ -205,49 +205,50 @@ if (isset ($id_perfil)){ // There are values defined, let's show form with data echo ""; } else { // View list data - $color=1; - ?> - - "; + + $sql = "SELECT * FROM tperfil"; + $result = mysql_query ($sql); echo ""; echo ""; - while ($rowdup=mysql_fetch_array($resq1)){ - $id_perfil = $rowdup["id_perfil"]; - $nombre=$rowdup["name"]; - $incident_view = $rowdup["incident_view"]; - $incident_edit = $rowdup["incident_edit"]; - $incident_management = $rowdup["incident_management"]; - $agent_view = $rowdup["agent_view"]; - $agent_edit =$rowdup["agent_edit"]; - $alert_edit = $rowdup["alert_edit"]; - $user_management = $rowdup["user_management"]; - $db_management = $rowdup["db_management"]; - $alert_management = $rowdup["alert_management"]; - $pandora_management = $rowdup["pandora_management"]; - if ($color == 1){ + + while (profile = mysql_fetch_array ($result)) { + $id_perfil = profile["id_perfil"]; + $nombre=profile["name"]; + $incident_view = profile["incident_view"]; + $incident_edit = profile["incident_edit"]; + $incident_management = profile["incident_management"]; + $agent_view = profile["agent_view"]; + $agent_edit =profile["agent_edit"]; + $alert_edit = profile["alert_edit"]; + $user_management = profile["user_management"]; + $db_management = profile["db_management"]; + $alert_management = profile["alert_management"]; + $pandora_management = profile["pandora_management"]; + + if ($color == 1) { $tdcolor = "datos"; $color = 0; } @@ -289,12 +290,12 @@ if (isset ($id_perfil)){ // There are values defined, let's show form with data echo ""; } - echo "
".__('Profiles'); - echo " - IR ".__("System Incidents Reading rights").""; - echo " - IW ".__("System Incidents Writing rights").""; - echo " - IM ".__("System Incidents Management rights").""; - echo " - AR ".__("Agents Reading rights").""; - echo " - AW ".__("Agents Writing rights").""; - echo " - LW ".__("Alerts Edition rights").""; - echo " - UM ".__("Users Management rights").""; - echo " - DM ".__("Database Management rights").""; - echo " - LM ".__("Alerts Management rights").""; - echo " - PM ".__("Pandora System Management rights").""; + echo "IR"; + print_help_tip (__('System incidents reading')); + echo "IW"; + print_help_tip (__('System incidents writing')); + echo "IM"; + print_help_tip (__('System incidents management')); + echo "AR"; + print_help_tip (__('Agents reading')); + echo "AW"; + print_help_tip (__('Agents management')); + echo "LW"; + print_help_tip (__('Alerts edition')); + echo "UM"; + print_help_tip (__('Users management')); + echo "DM"; + print_help_tip (__('Database management')); + echo "LM"; + print_help_tip (__('Alerts anagement')); + echo "PM"; + print_help_tip (__('Pandora system management')); echo "".__('Delete')."
"; - echo ''; - echo ''; - echo '
'; - echo "
"; - echo ""; - echo "
"; + echo ""; + echo ''; + echo ''; + echo '
'; + echo "
"; + echo ""; + echo "
"; } ?> diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 6952278029..9cba50eac5 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -197,14 +197,14 @@ echo 'E-Mail';  '.$help_label["users_msg1"].' '; - echo __('Standard user').' '.$help_label["users_msg2"].''; -} else { - echo __('Administrator').' '.$help_label["users_msg1"].' '; - echo __('Standard user').' '.$help_label["users_msg2"].''; -} +echo __('Administrator'); +print_radio_button ('nivel', '1', '', $nivel); +print_help_tip (__("This user has permissions to manage all. This is admin user and overwrites all permissions given in profiles/groups")); +print __('Standard user'); +print_radio_button ('nivel', '0', '', $nivel); +print_help_tip (__("This user has separated permissions to view data in his group agents, create incidents belong to his groups, add notes in another incidents, create personal assignments or reviews and other tasks, on different profiles")); ?> + diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 8698740154..c06d92aef1 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1716,21 +1716,6 @@ function get_agent_module_value_sumatory ($id_agent_module, $period, $date = 0) return (float) $sum; } - -/** - * Loads a language file. - * - * Check existance of file. - * - * @param file Filename of language definitions to load. - */ -function load_lang_file ($file) { - global $config; - - if (file_exists ($file)) - require_once ($config["homedir"]."/include/languages/language_".$config["language"].".php"); -} - /** * Get a translated string (alias version of lang_string(). * diff --git a/pandora_console/include/languages/index.pot b/pandora_console/include/languages/index.pot index 49d8797791..25555a50d9 100644 --- a/pandora_console/include/languages/index.pot +++ b/pandora_console/include/languages/index.pot @@ -1,17 +1,23 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# Pandora Flexible Monitor System +# Copyright (C) 2005-2008 Artica Soluciones Tecnologicas S.L, info@artica.es # This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# Sancho Lerena, slerena@artica.es, 2005 +# Raul Mateos, raulofpandora@gmail.com, 2005 +# Esteban Sanchez, estebans@artica.es, 2006 +# Jorge Gonzalez, jorge.gonzalez@artica.es, 2008 +# Ramon Novoa, ramon.novoa@artica.es, 2008 +# Evi Vanoost, vanooste@rcbi.rochester.edu, 2008 + # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: Pandora FMS 2.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-08-12 13:52+0200\n" +"POT-Creation-Date: 2008-08-12 15:43+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: en \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" @@ -91,7 +97,7 @@ msgid "Critical" msgstr "" #: ../../reporting/fgraph.php:1342 ../../operation/events/events.php:412 -#: ../../include/functions.php:1119 ../../include/functions_db.php:1996 +#: ../../include/functions.php:1119 ../../include/functions_db.php:1981 msgid "System" msgstr "" @@ -311,7 +317,7 @@ msgstr "" #: ../../operation/agentes/estado_alertas.php:57 #: ../../operation/servers/view_server.php:53 #: ../../include/functions_reporting_pdf.php:329 -#: ../../include/functions_db.php:1790 +#: ../../include/functions_db.php:1775 msgid "Name" msgstr "" @@ -478,7 +484,7 @@ msgstr "" #: ../../operation/agentes/estado_alertas.php:288 #: ../../operation/servers/view_server.php:59 #: ../../include/functions_reporting.php:485 -#: ../../include/functions_db.php:1906 +#: ../../include/functions_db.php:1891 msgid "Type" msgstr "" @@ -1140,7 +1146,7 @@ msgstr "" #: ../../godmode/servers/manage_recontask_form.php:160 #: ../../godmode/servers/manage_recontask_form.php:163 #: ../../include/functions.php:800 ../../include/functions.php:889 -#: ../../include/functions_db.php:1862 +#: ../../include/functions_db.php:1847 msgid "No" msgstr "" @@ -1149,7 +1155,7 @@ msgstr "" #: ../../godmode/servers/manage_recontask_form.php:159 #: ../../godmode/servers/manage_recontask_form.php:164 #: ../../include/functions.php:798 ../../include/functions.php:887 -#: ../../include/functions_db.php:1860 +#: ../../include/functions_db.php:1845 msgid "Yes" msgstr "" @@ -1388,7 +1394,7 @@ msgstr "" #: ../../operation/events/events.php:306 #: ../../operation/snmpconsole/snmp_view.php:202 #: ../../include/functions_reporting.php:241 -#: ../../include/functions_db.php:1909 +#: ../../include/functions_db.php:1894 msgid "User ID" msgstr "" @@ -1466,7 +1472,7 @@ msgstr "" #: ../../godmode/agentes/modificar_agente.php:195 #: ../../operation/events/events.php:303 #: ../../operation/agentes/estado_generalagente.php:61 -#: ../../include/functions_db.php:1908 +#: ../../include/functions_db.php:1893 msgid "Agent name" msgstr "" @@ -1898,8 +1904,8 @@ msgstr "" #: ../../godmode/setup/news.php:99 ../../include/functions.php:783 #: ../../include/functions.php:807 ../../include/functions.php:896 -#: ../../include/functions.php:940 ../../include/functions_db.php:1846 -#: ../../include/functions_db.php:1868 +#: ../../include/functions.php:940 ../../include/functions_db.php:1831 +#: ../../include/functions_db.php:1853 msgid "Text" msgstr "" @@ -1915,7 +1921,7 @@ msgstr "" #: ../../operation/agentes/estado_ultimopaquete.php:56 #: ../../operation/snmpconsole/snmp_view.php:203 #: ../../include/functions_reporting.php:242 -#: ../../include/functions_db.php:1910 +#: ../../include/functions_db.php:1895 #: ../../extensions/update_manager/main.php:56 msgid "Timestamp" msgstr "" @@ -2250,7 +2256,7 @@ msgstr "" #: ../../include/functions_reporting.php:562 #: ../../include/functions_reporting.php:587 ../../include/functions.php:714 #: ../../include/functions.php:719 ../../include/functions.php:722 -#: ../../include/functions_db.php:1840 +#: ../../include/functions_db.php:1825 msgid "N/A" msgstr "" @@ -2426,7 +2432,7 @@ msgstr "" #: ../../godmode/agentes/alert_manager_editor.php:365 #: ../../godmode/agentes/alert_manager.php:182 -#: ../../include/functions_db.php:1791 +#: ../../include/functions_db.php:1776 msgid "Oper" msgstr "" @@ -2454,7 +2460,7 @@ msgstr "" #: ../../godmode/agentes/alert_manager_editor.php:369 #: ../../godmode/agentes/alert_manager.php:110 #: ../../godmode/agentes/alert_manager.php:186 -#: ../../include/functions_db.php:1794 +#: ../../include/functions_db.php:1779 msgid "Time" msgstr "" @@ -2570,10 +2576,6 @@ msgstr "" msgid "To Agent(s):" msgstr "" -#: ../../godmode/agentes/manage_config_remote.php:141 -msgid "Replicate configuration" -msgstr "" - #: ../../godmode/agentes/module_manager_editor_plugin.php:79 msgid "Plugin server module" msgstr "" @@ -2749,7 +2751,7 @@ msgstr "" #: ../../operation/snmpconsole/snmp_view.php:204 #: ../../operation/snmpconsole/snmp_alert.php:143 #: ../../operation/snmpconsole/snmp_alert.php:262 -#: ../../include/functions_db.php:1998 +#: ../../include/functions_db.php:1983 msgid "Alert" msgstr "" @@ -3731,13 +3733,13 @@ msgstr "" msgid "RSS Events" msgstr "" -#: ../../operation/events/events.php:300 ../../include/functions_db.php:1905 +#: ../../operation/events/events.php:300 ../../include/functions_db.php:1890 msgid "St" msgstr "" #: ../../operation/events/events.php:302 #: ../../include/functions_reporting.php:240 -#: ../../include/functions_db.php:1907 +#: ../../include/functions_db.php:1892 msgid "Event name" msgstr "" @@ -4271,7 +4273,7 @@ msgstr "" #: ../../operation/agentes/estado_alertas.php:256 #: ../../operation/agentes/estado_alertas.php:279 #: ../../include/functions.php:953 ../../include/functions.php:1114 -#: ../../include/functions_db.php:1880 +#: ../../include/functions_db.php:1865 msgid "Alert fired" msgstr "" @@ -4280,7 +4282,7 @@ msgstr "" #: ../../operation/agentes/estado_alertas.php:191 #: ../../operation/agentes/estado_alertas.php:258 #: ../../operation/agentes/estado_alertas.php:281 -#: ../../include/functions.php:964 ../../include/functions_db.php:1882 +#: ../../include/functions.php:964 ../../include/functions_db.php:1867 msgid "Alert not fired" msgstr "" @@ -4654,7 +4656,7 @@ msgid "months" msgstr "" #: ../../include/functions.php:825 ../../include/functions.php:912 -#: ../../include/functions_db.php:1796 +#: ../../include/functions_db.php:1781 msgid "Recovery" msgstr "" @@ -4719,31 +4721,31 @@ msgstr "" msgid "Wrong module type" msgstr "" -#: ../../include/functions_db.php:1792 +#: ../../include/functions_db.php:1777 msgid "Tt" msgstr "" -#: ../../include/functions_db.php:1793 +#: ../../include/functions_db.php:1778 msgid "Firing" msgstr "" -#: ../../include/functions_db.php:1795 +#: ../../include/functions_db.php:1780 msgid "Desc" msgstr "" -#: ../../include/functions_db.php:1797 +#: ../../include/functions_db.php:1782 msgid "MinMax.Al" msgstr "" -#: ../../include/functions_db.php:1798 +#: ../../include/functions_db.php:1783 msgid "Days" msgstr "" -#: ../../include/functions_db.php:1799 +#: ../../include/functions_db.php:1784 msgid "Fired" msgstr "" -#: ../../include/functions_db.php:1903 +#: ../../include/functions_db.php:1888 msgid "Latest events" msgstr "" @@ -4760,12 +4762,12 @@ msgstr "" msgid "More info" msgstr "" -#: ../../extensions/update_manager.php:88 +#: ../../extensions/update_manager.php:86 #: ../../extensions/update_manager/main.php:14 msgid "Update manager" msgstr "" -#: ../../extensions/update_manager.php:89 +#: ../../extensions/update_manager.php:87 msgid "Update manager settings" msgstr "" diff --git a/pandora_console/operation/agentes/datos_agente.php b/pandora_console/operation/agentes/datos_agente.php index 9e3bae32bb..755baedf39 100644 --- a/pandora_console/operation/agentes/datos_agente.php +++ b/pandora_console/operation/agentes/datos_agente.php @@ -29,9 +29,8 @@ if (give_acl ($config['id_user'], 0, "AR")!=1) { exit; } -function datos_raw ($id_agente_modulo, $periodo){ +function datos_raw ($id_agente_modulo, $periodo) { global $config; - require("include/languages/language_".$config["language"].".php"); $periodo_label = $periodo; switch ($periodo) { diff --git a/pandora_console/operation/agentes/exportdata.php b/pandora_console/operation/agentes/exportdata.php index 53d3890b9b..c7bf508e38 100644 --- a/pandora_console/operation/agentes/exportdata.php +++ b/pandora_console/operation/agentes/exportdata.php @@ -56,7 +56,7 @@ function give_average_from_module ($id_agente, $id_agente_modulo, $hour, $day, $ function generate_average_table ($id_de_mi_agente, $id_agente_modulo, $fecha_inicio, $fecha_fin){ // Genera una tabla con los promedios de los datos de un módulo no-string require ("include/config.php"); - require ("include/languages/language_".$language_code.".php"); + $dias_de_la_semana = array (__('Sunday'),__('Monday'), __('Tuesday'), __('Wednesday'), __('Thurdsday'), __('Friday'), __('Saturday')); $nombre_modulo = dame_nombre_modulo_agentemodulo($id_agente_modulo); diff --git a/pandora_console/operation/reporting/reporting_viewer_pdf.php b/pandora_console/operation/reporting/reporting_viewer_pdf.php index 0badab6b95..becc1a92fa 100644 --- a/pandora_console/operation/reporting/reporting_viewer_pdf.php +++ b/pandora_console/operation/reporting/reporting_viewer_pdf.php @@ -21,7 +21,6 @@ require ("../../include/config.php"); require_once ("../../include/functions.php"); require_once ("../../include/functions_db.php"); -require_once ("../../include/languages/language_".$config["language"].".php"); require_once ("../../include/functions_reporting_pdf.php"); if (! isset ($_SESSION["id_usuario"])) { diff --git a/pandora_console/reporting/stat_win.php b/pandora_console/reporting/stat_win.php index 4ca8c770ea..e3a358ea33 100644 --- a/pandora_console/reporting/stat_win.php +++ b/pandora_console/reporting/stat_win.php @@ -29,7 +29,6 @@ if (! isset($_SESSION["id_user"])) { require_once ('../include/functions.php'); require_once ('../include/functions_db.php'); -require_once ('../include/languages/language_'.$config['language'].'.php'); check_login ();