diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8aac9f1552..565c43542b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,29 @@ +2009-02-12 Evi Vanoost + + * include/footer.php, general/links_menu.php: _new is invalid. Use _blank + + * include/config_process.php: Updated error texts for better English + + * include/calendar.php: Removed since nobody uses it anymore + + * include/functions.php: Modified process_page_header to not load + wz_jsgraphics by default (it's too heavy and hardly used). Deprecated + no_permission and unmanaged_error (since they're not used) + + * include/styles/timeentry.css, include/styles/pandora.css, + include/styles/ie.css: Merged these styles together so there is no extra + query for 2 css classes + + * operation/reporting/reporting_viewer.php: Removed comparison since + time comes from the client and if the clock is a bit off it gives error. + Also removed reference to timeentry.css + + * godmode/alerts/alert_list.php: Uses new method to load css and jquery + which prevents error of tags being in body + + * godmode/agentes/planned_downtime.php: Removed timeentry reference and + fixed HTML in between. + 2009-02-12 Esteban Sanchez * include/javascript/jquery.tablesorter.js, diff --git a/pandora_console/general/footer.php b/pandora_console/general/footer.php index 2ca6ebbacd..ae71d432b7 100644 --- a/pandora_console/general/footer.php +++ b/pandora_console/general/footer.php @@ -23,7 +23,7 @@ if (isset($_SERVER['REQUEST_TIME'])) { $time = get_system_time (); } -echo 'Pandora FMS '.$pandora_version.' - Build '.$build_version.'
'; +echo 'Pandora FMS '.$pandora_version.' - Build '.$build_version.'
'; echo ''. __('Page generated at') . ' '. print_timestamp ($time, true, array ("prominent" => "timestamp")); //Always use timestamp here if ((isset($develop_bypass)) AND ($develop_bypass == 1)) { diff --git a/pandora_console/general/links_menu.php b/pandora_console/general/links_menu.php index c439144c41..a7e948b90b 100644 --- a/pandora_console/general/links_menu.php +++ b/pandora_console/general/links_menu.php @@ -21,7 +21,7 @@ if ($result !== false) { echo '
:: '.__('Links').' ::
'; echo '
'; } diff --git a/pandora_console/godmode/agentes/planned_downtime.php b/pandora_console/godmode/agentes/planned_downtime.php index 64e8c154ec..4cd538e7d8 100644 --- a/pandora_console/godmode/agentes/planned_downtime.php +++ b/pandora_console/godmode/agentes/planned_downtime.php @@ -152,7 +152,7 @@ if ($create_downtime || $update_downtime) { $table->data[4][1] = print_input_text ('date_to', $date_to, '', 10, 10, true); $table->data[4][1] .= print_input_text ('time_to', $time_to, '', 7, 7, true); - echo '
'; + echo ''; if ($id_downtime > 0){ echo ""; @@ -160,7 +160,7 @@ if ($create_downtime || $update_downtime) { } //Editor form - echo '

'.__('Planned Downtime Form').'

'; + echo '

'.__('Planned Downtime Form').' help

'; print_table ($table); @@ -201,14 +201,14 @@ if ($create_downtime || $update_downtime) { echo ""; print_select_from_sql ("SELECT id_grupo, nombre FROM tgrupo WHERE id_grupo > 1", "filter_group", $filter_group, '', __("Any"), -1, false, false); - echo "

"; + echo "

"; echo print_submit_button (__('Filter by group'), '', false, 'class="sub next"',false); echo ""; echo ""; echo print_select ($data, "id_agent[]", '', '', '', 0, false, true); - echo "


"; + echo "


