mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
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:
parent
83fb4e3e14
commit
eb145f1d29
@ -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>
|
2013-02-25 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* include/functions_reports.php
|
* include/functions_reports.php
|
||||||
|
@ -1412,12 +1412,16 @@ function get_group_alerts ($id_group) {
|
|||||||
|
|
||||||
require_once ($config["homedir"] . '/include/functions_agents.php');
|
require_once ($config["homedir"] . '/include/functions_agents.php');
|
||||||
|
|
||||||
$alerts = array ();
|
$alerts = array ('simple' => array());
|
||||||
$agents = agents_get_group_agents ($id_group, false, "none");
|
$agents = agents_get_group_agents ($id_group, false, "none");
|
||||||
|
|
||||||
foreach ($agents as $agent_id => $agent_name) {
|
foreach ($agents as $agent_id => $agent_name) {
|
||||||
$agent_alerts = agents_get_alerts ($agent_id);
|
$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;
|
return $alerts;
|
||||||
@ -1444,7 +1448,8 @@ function get_alerts_fired ($alerts, $period = 0, $date = 0) {
|
|||||||
|
|
||||||
foreach ($alerts as $alert) {
|
foreach ($alerts as $alert) {
|
||||||
if (isset($alert['id'])) {
|
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) {
|
if (! $fires) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,8 @@ if ($idAgent != 0) {
|
|||||||
|
|
||||||
$id_group = agents_get_agent_group ($idAgent);
|
$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) {
|
if($is_extra === ENTERPRISE_NOT_HOOK) {
|
||||||
$is_extra = false;
|
$is_extra = false;
|
||||||
@ -165,11 +166,13 @@ switch ($sortField) {
|
|||||||
switch ($sort) {
|
switch ($sort) {
|
||||||
case 'up':
|
case 'up':
|
||||||
$selectModuleUp = $selected;
|
$selectModuleUp = $selected;
|
||||||
$order = array('field' => 'agent_module_name', 'order' => 'ASC');
|
$order = array('field' => 'agent_module_name',
|
||||||
|
'order' => 'ASC');
|
||||||
break;
|
break;
|
||||||
case 'down':
|
case 'down':
|
||||||
$selectModuleDown = $selected;
|
$selectModuleDown = $selected;
|
||||||
$order = array('field' => 'agent_module_name', 'order' => 'DESC');
|
$order = array('field' => 'agent_module_name',
|
||||||
|
'order' => 'DESC');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -177,11 +180,13 @@ switch ($sortField) {
|
|||||||
switch ($sort) {
|
switch ($sort) {
|
||||||
case 'up':
|
case 'up':
|
||||||
$selectTemplateUp = $selected;
|
$selectTemplateUp = $selected;
|
||||||
$order = array('field' => 'template_name', 'order' => 'ASC');
|
$order = array('field' => 'template_name',
|
||||||
|
'order' => 'ASC');
|
||||||
break;
|
break;
|
||||||
case 'down':
|
case 'down':
|
||||||
$selectTemplateDown = $selected;
|
$selectTemplateDown = $selected;
|
||||||
$order = array('field' => 'template_name', 'order' => 'DESC');
|
$order = array('field' => 'template_name',
|
||||||
|
'order' => 'DESC');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -195,7 +200,8 @@ switch ($sortField) {
|
|||||||
$selectModuleDown = '';
|
$selectModuleDown = '';
|
||||||
$selectTemplateUp = '';
|
$selectTemplateUp = '';
|
||||||
$selectTemplateDown = '';
|
$selectTemplateDown = '';
|
||||||
$order = array('field' => 'agent_module_name', 'order' => 'ASC');
|
$order = array('field' => 'agent_module_name',
|
||||||
|
'order' => 'ASC');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$selectDisabledUp = '';
|
$selectDisabledUp = '';
|
||||||
@ -206,7 +212,8 @@ switch ($sortField) {
|
|||||||
$selectModuleDown = '';
|
$selectModuleDown = '';
|
||||||
$selectTemplateUp = '';
|
$selectTemplateUp = '';
|
||||||
$selectTemplateDown = '';
|
$selectTemplateDown = '';
|
||||||
$order = array('field' => 'agent_module_name', 'order' => 'ASC');
|
$order = array('field' => 'agent_module_name',
|
||||||
|
'order' => 'ASC');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user