From 87d3077ec4f4ca75ac8c48db439abdd12d8b0904 Mon Sep 17 00:00:00 2001 From: raulmateos Date: Thu, 20 May 2010 14:35:14 +0000 Subject: [PATCH] 2010-05-20 Raul Mateos * godmode/alerts/alert_list.php: Added code to show different header depending on GET parameter. * godmode/alerts/alert_list_builder.php: Changed final icon. * godmode/agentes/planned_downtime.php: Center some icons. Now table header is shown only if there are planned downtimes. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2775 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 ++++++ .../godmode/agentes/planned_downtime.php | 34 +++++++++++-------- .../godmode/alerts/alert_list.builder.php | 2 +- pandora_console/godmode/alerts/alert_list.php | 8 +++-- 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f23fde3fd6..d6824905e2 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2010-05-20 Raúl Mateos + + * godmode/alerts/alert_list.php: Added code to show different + header depending on GET parameter. + + * godmode/alerts/alert_list_builder.php: Changed final icon. + + * godmode/agentes/planned_downtime.php: Center some icons. Now table + header is shown only if there are planned downtimes. + 2010-05-20 Ramon Novoa * DEBIAN/control, DEBIAN/make_deb_package.sh, diff --git a/pandora_console/godmode/agentes/planned_downtime.php b/pandora_console/godmode/agentes/planned_downtime.php index 040512a5b3..89354b8192 100644 --- a/pandora_console/godmode/agentes/planned_downtime.php +++ b/pandora_console/godmode/agentes/planned_downtime.php @@ -219,26 +219,25 @@ if ($create_downtime || $update_downtime) { //Start Overview of existing planned downtime echo '

'.__('Agents planned for this downtime').':

'; - $table->class = 'databox'; - $table->width = '80%'; - $table->data = array (); - $table->head = array (); - $table->head[0] = __('Name'); - $table->head[1] = __('Group'); - $table->head[2] = __('OS'); - $table->head[3] = __('Last contact'); - $table->head[4] = __('Remove'); $sql = sprintf ("SELECT tagente.nombre, tplanned_downtime_agents.id, tagente.id_os, tagente.id_agente, tagente.id_grupo, tagente.ultimo_contacto FROM tagente, tplanned_downtime_agents WHERE tplanned_downtime_agents.id_agent = tagente.id_agente AND tplanned_downtime_agents.id_downtime = %d ",$id_downtime); $downtimes = get_db_all_rows_sql ($sql); if ($downtimes === false) { - $table->colspan[0][0] = 5; - $table->data[0][0] = __('There are no scheduled downtimes'); - $downtimes = array(); - } + echo '
'. __('There are no scheduled downtimes').'
'; + } else { + $table->class = 'databox'; + $table->width = '80%'; + $table->data = array (); + $table->head = array (); + $table->head[0] = __('Name'); + $table->head[1] = __('Group'); + $table->head[2] = __('OS'); + $table->head[3] = __('Last contact'); + $table->head[4] = __('Remove'); + $table->align[4] = "center";; - foreach ($downtimes as $downtime) { + foreach ($downtimes as $downtime) { $data = array (); $data[0] = $downtime['nombre']; @@ -257,7 +256,8 @@ if ($create_downtime || $update_downtime) { array_push ($table->data, $data); } - print_table ($table); + print_table ($table); + } } } else { @@ -275,6 +275,10 @@ if ($create_downtime || $update_downtime) { $table->head[5] = __('Delete'); $table->head[6] = __('Update'); $table->head[7] = __('Running'); + $table->align[2] = "center"; + $table->align[5] = "center"; + $table->align[6] = "center"; + $table->align[7] = "center"; $sql = "SELECT * FROM tplanned_downtime WHERE id_group IN (" . implode (",", array_keys ($groups)) . ")"; $downtimes = get_db_all_rows_sql ($sql); diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index a332f6809e..37c28261f6 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -88,7 +88,7 @@ echo '
'; print_table ($table); echo '
'; -print_submit_button (__('Add'), 'add', false, 'class="sub next"'); +print_submit_button (__('Add'), 'add', false, 'class="sub wand"'); print_input_hidden ('create_alert', 1); echo '
'; diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 4a2b13f6bd..44ae3bc772 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -179,8 +179,12 @@ else { print_image ("images/config.png", true, array ("title" => __('Builder alert'))) .'')); $buttons[$tab]['active'] = true; - - print_page_header(__('Alerts') . ' » ' . __('Manage alerts') . ' » ' . __('List'), "images/god2.png", false, "manage_alert_list", true, $buttons); + + if (isset($_GET["tab"])) { + print_page_header(__('Alerts') . ' » ' . __('Manage alerts') . ' » ' . __('Create'), "images/god2.png", false, "manage_alert_list", true, $buttons); + } else { + print_page_header(__('Alerts') . ' » ' . __('Manage alerts') . ' » ' . __('List'), "images/god2.png", false, "manage_alert_list", true, $buttons); + } echo $messageAction;