2009-11-30 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_agents.php: added new parameter for order the result of
	query, $orderby.
	* operation/agentes/alerts_status.php, godmode/alerts/alert_list.php: use
	new parameter to order by module name.
	Fixes: 2902603



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2147 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2009-11-30 17:28:08 +00:00
parent 8e786e3604
commit 92f65cc423
4 changed files with 20 additions and 6 deletions

View File

@ -1,3 +1,11 @@
2009-11-30 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_agents.php: added new parameter for order the result of
query, $orderby.
* operation/agentes/alerts_status.php, godmode/alerts/alert_list.php: use
new parameter to order by module name.
Fixes: 2902603
2009-11-30 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: show the deault action with other style.

View File

@ -288,7 +288,7 @@ echo "</div>\n";
$simple_alerts = array();
if ($id_agente) {
$simple_alerts = get_agent_alerts_simple (array_keys ($agents));
$simple_alerts = get_agent_alerts_simple (array_keys ($agents), '', false, '', false, 'agent_module_name');
} else {
$total = 0;
$where = '';

View File

@ -110,7 +110,8 @@ function create_agent ($name, $id_group, $interval, $ip_address, $values = false
* @return array All simple alerts defined for an agent. Empty array if no
* alerts found.
*/
function get_agent_alerts_simple ($id_agent = false, $filter = '', $options = false, $where = '', $allModules = false) {
function get_agent_alerts_simple ($id_agent = false, $filter = '', $options = false, $where = '', $allModules = false, $orderby = false) {
switch ($filter) {
case "notfired":
$filter = ' AND times_fired = 0 AND disabled = 0';
@ -147,10 +148,15 @@ function get_agent_alerts_simple ($id_agent = false, $filter = '', $options = fa
$subQuery = implode (",", $id_modules);
}
$sql = sprintf ("SELECT talert_template_modules.*
if ($orderby !== false)
$orderbyText = sprintf("ORDER BY %s", $orderby);
$sql = sprintf ("SELECT talert_template_modules.*, t2.nombre AS agent_module_name
FROM talert_template_modules
WHERE id_agent_module in (%s) %s %s",
$subQuery, $where, $filter);
INNER JOIN tagente_modulo AS t2
ON talert_template_modules.id_agent_module = t2.id_agente_modulo
WHERE id_agent_module in (%s) %s %s %s",
$subQuery, $where, $filter, $orderbyText);
$alerts = get_db_all_rows_sql ($sql);

View File

@ -70,7 +70,7 @@ if (isset ($_GET["id_agente"])) {
exit;
}
$alerts_simple = get_agent_alerts_simple ($id_agent, $filter);
$alerts_simple = get_agent_alerts_simple ($id_agent, $filter, false, '', false, 'agent_module_name');
$alerts_combined = get_agent_alerts_compound ($id_agent, $filter);
$print_agent = false;
$inside_main = 1;