2011-03-09 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_reporting.php, include/functions.php,
	operation/agentes/datos_agente.php, operation/agentes/gis_view.php,
	operation/servers/view_server_detail.php,
	operation/reporting/reporting_xml.php, operation/reporting/graph_viewer.php,
	godmode/db/db_main.php, godmode/db/db_purge.php,
	godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php:
	cleaned source code, and erased the deprecated function
	"human_time_description".



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4079 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-03-09 15:54:05 +00:00
parent a6747099c4
commit b088c166cc
12 changed files with 38 additions and 34 deletions

View File

@ -1,3 +1,14 @@
2011-03-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php, include/functions.php,
operation/agentes/datos_agente.php, operation/agentes/gis_view.php,
operation/servers/view_server_detail.php,
operation/reporting/reporting_xml.php, operation/reporting/graph_viewer.php,
godmode/db/db_main.php, godmode/db/db_purge.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php:
cleaned source code, and erased the deprecated function
"human_time_description".
2011-03-09 Miguel de Dios <miguel.dedios@artica.es> 2011-03-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions.php: fixed in the function "get_system_time" copy&paste * include/functions.php: fixed in the function "get_system_time" copy&paste

View File

@ -179,7 +179,7 @@ if (!isset($config['db_maintance'])){
else else
echo "<font><b>"; echo "<font><b>";
echo human_time_description($seconds); echo human_time_description_raw($seconds);
echo " *"; echo " *";
} }
echo "</td></tr>"; echo "</td></tr>";

View File