"; echo print_submit_button (__('Add'), '', false, 'class="sub next"',false); echo ""; echo "
"; @@ -246,9 +246,9 @@ if ($create_downtime || $update_downtime) { $data[3] = $downtime["ultimo_contacto"]; - $data[4] = ' - '.__('Delete').''; + $data[4] = ' + '.__('Delete').''; array_push ($table->data, $data); @@ -276,8 +276,7 @@ if ($create_downtime || $update_downtime) { $downtimes = get_db_all_rows_sql ($sql); if (!$downtimes) { echo '
'.__('No planned downtime').'
'; - } - else { + } else { foreach ($downtimes as $downtime) { $data = array(); $total = get_db_sql ("SELECT COUNT(id_agent) FROM tplanned_downtime_agents WHERE id_downtime = ".$downtime["id"]); @@ -287,16 +286,16 @@ if ($create_downtime || $update_downtime) { $data[2] = date ("Y-m-d H:i", $downtime['date_from']); $data[3] = date ("Y-m-d H:i", $downtime['date_to']); if ($downtime["executed"] == 0){ - $data[4] = ' - '.__('Delete').''; - $data[5] = ' - '.__('Update').''; + $data[4] = ' + '.__('Delete').''; + $data[5] = ' + '.__('Update').''; } if ($downtime["executed"] == 0) - $data[6] = ""; + $data[6] = print_image ("images/pixel_green.png", true, array ('width' => 20, 'height' => 20, 'alt' => __('Executed'))); else - $data[6] = ""; + $data[6] = print_image ("images/pixel_green.png", true, array ('width' => 20, 'height' => 20, 'alt' => __('Not executed'))); array_push ($table->data, $data); } @@ -304,14 +303,14 @@ if ($create_downtime || $update_downtime) { } echo '
'; - echo "
"; - echo ""; - echo ""; - echo "
"; + echo '
'; + print_input_hidden ("first_create", 1); + print_submit_button (__('Create'), 'create', false, 'class="sub wand"'); + echo '
'; + echo '
'; } $config['css'][] = 'datepicker'; -$config['css'][] 'timeentry'; $config['jquery'][] = 'ui.core'; $config['jquery'][] = 'ui.datepicker'; $config['jquery'][] = 'timeentry'; @@ -325,6 +324,6 @@ $(document).ready (function () { spinnerSize: [20, 20, 0] }); $("#text-date_from, #text-date_to").datepicker (); - $.datepicker.regional[""]; + $.datepicker.regional[""]; }); diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 28389feda9..dbdb4514ba 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -58,6 +58,7 @@ $agents = get_group_agents (array_keys ($groups), false, "none"); $simple_alerts = array (); $compound_alerts = array (); + foreach ($agents as $agent_id => $agent_name) { $agent_alerts = get_agent_alerts_simple ($agent_id); if (! empty ($agent_alerts)) @@ -116,12 +117,12 @@ foreach ($simple_alerts as $agent_id => $alerts) { print_table ($table); } + +$config['css'][] = "cluetip"; //link tags can't go in body +$config['jquery'][] = "cluetip"; //make sure it doesn't get overwritten +$config['jquery'][] = "form"; + ?> - - - - - diff --git a/pandora_console/include/calendar.php b/pandora_console/include/calendar.php deleted file mode 100644 index aac59740bc..0000000000 --- a/pandora_console/include/calendar.php +++ /dev/null @@ -1,54 +0,0 @@ -, 2006 - -function generate_calendar($year, $month, $days = array(), $day_name_length = 3, $month_href = NULL, $locale = ''){ - $first_day = 1; //Monday first day of week. - $first_of_month = gmmktime(0,0,0,$month,1,$year); - #remember that mktime will automatically correct if invalid dates are entered - # for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998 - # this provides a built in "rounding" feature to generate_calendar() - setlocale(LC_TIME, $locale); - $day_names = array(); #generate all the day names according to the current locale - for($n=0,$t=(3+$first_day)*86400; $n<7; $n++,$t+=86400) #January 4, 1970 was a Sunday - $day_names[$n] = ucfirst(gmstrftime('%A',$t)); #%A means full textual day name - list($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month)); - $weekday = ($weekday + 7 - $first_day) % 7; #adjust for $first_day - $title = htmlentities(ucfirst($month_name)).' '.$year; - #note that some locales don't capitalize month and day names - - #Begin calendar. Uses a real . See http://diveintomark.org/archives/2002/07/03 - $calendar = ''."\n". - '\n"; - - if($day_name_length){ #if the day names should be shown ($day_name_length > 0) - #if day_name_length is >3, the full name of the day will be printed - foreach($day_names as $d) - $calendar .= ''; - $calendar .= "\n"; - } - - if($weekday > 0) $calendar .= ''; #initial 'empty' days - for($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){ - - if($weekday == 7){ - $weekday = 0; #start a new week - $calendar .= "\n"; - } - if(isset($days[$day]) and is_array($days[$day])){ - @list($link, $classes, $content) = $days[$day]; - if(is_null($content)) $content = $day; - if($weekday==6){ $classes='datos2';} - $calendar .= '' : '>'). - ($link ? ''.$content.'' : $content).''; - } - else $calendar .= ""; - } - if($weekday != 7) $calendar .= ''; #remaining "empty" days - - return $calendar."\n
'.($month_href ? ''.$title.'' : $title)."
'.htmlentities($day_name_length < 4 ? substr($d,0,$day_name_length) : $d).'
 
