From 927110a33b30662dc4e3a1de34c32acefb8b713d Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 21 Jul 2010 11:10:58 +0000 Subject: [PATCH] 2010-07-21 Miguel de Dios * operation/agentes/alerts_status.php: added the icons and source code for order rows of list alerts by columns Disabled, Agent Name, Module Name or Template Name. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3047 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 + .../operation/agentes/alerts_status.php | 114 ++++++++++++++++-- 2 files changed, 109 insertions(+), 11 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index dde72ef7ab..69c0d93727 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-07-21 Miguel de Dios + + * operation/agentes/alerts_status.php: added the icons and source code for + order rows of list alerts by columns Disabled, Agent Name, Module Name or + Template Name. + 2010-07-21 Miguel de Dios * include/functions_agents.php: in function "get_agent_alerts_simple" diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 84aeff32ae..ff7a06944d 100644 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -104,8 +104,80 @@ else { $whereAlertCombined = ''; } +$sortField = get_parameter('sort_field'); +$sort = get_parameter('sort', 'none'); +$selected = 'border: 1px solid black;'; +$selectAgentUp = ''; +$selectAgentDown = ''; +$selectModuleUp = ''; +$selectModuleDown = ''; +$selectTemplateUp = ''; +$selectTemplateDown = ''; +switch ($sortField) { + case 'agent': + switch ($sort) { + case 'up': + $selectAgentUp = $selected; + $order = array('field' => 'agent_name', 'order' => 'ASC'); + break; + case 'down': + $selectAgentDown = $selected; + $order = array('field' => 'agent_name', 'order' => 'DESC'); + break; + } + break; + case 'module': + switch ($sort) { + case 'up': + $selectModuleUp = $selected; + $order = array('field' => 'agent_module_name', 'order' => 'ASC'); + break; + case 'down': + $selectModuleDown = $selected; + $order = array('field' => 'agent_module_name', 'order' => 'DESC'); + break; + } + break; + case 'template': + switch ($sort) { + case 'up': + $selectTemplateUp = $selected; + $order = array('field' => 'template_name', 'order' => 'ASC'); + break; + case 'down': + $selectTemplateDown = $selected; + $order = array('field' => 'template_name', 'order' => 'DESC'); + break; + } + break; + default: + if ($print_agent) { + $selectDisabledUp = ''; + $selectDisabledDown = ''; + $selectAgentUp = ''; + $selectAgentDown = ''; + $selectModuleUp = $selected; + $selectModuleDown = ''; + $selectTemplateUp = ''; + $selectTemplateDown = ''; + $order = array('field' => 'agent_module_name', 'order' => 'ASC'); + } + else { + $selectDisabledUp = ''; + $selectDisabledDown = ''; + $selectAgentUp = ''; + $selectAgentDown = ''; + $selectModuleUp = $selected; + $selectModuleDown = ''; + $selectTemplateUp = ''; + $selectTemplateDown = ''; + $order = array('field' => 'agent_module_name', 'order' => 'ASC'); + } + break; +} + $alerts = array(); -$alerts['alerts_simple'] = get_agent_alerts_simple ($agents, $filter, array('offset' => $offset_simple, 'limit' => $config['block_size']), $whereAlertSimple, false, false, $idGroup); +$alerts['alerts_simple'] = get_agent_alerts_simple ($agents, $filter, array('offset' => $offset_simple, 'limit' => $config['block_size'], 'order' => $order), $whereAlertSimple, false, false, $idGroup); $countAlertsSimple = get_agent_alerts_simple ($agents, $filter, false, $whereAlertSimple, false, false, $idGroup, true); $alerts['alerts_combined'] = get_agent_alerts_compound($agents, $filter, array('limit' => $config["block_size"], 'offset' => $offset_combined), $idGroup, false, $whereAlertCombined); $countAlertsCombined = get_agent_alerts_compound($agents, $filter, false, $idGroup, true, $whereAlertCombined); @@ -137,9 +209,15 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { $table->head[0] = "" . __('P.') . ""; $table->head[1] = "" . __('F.') . ""; - $table->head[2] = __('Agent'); - $table->head[3] = __('Module'); - $table->head[4] = __('Template'); + $table->head[2] = __('Agent') . ' ' . + '' . + ''; + $table->head[3] = __('Module') . ' ' . + '' . + ''; + $table->head[4] = __('Template') . ' ' . + '' . + ''; $table->head[5] = __('Action'); $table->head[6] = __('Last fired'); $table->head[7] = __('Status'); @@ -159,8 +237,12 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { $table->head[0] = "" . __('P.') . ""; $table->head[1] = "" . __('F.') . ""; - $table->head[2] = __('Module'); - $table->head[3] = __('Template'); + $table->head[2] = __('Module') . ' ' . + '' . + ''; + $table->head[3] = __('Template') . ' ' . + '' . + ''; $table->head[4] = __('Action'); $table->head[5] = __('Last fired'); $table->head[6] = __('Status'); @@ -182,9 +264,15 @@ else $table->size[6] = '60px'; $table->head[0] = "" . __('F.') . ""; - $table->head[1] = __('Agent'); - $table->head[2] = __('Module'); - $table->head[3] = __('Template'); + $table->head[1] = __('Agent') . ' ' . + '' . + ''; + $table->head[2] = __('Module') . ' ' . + '' . + ''; + $table->head[3] = __('Template') . ' ' . + '' . + ''; $table->head[4] = __('Action'); $table->head[5] = __('Last fired'); $table->head[6] = __('Status'); @@ -202,8 +290,12 @@ else $table->size[5] = '60px'; $table->head[0] = "" . __('F.') . ""; - $table->head[1] = __('Module'); - $table->head[2] = __('Template'); + $table->head[1] = __('Module') . ' ' . + '' . + ''; + $table->head[2] = __('Template') . ' ' . + '' . + ''; $table->head[3] = __('Action'); $table->head[4] = __('Last fired'); $table->head[5] = __('Status');