2010-05-14 Raul Mateos <raulofpandora@gmail.com>

* operation/agentes/gis_view.php, tactical.php: Clean code. Updated year.
	* Changelog: Fixed language error from my last commit.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2731 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
raulmateos 2010-05-14 12:55:16 +00:00
parent 22fed25b31
commit 9ecbd9599b
3 changed files with 21 additions and 16 deletions

View File

@ -1,3 +1,7 @@
2010-05-14 Raúl Mateos <raulofpandora@gmail.com>
* operation/agentes/gis_view.php, tactical.php: Clean code. Updated year.
2010-05-14 Miguel de Dios <miguel.dedios@artica.es> 2010-05-14 Miguel de Dios <miguel.dedios@artica.es>
* godmode/groups/group_list.php: fixed the request of group data when get * godmode/groups/group_list.php: fixed the request of group data when get
@ -9,7 +13,7 @@
* godmode/reporting/visual_console_builder.php: Fixed * godmode/reporting/visual_console_builder.php: Fixed
the adding at visual map only the agent if module is the adding at visual map only the agent if module is
no selected and only the module if is selected. no selected and only the module if is selected.
Bug: 2989339 Fixes: #2989339
2010-05-14 Miguel de Dios <miguel.dedios@artica.es> 2010-05-14 Miguel de Dios <miguel.dedios@artica.es>
@ -41,7 +45,7 @@
there's no agent, it shows a text. Inefficient? there's no agent, it shows a text. Inefficient?
* godmode/agentes/agent_manager: Solved typo with .png files, but * godmode/agentes/agent_manager: Solved typo with .png files, but
those files doesn't exists in repository... those files don't exist in repository...
2010-05-13 Raúl Mateos <raulofpandora@gmail.com> 2010-05-13 Raúl Mateos <raulofpandora@gmail.com>

View File