@ -79,7 +79,7 @@ $data["total"] = 0;
if (isset($_POST["purgedb"])) { if (isset($_POST["purgedb"])) {
$from_date = get_parameter_post ("date_purge", 0); $from_date = get_parameter_post ("date_purge", 0);
if ($id_agent > 0) { if ($id_agent > 0) {
echo __('Purge task launched for agent')." ".get_agent_name ($id_agent)." :: ".__('Data older than')." ".human_time_description ($from_date); echo __('Purge task launched for agent')." ".get_agent_name ($id_agent)." :: ".__('Data older than')." ".human_time_description_raw ($from_date);
echo "<h3>".__('Please be patient. This operation can take a long time depending on the amount of modules.')."</h3>"; echo "<h3>".__('Please be patient. This operation can take a long time depending on the amount of modules.')."</h3>";
$sql = sprintf ("SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = %d", $id_agent); $sql = sprintf ("SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = %d", $id_agent);

View File

@ -213,17 +213,17 @@ if (isset ($_GET["update_alert"])) {
echo '<tr><td class="datos2">'.__('Time threshold').'</td><td class="datos2">'; echo '<tr><td class="datos2">'.__('Time threshold').'</td><td class="datos2">';
$fields = array (); $fields = array ();
$fields[$time_threshold] = human_time_description ($time_threshold); $fields[$time_threshold] = human_time_description_raw ($time_threshold);
$fields[300] = human_time_description (300); $fields[300] = human_time_description_raw (300);
$fields[600] = human_time_description (600); $fields[600] = human_time_description_raw (600);
$fields[900] = human_time_description (900); $fields[900] = human_time_description_raw (900);
$fields[1800] = human_time_description (1800); $fields[1800] = human_time_description_raw (1800);
$fields[3600] = human_time_description (3600); $fields[3600] = human_time_description_raw (3600);
$fields[7200] = human_time_description (7200); $fields[7200] = human_time_description_raw (7200);
$fields[18000] = human_time_description (18000); $fields[18000] = human_time_description_raw (18000);
$fields[43200] = human_time_description (43200); $fields[43200] = human_time_description_raw (43200);
$fields[86400] = human_time_description (86400); $fields[86400] = human_time_description_raw (86400);
$fields[604800] = human_time_description (604800); $fields[604800] = human_time_description_raw (604800);
$fields[-1] = __('Other value'); $fields[-1] = __('Other value');
print_select ($fields, "time_threshold", $time_threshold, '', '', '0', false, false, false, '" style="margin-right:60px'); print_select ($fields, "time_threshold", $time_threshold, '', '', '0', false, false, false, '" style="margin-right:60px');

View File

@ -119,7 +119,7 @@ if ($create_user) {
' Language: ' . $values['language'] . ' Skin: ' . $values['id_skin'] . ' Language: ' . $values['language'] . ' Skin: ' . $values['id_skin'] .
' Block size: ' . $values['block_size'] . ' Flash Chats: ' . $values['flash_chart']; ' Block size: ' . $values['block_size'] . ' Flash Chats: ' . $values['flash_chart'];
$result = create_user ($id, $password_new, $values); $result = create_user($id, $password_new, $values);
pandora_audit("User management", pandora_audit("User management",
"Created user ".safe_input($id), false, false, $info); "Created user ".safe_input($id), false, false, $info);

View File

@ -406,13 +406,6 @@ function human_time_description_raw ($seconds, $exactly = false, $units = 'large
return "+6 " . $monthsString; return "+6 " . $monthsString;
} }
/**
* @deprecated Use print_timestamp for output.
*/
function human_time_description ($period) {
return human_time_description_raw ($period); //human_time_description_raw does the same but by calculating instead of a switch
}
/** /**
* @deprecated Get current time minus some seconds. (Do your calculations yourself on unix timestamps) * @deprecated Get current time minus some seconds. (Do your calculations yourself on unix timestamps)
* *

View File

@ -1775,7 +1775,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
$data = array (); $data = array ();
$data[0] = $sizh.__('Simple graph').$sizhfin; $data[0] = $sizh.__('Simple graph').$sizhfin;
$data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin; $data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin;
$data[2] = $sizh.human_time_description ($content['period']).$sizhfin; $data[2] = $sizh.human_time_description_raw ($content['period']).$sizhfin;
array_push ($table->data, $data); array_push ($table->data, $data);
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)
@ -1798,7 +1798,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
$data = array (); $data = array ();
$data[0] = $sizh.__('Simple baseline graph').$sizhfin; $data[0] = $sizh.__('Simple baseline graph').$sizhfin;
$data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin; $data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin;
$data[2] = $sizh.human_time_description ($content['period']).$sizhfin; $data[2] = $sizh.human_time_description_raw ($content['period']).$sizhfin;
array_push ($table->data, $data); array_push ($table->data, $data);
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)
@ -1822,7 +1822,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
$data = array (); $data = array ();
$data[0] = $sizh.__('Custom graph').$sizhfin; $data[0] = $sizh.__('Custom graph').$sizhfin;
$data[1] = $sizh.$graph['name'].$sizhfin; $data[1] = $sizh.$graph['name'].$sizhfin;
$data[2] = $sizh.human_time_description ($content['period']).$sizhfin; $data[2] = $sizh.human_time_description_raw ($content['period']).$sizhfin;
array_push ($table->data, $data); array_push ($table->data, $data);
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)
@ -1936,7 +1936,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
$data = array (); $data = array ();
$data[0] = $sizh.__('Monitor report').$sizhfin; $data[0] = $sizh.__('Monitor report').$sizhfin;
$data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin; $data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin;
$data[2] = $sizh.human_time_description ($content['period']).$sizhfin; $data[2] = $sizh.human_time_description_raw ($content['period']).$sizhfin;
array_push ($table->data, $data); array_push ($table->data, $data);
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)
@ -1970,7 +1970,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
$data = array (); $data = array ();
$data[0] = $sizh.__('Avg. Value').$sizhfin; $data[0] = $sizh.__('Avg. Value').$sizhfin;
$data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin; $data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin;
$data[2] = $sizh.human_time_description ($content['period']).$sizhfin; $data[2] = $sizh.human_time_description_raw ($content['period']).$sizhfin;
array_push ($table->data, $data); array_push ($table->data, $data);
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)
@ -1999,7 +1999,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
$data = array (); $data = array ();
$data[0] = $sizh.__('Max. Value').$sizhfin; $data[0] = $sizh.__('Max. Value').$sizhfin;
$data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin; $data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin;
$data[2] = $sizh.human_time_description ($content['period']).$sizhfin; $data[2] = $sizh.human_time_description_raw ($content['period']).$sizhfin;
array_push ($table->data, $data); array_push ($table->data, $data);
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)
@ -2023,7 +2023,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
$data = array (); $data = array ();
$data[0] = $sizh.__('Min. Value').$sizhfin; $data[0] = $sizh.__('Min. Value').$sizhfin;
$data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin; $data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin;
$data[2] = $sizh.human_time_description ($content['period']).$sizhfin; $data[2] = $sizh.human_time_description_raw ($content['period']).$sizhfin;
array_push ($table->data, $data); array_push ($table->data, $data);
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)
@ -2052,7 +2052,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
$data = array (); $data = array ();
$data[0] = $sizh.__('Summatory').$sizhfin; $data[0] = $sizh.__('Summatory').$sizhfin;
$data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin; $data[1] = $sizh.$agent_name.' - '.$module_name.$sizhfin;
$data[2] = $sizh.human_time_description ($content['period']).$sizhfin; $data[2] = $sizh.human_time_description_raw ($content['period']).$sizhfin;
array_push ($table->data, $data); array_push ($table->data, $data);
// Put description at the end of the module (if exists) // Put description at the end of the module (if exists)

View File

@ -106,7 +106,7 @@ if ($result === false) {
} }
$header_title = __('Received data from')." ".get_agentmodule_agent_name ($module_id)." / ".get_agentmodule_name ($module_id); $header_title = __('Received data from')." ".get_agentmodule_agent_name ($module_id)." / ".get_agentmodule_name ($module_id);
$header_title .= "<br><br>" . __("From the last") . " " . human_time_description ($period); $header_title .= "<br><br>" . __("From the last") . " " . human_time_description_raw ($period);
echo "<h3>".$header_title. "</h3>"; echo "<h3>".$header_title. "</h3>";

View File

@ -92,7 +92,7 @@ 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>";
echo "<h3>" . __("Positional data from the last") . " " . human_time_description ($period) ."</h3>"; echo "<h3>" . __("Positional data from the last") . " " . human_time_description_raw ($period) ."</h3>";
/* Get the total number of Elements for the pagination */ /* Get the total number of Elements for the pagination */
$sqlCount = sprintf ("SELECT COUNT(*) FROM tgis_data_history WHERE tagente_id_agente = %d AND end_timestamp > FROM_UNIXTIME(%d) ORDER BY end_timestamp DESC", $agentId, get_system_time () - $period); $sqlCount = sprintf ("SELECT COUNT(*) FROM tgis_data_history WHERE tagente_id_agente = %d AND end_timestamp > FROM_UNIXTIME(%d) ORDER BY end_timestamp DESC", $agentId, get_system_time () - $period);
$countData = get_db_value_sql($sqlCount); $countData = get_db_value_sql($sqlCount);

View File

@ -122,7 +122,7 @@ if ($view_graph) {
echo "<tr><td>"; echo "<tr><td>";
print_custom_graph ($id_graph, $height, $width, $period, $stacked, false, $unixdate); print_custom_graph ($id_graph, $height, $width, $period, $stacked, false, $unixdate);
echo "</td></tr></table>"; echo "</td></tr></table>";
$period_label = human_time_description ($period); $period_label = human_time_description_raw ($period);
echo "<form method='POST' action='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id=$id_graph'>"; echo "<form method='POST' action='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id=$id_graph'>";
echo "<table class='databox_frame' cellpadding='4' cellspacing='4'>"; echo "<table class='databox_frame' cellpadding='4' cellspacing='4'>";
echo "<tr>"; echo "<tr>";

View File

@ -176,7 +176,7 @@ foreach ($contents as $content) {
$data = array (); $data = array ();
$data["module"] = safe_output_xml (get_db_value ('nombre', 'tagente_modulo', 'id_agente_modulo', $content['id_agent_module'])); $data["module"] = safe_output_xml (get_db_value ('nombre', 'tagente_modulo', 'id_agente_modulo', $content['id_agent_module']));
$data["agent"] = safe_output_xml (get_agentmodule_agent_name ($content['id_agent_module'])); $data["agent"] = safe_output_xml (get_agentmodule_agent_name ($content['id_agent_module']));
$data["period"] = human_time_description ($content['period']); $data["period"] = human_time_description_raw ($content['period']);
$data["uperiod"] = $content['period']; $data["uperiod"] = $content['period'];
$data["type"] = $content["type"]; $data["type"] = $content["type"];

View File

@ -101,7 +101,7 @@ foreach ($recon_tasks as $task) {
$data[1] = '<b>'. $task["name"].'</b>'; $data[1] = '<b>'. $task["name"].'</b>';
$data[2] = human_time_description ($task["interval_sweep"]); $data[2] = human_time_description_raw ($task["interval_sweep"]);
if ($task["id_recon_script"] == 0){ if ($task["id_recon_script"] == 0){
$data[3] = $task["subnet"]; $data[3] = $task["subnet"];