mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-25 19:09:08 +02:00
2014-01-24 Sergio Martin <sergio.martin@artica.es>
* godmode/alerts/alert_list.list.php godmode/alerts/alert_view.php include/styles/pandora.css include/functions_alerts.php: Fix some bugs when doesnt exist an action with min-infinite situation. Some visual fixes git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b4c91bc31c
commit
2b23793949
@ -1,3 +1,12 @@
|
|||||||
|
2014-01-24 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
|
* godmode/alerts/alert_list.list.php
|
||||||
|
godmode/alerts/alert_view.php
|
||||||
|
include/styles/pandora.css
|
||||||
|
include/functions_alerts.php: Fix some bugs when
|
||||||
|
doesnt exist an action with min-infinite situation.
|
||||||
|
Some visual fixes
|
||||||
|
|
||||||
2014-01-23 Sergio Martin <sergio.martin@artica.es>
|
2014-01-23 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* godmode/alerts/alert_view.php
|
* godmode/alerts/alert_view.php
|
||||||
|
@ -448,6 +448,7 @@ foreach ($simple_alerts as $alert) {
|
|||||||
if ($default_action != "") {
|
if ($default_action != "") {
|
||||||
$data[2] .= "<tr><td><ul class='action_list'><li>";
|
$data[2] .= "<tr><td><ul class='action_list'><li>";
|
||||||
$data[2] .= db_get_sql ("SELECT name FROM talert_actions WHERE id = $default_action") . ' <em>(' . __('Default') . ')</em>';
|
$data[2] .= db_get_sql ("SELECT name FROM talert_actions WHERE id = $default_action") . ' <em>(' . __('Default') . ')</em>';
|
||||||
|
$data[2] .= ui_print_help_tip(__('The default actions will be executed every time that the alert is fired and no other action is executed'), true);
|
||||||
$data[2] .= "</li></ul></td>";
|
$data[2] .= "</li></ul></td>";
|
||||||
$data[2] .= "<td></td>";
|
$data[2] .= "<td></td>";
|
||||||
$data[2] .= "</tr>";
|
$data[2] .= "</tr>";
|
||||||
|
@ -355,7 +355,12 @@ else {
|
|||||||
|
|
||||||
if (count($table->head) <= count($action['escalation'])) {
|
if (count($table->head) <= count($action['escalation'])) {
|
||||||
if ($k == count($action['escalation'])) {
|
if ($k == count($action['escalation'])) {
|
||||||
$table->head[$k] = '>#' . ($k-1);
|
if($k == 1) {
|
||||||
|
$table->head[$k] = __('Every time that the alert is fired');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$table->head[$k] = '>#' . ($k-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$table->head[$k] = '#' . $k;
|
$table->head[$k] = '#' . $k;
|
||||||
@ -372,7 +377,7 @@ else {
|
|||||||
$table->data[$kaction][$k+1] = human_time_description_raw ($action_threshold, true, 'tiny');
|
$table->data[$kaction][$k+1] = human_time_description_raw ($action_threshold, true, 'tiny');
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->head[$k+1] = __('Threshold') . '<span style="float: right;">' . ui_print_help_icon ('action_threshold', true) . '</span>';
|
$table->head[$k+1] = __('Threshold') . '<span style="float: right;">' . ui_print_help_icon ('action_threshold', true, '', 'images/header_help.png') . '</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1926,11 +1926,13 @@ function alerts_get_default_action_escalation($default_action, $escalation) {
|
|||||||
// Set to 1 the busy executions
|
// Set to 1 the busy executions
|
||||||
// Set to 2 the min - infinite situations
|
// Set to 2 the min - infinite situations
|
||||||
foreach($busy_times as $k => $v) {
|
foreach($busy_times as $k => $v) {
|
||||||
if ($k == ($busy_greater_than + 1)) {
|
if ($busy_greater_than != -1) {
|
||||||
$busy_times[$k] = 2;
|
if ($k == ($busy_greater_than + 1)) {
|
||||||
}
|
$busy_times[$k] = 2;
|
||||||
else if ($k > ($busy_greater_than + 1)) {
|
}
|
||||||
unset($busy_times[$k]);
|
else if ($k > ($busy_greater_than + 1)) {
|
||||||
|
unset($busy_times[$k]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ($v > 1) {
|
else if ($v > 1) {
|
||||||
$busy_times[$k] = 1;
|
$busy_times[$k] = 1;
|
||||||
@ -1949,7 +1951,7 @@ function alerts_get_default_action_escalation($default_action, $escalation) {
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
$default_escalation[$k] = 0;
|
$default_escalation[$k] = 0;
|
||||||
$default_escalation[$k+1] = 2;
|
$default_escalation[$k] = 2;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
break;
|
break;
|
||||||
@ -1967,6 +1969,17 @@ function alerts_get_default_action_escalation($default_action, $escalation) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($busy_times)) {
|
||||||
|
if ($busy_greater_than == -1) {
|
||||||
|
$default_escalation = 'everytime';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for($i=1;$i<=$busy_greater_than;$i++) {
|
||||||
|
$default_escalation[$i] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $default_escalation;
|
return $default_escalation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1982,12 +1995,12 @@ function alerts_normalize_actions_escalation($escalation) {
|
|||||||
$max_elements = 0;
|
$max_elements = 0;
|
||||||
|
|
||||||
foreach($escalation as $k => $v) {
|
foreach($escalation as $k => $v) {
|
||||||
if (isset($v['greater_than'])) {
|
if (is_array($v) && isset($v['greater_than'])) {
|
||||||
$escalation[$k] = array();
|
$escalation[$k] = array();
|
||||||
for($i=1;$i<=$v['greater_than'];$i++) {
|
for($i=1;$i<$v['greater_than'];$i++) {
|
||||||
$escalation[$k][$i] = 0;
|
$escalation[$k][$i] = 0;
|
||||||
}
|
}
|
||||||
$escalation[$k][$v['greater_than']+1] = 2;
|
$escalation[$k][$v['greater_than']] = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
$n = count($escalation[$k]);
|
$n = count($escalation[$k]);
|
||||||
@ -1996,23 +2009,30 @@ function alerts_normalize_actions_escalation($escalation) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($max_elements == 1) {
|
||||||
|
$nelements = $max_elements;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$nelements = $max_elements+1;
|
||||||
|
}
|
||||||
|
|
||||||
foreach($escalation as $k => $v) {
|
foreach($escalation as $k => $v) {
|
||||||
if ($v == 'always') {
|
if ($v == 'everytime') {
|
||||||
$escalation[$k] = array_fill(1, $max_elements, 1);
|
$escalation[$k] = array_fill(1, $nelements, 1);
|
||||||
$escalation[$k][$max_elements+1] = 1;
|
$escalation[$k][$max_elements] = 2;
|
||||||
}
|
}
|
||||||
else if ($v == 'never') {
|
else if ($v == 'never') {
|
||||||
$escalation[$k] = array_fill(1, ($max_elements), 0);
|
$escalation[$k] = array_fill(1, $nelements, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$fill_value = 0;
|
$fill_value = 0;
|
||||||
for($i=1;$i<=($max_elements+1);$i++) {
|
for($i=1;$i<=$nelements;$i++) {
|
||||||
if (!isset($escalation[$k][$i])) {
|
if (!isset($escalation[$k][$i])) {
|
||||||
$escalation[$k][$i] = $fill_value;
|
$escalation[$k][$i] = $fill_value;
|
||||||
}
|
}
|
||||||
else if ($escalation[$k][$i] == 2) {
|
else if ($escalation[$k][$i] == 2) {
|
||||||
$fill_value = 1;
|
$fill_value = 1;
|
||||||
$escalation[$k][$i] = $fill_value;
|
$escalation[$k][$i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2834,7 +2834,7 @@ div#agent_wizard_subtabs {
|
|||||||
|
|
||||||
/* Alert view */
|
/* Alert view */
|
||||||
|
|
||||||
table.alert_days th, table.alert_time th, table.alert_escalation th{
|
table.alert_days th, table.alert_time th{
|
||||||
height: 30px;
|
height: 30px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user