@ -2,7 +2,7 @@
/** /**
* Pandora FMS- http://pandorafms.com * Pandora FMS- http://pandorafms.com
* ================================================== * ==================================================
* Copyright (c) 2005-2009 Artica Soluciones Tecnologicas * Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -38,7 +38,7 @@ $agentData = getDataLastPositionAgent($id_agente);
echo "<div style='margin-bottom: 30px;'></div>"; echo "<div style='margin-bottom: 30px;'></div>";
/* Map with the current position */ /* Map with the current position */
echo "<div id=\"".$agent_name."_agent_map\" style=\"border:1px solid black; width:98%; height: 39em;\"></div>"; echo "<div id=\"".$agent_name."_agent_map\" style=\"border:1px solid black; width:98%; height: 39em;\"></div>";
if (!getAgentMap($agentId, "500px", "98%", true, true, $period)) { if (!getAgentMap($agentId, "500px", "98%", true, true, $period)) {
echo "<br /><div class='nf'>" . __("There is no default map.") . "</div>"; echo "<br /><div class='nf'>" . __("There is no default map.") . "</div>";
} }
@ -75,7 +75,7 @@ echo "<br />";
echo "<form action='index.php?" . $_SERVER['QUERY_STRING'] . "' method='POST'>"; echo "<form action='index.php?" . $_SERVER['QUERY_STRING'] . "' method='POST'>";
echo __("Period to show data as path") . ": "; echo __("Period to show data as path") . ": ";
print_extended_select_for_time ($intervals, 'period', $period, '', '', '0', 10); print_extended_select_for_time ($intervals, 'period', $period, '', '', '0', 10);
echo __(" seconds.") . "&nbsp;"; echo __(" seconds.") . "&nbsp;";
print_submit_button(__('Refresh path'), 'refresh', false, 'class = "sub upd"'); print_submit_button(__('Refresh path'), 'refresh', false, 'class = "sub upd"');
echo "</form>"; echo "</form>";
@ -85,10 +85,10 @@ $sqlCount = sprintf ("SELECT COUNT(*) FROM tgis_data_history WHERE tagente_id_ag
$countData = get_db_value_sql($sqlCount); $countData = get_db_value_sql($sqlCount);
/* Get the elements to present in this page */ /* Get the elements to present in this page */
$sql = sprintf ("SELECT longitude, latitude, altitude, start_timestamp, end_timestamp, description, number_of_packages, manual_placement $sql = sprintf ("SELECT longitude, latitude, altitude, start_timestamp, end_timestamp, description, number_of_packages, manual_placement
FROM tgis_data_history FROM tgis_data_history
WHERE tagente_id_agente = %d AND end_timestamp > %d WHERE tagente_id_agente = %d AND end_timestamp > %d
ORDER BY end_timestamp DESC ORDER BY end_timestamp DESC
LIMIT %d OFFSET %d", $agentId, get_system_time () - $period, $config['block_size'], get_parameter ('offset')); LIMIT %d OFFSET %d", $agentId, get_system_time () - $period, $config['block_size'], get_parameter ('offset'));
$result = get_db_all_rows_sql ($sql, true); $result = get_db_all_rows_sql ($sql, true);
@ -96,16 +96,17 @@ if ($result === false) {
echo "<div class='nf'>".__('This agent doesn\'t have any GIS data')."</div>"; echo "<div class='nf'>".__('This agent doesn\'t have any GIS data')."</div>";
} }
else { else {
pagination ($countData, false) ; pagination ($countData, false) ;
$table->data = array(); $table->data = array();
foreach ($result as $row) { foreach ($result as $row) {
$rowdata = array($row['longitude'], $row['latitude'], $row['altitude'], $row['start_timestamp'], $row['end_timestamp'], $row['description'], $row['number_of_packages'], $row['manual_placement']); $rowdata = array($row['longitude'], $row['latitude'], $row['altitude'], $row['start_timestamp'], $row['end_timestamp'], $row['description'], $row['number_of_packages'], $row['manual_placement']);
array_push($table->data, $rowdata); array_push($table->data, $rowdata);
} }
$table->head = array(__("Longitude"), __("Latitude"), __("Altitude"), __("From"), __("To"), __("Description"), '# '.__("of Packages"), __("Manual placement")); $table->head = array(__("Longitude"), __("Latitude"), __("Altitude"), __("From"), __("To"), __("Description"), '# '.__("of Packages"), __("Manual placement"));
$table->class = 'position_data_table'; $table->class = 'position_data_table';
$table->id = $agent_name.'_position_data_table'; $table->id = $agent_name.'_position_data_table';
$table->title = $agent_name." ". __("positional data"); $table->title = $agent_name." ". __("positional data");
$table->titlestyle = "background-color:#799E48;";
print_table($table); unset($table); print_table($table); unset($table);
pagination ($countData, false) ; pagination ($countData, false) ;

View File

@ -2,7 +2,7 @@
// Pandora FMS - http://pandorafms.com // Pandora FMS - http://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas // Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list // Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
@ -57,7 +57,7 @@ tyle="color: '.$row["color"].';">'.$row[1].'</a></td></tr>';
if ($config["realtimestats"] == 0){ if ($config["realtimestats"] == 0){
$updated_time ="<a href='index.php?sec=estado&sec2=operation/agentes/tactical&force_refresh=1'>"; $updated_time ="<a href='index.php?sec=estado&sec2=operation/agentes/tactical&force_refresh=1'>";
$updated_time .= __('Last update'). " : ". print_timestamp (get_db_sql ("SELECT min(utimestamp) FROM tgroup_stat"), true); $updated_time .= __('Last update'). " : ". print_timestamp (get_db_sql ("SELECT min(utimestamp) FROM tgroup_stat"), true);
$updated_time .= "</A>"; $updated_time .= "</a>";
} else { } else {
$updated_time = __("Updated at realtime"); $updated_time = __("Updated at realtime");
} }
@ -67,7 +67,7 @@ print_page_header (__("Tactical view"), "images/bricks.png", false, "", false, $
$data = get_group_stats (); $data = get_group_stats ();
echo '<div style="width:20%; float:left; padding-right: 5%;" id="leftcolumn">'; echo '<div style="width:20%; float:left; padding-right: 5%;" id="leftcolumn">';
// Monitor checks // Monitor checks
$table->width = "100%"; $table->width = "100%";
@ -86,13 +86,13 @@ $table->style[0] = "padding-top:4px; padding-bottom:4px;";
$table->data[0][0] ='<b>'.__('Global health').'</b>'; $table->data[0][0] ='<b>'.__('Global health').'</b>';
$table->style[1] = "padding-top:4px; padding-bottom:4px;"; $table->style[1] = "padding-top:4px; padding-bottom:4px;";
$table->data[1][0] = print_image ($img.$data["global_health"], true, array ("width" => '100%', "height" => 20, "title" => $data["global_health"].'% '.__('of monitors OK'))); $table->data[1][0] = print_image ($img.$data["global_health"], true, array ("width" => '100%', "height" => 20, "title" => $data["global_health"].'% '.__('of monitors OK')));
$table->style[2] = "padding-top:4px; padding-bottom:4px;"; $table->style[2] = "padding-top:4px; padding-bottom:4px;";
$table->data[2][0] ='<b>'.__('Monitor health').'</b>'; $table->data[2][0] ='<b>'.__('Monitor health').'</b>';
$table->style[3] = "padding-top:4px; padding-bottom:4px;"; $table->style[3] = "padding-top:4px; padding-bottom:4px;";
$table->data[3][0] = print_image ($img.$data["monitor_health"], true, array ("width" => '100%', "height" => 20, "title" => $data["monitor_health"].'% '.__('of monitors up'))); $table->data[3][0] = print_image ($img.$data["monitor_health"], true, array ("width" => '100%', "height" => 20, "title" => $data["monitor_health"].'% '.__('of monitors up')));
$table->style[4] = "padding-top:4px; padding-bottom:4px;"; $table->style[4] = "padding-top:4px; padding-bottom:4px;";
$table->data[4][0] = '<b>'.__('Module sanity').'</b>'; $table->data[4][0] = '<b>'.__('Module sanity').'</b>';