diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog
index e00dfa7110..e46a64e8b2 100644
--- a/pandora_console/ChangeLog
+++ b/pandora_console/ChangeLog
@@ -1,3 +1,17 @@
+2011-07-21 Sergio Martin
+
+ * include/functions_users.php
+ extensions/module_groups.php
+ godmode/groups/modu_group_list.php
+ godmode/groups/group_list.php
+ godmode/alerts/alert_commands.php
+ godmode/setup/os.list.php
+ godmode/setup/news.php
+ godmode/users/profile_list.php
+ godmode/modules/manage_network_components.php
+ godmode/modules/manage_nc_groups.php: Fixed several lonely
+ headers when no data and other no data little bugs for 3371455
+
2011-07-21 Ramon Novoa
* include/functions_config.php: Set dbtype to mysql by default
diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php
index 0818e7052d..c4aad54de9 100644
--- a/pandora_console/extensions/module_groups.php
+++ b/pandora_console/extensions/module_groups.php
@@ -125,140 +125,146 @@ function mainModuleGroups() {
$agentGroups = users_get_groups ($config['id_user'], "AR", false);
$modelGroups = users_get_all_model_groups();
- array_walk($modelGroups, 'translate'); //Translate all head titles to language is set
- foreach ($modelGroups as $i => $n) {
- $modelGroups[$i] = ui_print_truncate_text($n, 20);
- }
+ if(!empty($agentGroups) && !empty($modelGroups)) {
+ array_walk($modelGroups, 'translate'); //Translate all head titles to language is set
- $head = $modelGroups;
- array_unshift($head, ' ');
-
- //Metaobject use in html_print_table
- $table = null;
- $table->align[0] = 'right'; //Align to right the first column.
- $table->style[0] = 'color: #ffffff; background-color: #778866; font-weight: bolder;';
- $table->head = $head;
- $table->width = '95%';
-
- //The content of table
- $tableData = array();
-
- $fired = false;
-
- //Create rows and cells
- foreach ($agentGroups as $idAgentGroup => $name) {
+ foreach ($modelGroups as $i => $n) {
+ $modelGroups[$i] = ui_print_truncate_text($n, 20);
+ }
+
+ $head = $modelGroups;
+ array_unshift($head, ' ');
- $row = array();
+ //Metaobject use in html_print_table
+ $table = null;
+ $table->align[0] = 'right'; //Align to right the first column.
+ $table->style[0] = 'color: #ffffff; background-color: #778866; font-weight: bolder;';
+ $table->head = $head;
+ $table->width = '95%';
- array_push($row, ui_print_truncate_text($name, 20));
-
- foreach ($modelGroups as $idModelGroup => $modelGroup) {
- $query = sprintf($sql,$idAgentGroup, $idModelGroup);
+ //The content of table
+ $tableData = array();
+
+ $fired = false;
+
+ //Create rows and cells
+ foreach ($agentGroups as $idAgentGroup => $name) {
- $rowsDB = db_get_all_rows_sql ($query);
+ $row = array();
-
- $agents = agents_get_group_agents($idAgentGroup);
-
- if (!empty($agents)) {
- $alerts = agents_get_alerts_simple($agents);
+ array_push($row, ui_print_truncate_text($name, 20));
+
+ foreach ($modelGroups as $idModelGroup => $modelGroup) {
+ $query = sprintf($sql,$idAgentGroup, $idModelGroup);
- foreach ($alerts as $alert) {
- $module = db_get_row_filter('tagente_modulo', array('id_agente_modulo' => $alert['id_agent_module']));
+ $rowsDB = db_get_all_rows_sql ($query);
+
+
+ $agents = agents_get_group_agents($idAgentGroup);
+
+ if (!empty($agents)) {
+ $alerts = agents_get_alerts_simple($agents);
- if ($idModelGroup == $module['id_module_group']) {
- if ($alert["times_fired"] > 0) {
- $fired = true;
+ foreach ($alerts as $alert) {
+ $module = db_get_row_filter('tagente_modulo', array('id_agente_modulo' => $alert['id_agent_module']));
+
+ if ($idModelGroup == $module['id_module_group']) {
+ if ($alert["times_fired"] > 0) {
+ $fired = true;
+ }
}
}
- }
- }
-
- $states = array();
- if ($rowsDB !== false) {
- foreach ($rowsDB as $rowDB) {
- $states[$rowDB['estado']] = $rowDB['count'];
- }
- }
-
- $count = 0;
- foreach ($states as $idState => $state) {
- $count += $state;
- }
-
- $color = 'transparent'; //Defaut color for cell
- $font_color = '#000000'; //Default font color for cell
- if ($count == 0) {
- $color = '#eeeeee'; //Soft grey when the cell for this model group and agent group hasn't modules.
- $alinkStart = '';
- $alinkEnd = '';
- }
- else {
+ }
- if ($fired) {
- $color = '#ffa300'; //Orange when the cell for this model group and agent has at least one alert fired.
- }
- else if (array_key_exists(1,$states)) {
- $color = '#cc0000'; //Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
- $font_color = '#ffffff';
- }
- elseif (array_key_exists(2,$states)) {
- $color = '#fce94f'; //Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state.
- }
- elseif (array_key_exists(3,$states)) {
- $color = '#babdb6'; //Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state.
- }
- elseif (array_key_exists(0,$states)) {
- $color = '#8ae234'; //Green when the cell for this model group and agent has OK state all modules.
+ $states = array();
+ if ($rowsDB !== false) {
+ foreach ($rowsDB as $rowDB) {
+ $states[$rowDB['estado']] = $rowDB['count'];
+ }
}
+ $count = 0;
+ foreach ($states as $idState => $state) {
+ $count += $state;
+ }
- $alinkStart = '';
- $alinkEnd = '';
+ $color = 'transparent'; //Defaut color for cell
+ $font_color = '#000000'; //Default font color for cell
+ if ($count == 0) {
+ $color = '#eeeeee'; //Soft grey when the cell for this model group and agent group hasn't modules.
+ $alinkStart = '';
+ $alinkEnd = '';
+ }
+ else {
+
+ if ($fired) {
+ $color = '#ffa300'; //Orange when the cell for this model group and agent has at least one alert fired.
+ }
+ else if (array_key_exists(1,$states)) {
+ $color = '#cc0000'; //Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
+ $font_color = '#ffffff';
+ }
+ elseif (array_key_exists(2,$states)) {
+ $color = '#fce94f'; //Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state.
+ }
+ elseif (array_key_exists(3,$states)) {
+ $color = '#babdb6'; //Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state.
+ }
+ elseif (array_key_exists(0,$states)) {
+ $color = '#8ae234'; //Green when the cell for this model group and agent has OK state all modules.
+ }
+
+
+ $alinkStart = '';
+ $alinkEnd = '';
+ }
+
+ array_push($row,
+ '
+ ' . $alinkStart . $count . $alinkEnd . '
');
}
-
- array_push($row,
- '
- ' . $alinkStart . $count . $alinkEnd . '
');
+ array_push($tableData,$row);
}
- array_push($tableData,$row);
+ $table->data = $tableData;
+ echo "";
+ html_print_table($table);
+ echo "
";
+
+ echo "" . __("The colours meaning:") .
+ "
" .
+ '-
+
' .
+ __("Orange cell when the module group and agent have at least one alarm fired.") .
+ ' ' .
+ '-
+
' .
+ __("Red cell when the module group and agent have at least one module in critical status and the others in any status") .
+ ' ' .
+ '-
+
' .
+ __("Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status") .
+ ' ' .
+ '-
+
' .
+ __("Green cell when the module group and agent have all modules in OK status") .
+ ' ' .
+ '-
+
' .
+ __("Grey cell when the module group and agent have at least one in unknown status and the others in green status") .
+ ' ' .
+ "
" .
+ "
";
+ }
+ else {
+ echo "".__('There are no defined groups or module groups')."
";
}
- $table->data = $tableData;
- echo "";
- html_print_table($table);
- echo "
";
-
- echo "" . __("The colours meaning:") .
- "
" .
- '-
-
' .
- __("Orange cell when the module group and agent have at least one alarm fired.") .
- ' ' .
- '-
-
' .
- __("Red cell when the module group and agent have at least one module in critical status and the others in any status") .
- ' ' .
- '-
-
' .
- __("Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status") .
- ' ' .
- '-
-
' .
- __("Green cell when the module group and agent have all modules in OK status") .
- ' ' .
- '-
-
' .
- __("Grey cell when the module group and agent have at least one in unknown status and the others in green status") .
- ' ' .
- "
" .
- "";
ui_require_css_file('cluetip');
ui_require_jquery_file('cluetip');
diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php
index ae5961fdcb..34f5d0a119 100644
--- a/pandora_console/godmode/alerts/alert_commands.php
+++ b/pandora_console/godmode/alerts/alert_commands.php
@@ -162,7 +162,12 @@ foreach ($commands as $command) {
array_push ($table->data, $data);
}
-html_print_table ($table);
+if(isset($data)) {
+ html_print_table ($table);
+}
+else {
+ echo "".__('No alert commands configured')."
";
+}
echo '