Fixed order data to click in show data module in tree view,tiquet: #2080

(cherry picked from commit 0df919dcdd)
This commit is contained in:
m-lopez-f 2015-04-16 15:18:11 +02:00
parent f8a2fbfbf9
commit 48a0a167cc
1 changed files with 17 additions and 0 deletions

View File

@ -1743,6 +1743,23 @@ function modules_get_agentmodule_data ($id_agent_module, $period,
$values[$key]["agent_name"] = $agent_name;
}
if ($search_in_history_db) {
$datos = array();
foreach ($values as $key => $value) {
$utimestamp[$key] = $value['utimestamp'];
}
array_multisort($utimestamp, SORT_DESC, $values);
foreach ($utimestamp as $key => $utimes) {
$datos[$key] = array('utimestamp'=>$utimes,
'data'=>$values[$key]["data"],
'module_name'=>$values[$key]["module_name"],
'agent_id'=>$values[$key]["agent_id"],
'agent_name'=>$values[$key]["agent_name"]
);
}
$values = $datos;
}
return $values;
}