mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
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:
parent
59c2e1304c
commit
2b76523df5
@ -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>
|
2009-11-30 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* include/functions_ui.php: show the deault action with other style.
|
* include/functions_ui.php: show the deault action with other style.
|
||||||
|
@ -288,7 +288,7 @@ echo "</div>\n";
|
|||||||
$simple_alerts = array();
|
$simple_alerts = array();
|
||||||
|
|
||||||
if ($id_agente) {
|
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 {
|
} else {
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$where = '';
|
$where = '';
|
||||||
|
@ -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
|
* @return array All simple alerts defined for an agent. Empty array if no
|
||||||
* alerts found.
|
* 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) {
|
switch ($filter) {
|
||||||
case "notfired":
|
case "notfired":
|
||||||
$filter = ' AND times_fired = 0 AND disabled = 0';
|
$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);
|
$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
|
FROM talert_template_modules
|
||||||
WHERE id_agent_module in (%s) %s %s",
|
INNER JOIN tagente_modulo AS t2
|
||||||
$subQuery, $where, $filter);
|
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);
|
$alerts = get_db_all_rows_sql ($sql);
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ if (isset ($_GET["id_agente"])) {
|
|||||||
exit;
|
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);
|
$alerts_combined = get_agent_alerts_compound ($id_agent, $filter);
|
||||||
$print_agent = false;
|
$print_agent = false;
|
||||||
$inside_main = 1;
|
$inside_main = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user