$day 
\n"; -} -?> \ No newline at end of file diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index fe2b90318d..66593ff1dd 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -35,21 +35,22 @@ $config['style'] = 'pandora'; // Read remaining config tokens from DB if (! mysql_connect ($config["dbhost"], $config["dbuser"], $config["dbpass"])) { //Non-persistent connection. If you want persistent conn change it to mysql_pconnect() - exit ('Pandora FMS Error + exit (' + Pandora FMS Error -
+
- + logo

Pandora FMS Console Error DB-001

- Cannot connect with Database, please check your database setup in the - ./include/config.php file and read documentation.

- Probably any of your user/database/hostname values are incorrect or - database is not running.


- MySQL ERROR: '. mysql_error().' -
  + Cannot connect to the database, please check your database setup in the + include/config.php file or read the documentation on how to setup Pandora FMS.

+ Probably one or more of your user, database or hostname values are incorrect or + the database server is not running.


+ MySQL ERROR: '. mysql_error().' +
 
'); } @@ -59,19 +60,20 @@ require_once ('functions_db.php'); $configs = get_db_all_rows_in_table ('tconfig'); if (empty ($configs)) { - exit ('Pandora FMS Error + exit (' + Pandora FMS Error
- + logo

Pandora FMS Console Error DB-002

- Cannot load configuration variables. Please check your database setup in the - ./include/config.php file and read documentation.

- Probably database schema is created but there are no data inside it or you have a problem with DB access credentials. -

+ Cannot load configuration variables from database. Please check your database setup in the + include/config.php file or read the documentation on how to setup Pandora FMS.

+ Most likely your database schema has been created but there are is no data in it, you have a problem with the database access credentials or your schema is out of date. +

'); } @@ -83,20 +85,21 @@ foreach ($configs as $c) { $config['language'] = $c['value']; break; case "auth": - exit ('Pandora FMS Error - -
-
-
- -
-
-

Pandora FMS Console Error DB-003

- Cannot override auth variables from database. Remove them from your database by executing: - DELETE FROM tconfig WHERE token = "auth"; -
-
-
'); + exit (' + Pandora FMS Error + +
+
+
+ logo +
+
+

Pandora FMS Console Error DB-003

+ Cannot override authorization variables from the config database. Remove them from your database by executing: + DELETE FROM tconfig WHERE token = "auth"; +
+
+
'); default: $config[$c['token']] = $c['value']; } diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 00974d098e..496fc5f6dc 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -187,12 +187,13 @@ function popup_help ($help_id, $return = false) { } /** - * Prints a no permission generic error message. + * DEPRECATED: This function is not used anywhere. Remove it? + * (use general/noaccess.php followed by exit instead) */ function no_permission () { require("config.php"); echo "

".__('You don\'t have access')."

"; - echo "No access

"; + echo "No access

"; echo ""; echo "
"; echo __('You don\'t have enough permission to access this resource'); @@ -203,16 +204,15 @@ function no_permission () { } /** - * Prints a generic error message for some unhandled error and exits - * - * TODO: Clean this up so it doesn't use table and insert erroneous td - * + * DEPRECATED: This function is not used anywhere. Remove it? + * (use print_error function instead followed by return or exit) + * * @param string $error Aditional error string to be shown. Blank by default */ function unmanaged_error ($error = "") { require_once ("config.php"); echo "

".__('Unmanaged error')."

"; - echo "error

"; + echo "error

"; echo ""; echo "
"; echo __('Unmanaged error'); @@ -1051,6 +1051,7 @@ function process_page_head ($string, $bitfield) { $output .= 'Pandora FMS - '.__('the Flexible Monitoring System').' + @@ -1062,7 +1063,6 @@ function process_page_head ($string, $bitfield) { - @@ -1083,13 +1083,14 @@ function process_page_head ($string, $bitfield) { if (!empty ($config['js'])) { //Load other javascript - $loaded = array ('', 'wz_jsgraphics', 'pandora', 'date_'.$config['language'], 'time_'.$config['language'], 'countdown_'.$config['language']); //We can't load empty and we loaded wz_jsgraphics and pandora + $loaded = array ('', 'pandora', 'date_'.$config['language'], 'time_'.$config['language'], 'countdown_'.$config['language']); //We can't load empty and we loaded wz_jsgraphics and pandora foreach ($config['js'] as $javascript) { if (in_array ($javascript, $loaded)) { continue; } array_push ($loaded, $javascript); $output .= ''."\n"; + } } diff --git a/pandora_console/include/styles/ie.css b/pandora_console/include/styles/ie.css index efd2675a47..e1bd2e9646 100644 --- a/pandora_console/include/styles/ie.css +++ b/pandora_console/include/styles/ie.css @@ -30,3 +30,7 @@ zoom: 100%; padding: 1; } + +* html .timeEntry_control { /* IE only */ + margin-top: -4px; +} diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 725ac8c4a0..621752adae 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -856,3 +856,10 @@ img.right { .text-right { text-align:right; } + +/* timeEntry styles */ +.timeEntry_control { + vertical-align: middle; + margin-left: 2px; +} + diff --git a/pandora_console/include/styles/timeentry.css b/pandora_console/include/styles/timeentry.css deleted file mode 100644 index 4d138fc3bd..0000000000 --- a/pandora_console/include/styles/timeentry.css +++ /dev/null @@ -1,8 +0,0 @@ -/* timeEntry styles */ -.timeEntry_control { - vertical-align: middle; - margin-left: 2px; -} -* html .timeEntry_control { /* IE only */ - margin-top: -4px; -} diff --git a/pandora_console/operation/incidents/incident.php b/pandora_console/operation/incidents/incident.php index ade1860b01..8f99c84acd 100644 --- a/pandora_console/operation/incidents/incident.php +++ b/pandora_console/operation/incidents/incident.php @@ -140,7 +140,8 @@ if ($grupo != 1) { $filter .= sprintf (" AND id_grupo = %d", $grupo); if (give_acl ($config['id_user'], $grupo, "IM") == 0) { audit_db ($config["id_user"],$config["remote_addr"],"ACL Forbidden","User tried to read incidents from group without access"); - no_permission (); + include ("general/noaccess.php"); + exit; } } diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index 64f7d1e17e..e42a8cbc23 100644 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -84,7 +84,6 @@ echo ''; /* We must add javascript here. Otherwise, the date picker won't work if the date is not correct because php is returning. */ $config['css'][] = 'datepicker'; -$config['css'][] = 'timeentry'; $config['jquery'][] = 'ui.core'; $config['jquery'][] = 'ui.datepicker'; $config['jquery'][] = 'ui.timeentry'; @@ -106,11 +105,6 @@ if ($datetime === false || $datetime == -1) { echo '

'.__('Invalid date selected').'

'; return; } -/* Date must not be older than now */ -if ($datetime > get_system_time ()) { - echo '

'.__('Selected date is older than current date').'

'; - return; -} $table->size = array (); $table->style = array ();