2013-02-25 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_api.php, operation/agentes/alerts_status.php:
	improved the style code.
	
	* include/functions_alerts.php: in function "get_group_alerts" fixed
	the get all alerts, sometimes set empty the return array.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7712 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-25 13:21:24 +00:00
parent 83fb4e3e14
commit eb145f1d29
4 changed files with 103 additions and 83 deletions

View File

@ -1,3 +1,11 @@
2013-02-25 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php, operation/agentes/alerts_status.php:
improved the style code.
* include/functions_alerts.php: in function "get_group_alerts" fixed
the get all alerts, sometimes set empty the return array.
2013-02-25 Sergio Martin <sergio.martin@artica.es>
* include/functions_reports.php

View File

@ -1412,12 +1412,16 @@ function get_group_alerts ($id_group) {
require_once ($config["homedir"] . '/include/functions_agents.php');
$alerts = array ();
$alerts = array ('simple' => array());
$agents = agents_get_group_agents ($id_group, false, "none");
foreach ($agents as $agent_id => $agent_name) {
$agent_alerts = agents_get_alerts ($agent_id);
$alerts = array_merge ($alerts, $agent_alerts);
if (!empty($agent_alerts['simple']))
$alerts['simple'] = array_merge ($alerts['simple'],
$agent_alerts['simple']);
}
return $alerts;
@ -1444,7 +1448,8 @@ function get_alerts_fired ($alerts, $period = 0, $date = 0) {
foreach ($alerts as $alert) {
if (isset($alert['id'])) {
$fires = get_alert_fires_in_period ($alert['id'], $period, $date);
$fires = get_alert_fires_in_period($alert['id'],
$period, $date);
if (! $fires) {
continue;
}

View File

@ -68,7 +68,8 @@ if ($idAgent != 0) {
$id_group = agents_get_agent_group ($idAgent);
$is_extra = enterprise_hook('policies_is_agent_extra_policy', array($id_agente));
$is_extra = enterprise_hook('policies_is_agent_extra_policy',
array($id_agente));
if($is_extra === ENTERPRISE_NOT_HOOK) {
$is_extra = false;
@ -165,11 +166,13 @@ switch ($sortField) {
switch ($sort) {
case 'up':
$selectModuleUp = $selected;
$order = array('field' => 'agent_module_name', 'order' => 'ASC');
$order = array('field' => 'agent_module_name',
'order' => 'ASC');
break;
case 'down':
$selectModuleDown = $selected;
$order = array('field' => 'agent_module_name', 'order' => 'DESC');
$order = array('field' => 'agent_module_name',
'order' => 'DESC');
break;
}
break;
@ -177,11 +180,13 @@ switch ($sortField) {
switch ($sort) {
case 'up':
$selectTemplateUp = $selected;
$order = array('field' => 'template_name', 'order' => 'ASC');
$order = array('field' => 'template_name',
'order' => 'ASC');
break;
case 'down':
$selectTemplateDown = $selected;
$order = array('field' => 'template_name', 'order' => 'DESC');
$order = array('field' => 'template_name',
'order' => 'DESC');
break;
}
break;
@ -195,7 +200,8 @@ switch ($sortField) {
$selectModuleDown = '';
$selectTemplateUp = '';
$selectTemplateDown = '';
$order = array('field' => 'agent_module_name', 'order' => 'ASC');
$order = array('field' => 'agent_module_name',
'order' => 'ASC');
}
else {
$selectDisabledUp = '';
@ -206,7 +212,8 @@ switch ($sortField) {
$selectModuleDown = '';
$selectTemplateUp = '';
$selectTemplateDown = '';
$order = array('field' => 'agent_module_name', 'order' => 'ASC');
$order = array('field' => 'agent_module_name',
'order' => 'ASC');
}
break;
}