mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
2010-12-22 Ramon Novoa <rnovoa@artica.es>
* operation/agentes/exportdata.php: Fixed data average export. Fixes bug #3141351. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3685 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
da97830f00
commit
7f171d2df5
@ -1,3 +1,8 @@
|
|||||||
|
2010-12-22 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* operation/agentes/exportdata.php: Fixed data average export.
|
||||||
|
Fixes bug #3141351.
|
||||||
|
|
||||||
2010-12-22 Miguel de Dios <miguel.dedios@artica.es>
|
2010-12-22 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* operation/events/events.php: fixed the show list of events when to delete
|
* operation/events/events.php: fixed the show list of events when to delete
|
||||||
|
@ -54,6 +54,7 @@ if (is_ajax ()) {
|
|||||||
// Load global vars
|
// Load global vars
|
||||||
require_once ("include/config.php");
|
require_once ("include/config.php");
|
||||||
require_once ("include/functions_agents.php");
|
require_once ("include/functions_agents.php");
|
||||||
|
require_once ("include/functions_reporting.php");
|
||||||
|
|
||||||
check_login();
|
check_login();
|
||||||
|
|
||||||
@ -164,6 +165,7 @@ if (!empty ($export_btn) && !empty ($module)) {
|
|||||||
case "data":
|
case "data":
|
||||||
case "excel":
|
case "excel":
|
||||||
case "csv":
|
case "csv":
|
||||||
|
case "avg":
|
||||||
|
|
||||||
// Show header
|
// Show header
|
||||||
echo $datastart;
|
echo $datastart;
|
||||||
@ -183,9 +185,22 @@ if (!empty ($export_btn) && !empty ($module)) {
|
|||||||
$work_end = $work_end + $work_period;
|
$work_end = $work_end + $work_period;
|
||||||
|
|
||||||
$data = array (); // Reinitialize array for each module chunk
|
$data = array (); // Reinitialize array for each module chunk
|
||||||
$data_single = get_agentmodule_data ($selected, $work_period, $work_end);
|
if ($export_type == "avg") {
|
||||||
if (!empty ($data_single)) {
|
$arr = array ();
|
||||||
$data = array_merge ($data, $data_single);
|
$arr["data"] = get_agentmodule_data_average ($selected, $work_period, $work_end);
|
||||||
|
if ($arr["data"] === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$arr["module_name"] = get_agentmodule_name ($selected);
|
||||||
|
$arr["agent_name"] = get_agentmodule_agent_name ($selected);
|
||||||
|
$arr["agent_id"] = get_agentmodule_agent ($selected);
|
||||||
|
$arr["utimestamp"] = $end;
|
||||||
|
array_push ($data, $arr);
|
||||||
|
} else {
|
||||||
|
$data_single = get_agentmodule_data ($selected, $work_period, $work_end);
|
||||||
|
if (!empty ($data_single)) {
|
||||||
|
$data = array_merge ($data, $data_single);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -227,21 +242,6 @@ if (!empty ($export_btn) && !empty ($module)) {
|
|||||||
} // main foreach
|
} // main foreach
|
||||||
echo $dataend;
|
echo $dataend;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "avg":
|
|
||||||
foreach ($module as $selected) {
|
|
||||||
$arr = array ();
|
|
||||||
$arr["data"] = get_agentmodule_data_average ($selected, $period, $end);
|
|
||||||
if ($arr["data"] === false) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$arr["module_name"] = get_agentmodule_name ($selected);
|
|
||||||
$arr["agent_name"] = get_agentmodule_agent_name ($selected);
|
|
||||||
$arr["agent_id"] = get_agentmodule_agent ($selected);
|
|
||||||
$arr["utimestamp"] = $end;
|
|
||||||
array_push ($data, $arr);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
print_error_message (__('Invalid method supplied'));
|
print_error_message (__('Invalid method supplied'));
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user