2009-04-01 Esteban Sanchez <estebans@artica.es>
* pandoradb.sql, extras/pandoradb_migrate_v2.x_to_v3.0.sql: Added priority field to talert_templates and removed from talert_template_module. * godmode/alerts/alert_list.php: Fixed SQL notice when fetching groups. * godmode/alerts/alert_templates.php: Added priority to the template tooltip. * godmode/alerts/configure_alert_template.php: Added priority field to alert templates. * include/functions_db.php: Style correction. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1585 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
27bdc1e812
commit
4ce08b9496
|
@ -1,3 +1,20 @@
|
|||
2009-04-01 Esteban Sanchez <estebans@artica.es>
|
||||
|
||||
* pandoradb.sql, extras/pandoradb_migrate_v2.x_to_v3.0.sql: Added
|
||||
priority field to talert_templates and removed from
|
||||
talert_template_module.
|
||||
|
||||
* godmode/alerts/alert_list.php: Fixed SQL notice when fetching
|
||||
groups.
|
||||
|
||||
* godmode/alerts/alert_templates.php: Added priority to the template
|
||||
tooltip.
|
||||
|
||||
* godmode/alerts/configure_alert_template.php: Added priority field to
|
||||
alert templates.
|
||||
|
||||
* include/functions_db.php: Style correction.
|
||||
|
||||
2009-04-01 Jorge Gonzalez <jorgegonz@artica.es>
|
||||
|
||||
* include/languages/pt_BR.po, include/languages/es.po,
|
||||
|
@ -13,7 +30,7 @@
|
|||
Simplified Chineese, Italian, and Russian translations thanks to
|
||||
rosetta contributors.
|
||||
|
||||
include/languages/index.pot: Updated po template.
|
||||
* include/languages/index.pot: Updated po template.
|
||||
|
||||
2009-03-31 Esteban Sanchez <estebans@artica.es>
|
||||
|
||||
|
|
|
@ -98,6 +98,7 @@ CREATE TABLE IF NOT EXISTS `talert_templates` (
|
|||
`recovery_notify` tinyint(1) default '0',
|
||||
`field2_recovery` varchar(255) NOT NULL default '',
|
||||
`field3_recovery` mediumtext NOT NULL,
|
||||
`priority` tinyint(4) default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_alert_action`) REFERENCES talert_actions(`id`)
|
||||
ON DELETE SET NULL ON UPDATE CASCADE
|
||||
|
@ -112,7 +113,6 @@ CREATE TABLE IF NOT EXISTS `talert_template_modules` (
|
|||
`last_reference` bigint(20) NOT NULL default '0',
|
||||
`times_fired` int(3) NOT NULL default '0',
|
||||
`disabled` tinyint(1) default '0',
|
||||
`priority` tinyint(4) default '0',
|
||||
`force_execution` tinyint(1) default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_agent_module`) REFERENCES tagente_modulo(`id_agente_modulo`)
|
||||
|
|
|
@ -332,7 +332,7 @@ if (! $id_agente) {
|
|||
false, '', '', true);
|
||||
|
||||
$table->data['agent'][0] = __('Agent');
|
||||
$table->data['agent'][1] = print_select (array_keys (get_group_agents ($groups, false, "none")),
|
||||
$table->data['agent'][1] = print_select (array_keys (get_group_agents (array_keys ($groups), false, "none")),
|
||||
'id_agent', 0, false, __('Select'), 0, true);
|
||||
$table->data['agent'][1] .= ' <span id="agent_loading" class="invisible">';
|
||||
$table->data['agent'][1] .= '<img src="images/spinner.gif" />';
|
||||
|
|
|
@ -54,6 +54,10 @@ if (is_ajax ()) {
|
|||
echo '<br />';
|
||||
}
|
||||
|
||||
echo '<strong>'.__('Priority').':</strong> ';
|
||||
echo get_priority_name ($template['priority']);
|
||||
echo '<br />';
|
||||
|
||||
if ($template['monday'] && $template['tuesday']
|
||||
&& $template['wednesday'] && $template['thursday']
|
||||
&& $template['friday'] && $template['saturday']
|
||||
|
|
|
@ -119,6 +119,7 @@ function update_template ($step) {
|
|||
$max = (float) get_parameter ('max');
|
||||
$min = (float) get_parameter ('min');
|
||||
$matches = (bool) get_parameter ('matches_value');
|
||||
$priority = (int) get_parameter ('priority');
|
||||
|
||||
$result = update_alert_template ($id,
|
||||
array ('name' => $name,
|
||||
|
@ -127,7 +128,8 @@ function update_template ($step) {
|
|||
'value' => $value,
|
||||
'max_value' => $max,
|
||||
'min_value' => $min,
|
||||
'matches_value' => $matches));
|
||||
'matches_value' => $matches,
|
||||
'priority' => $priority));
|
||||
} elseif ($step == 2) {
|
||||
$monday = (bool) get_parameter ('monday');
|
||||
$tuesday = (bool) get_parameter ('tuesday');
|
||||
|
@ -215,6 +217,7 @@ $default_action = 0;
|
|||
$field1 = '';
|
||||
$field2 = '';
|
||||
$field3 = '';
|
||||
$priority = 1;
|
||||
$min_alerts = 0;
|
||||
$max_alerts = 1;
|
||||
$threshold = 300;
|
||||
|
@ -231,13 +234,15 @@ if ($create_template) {
|
|||
$max = (float) get_parameter ('max');
|
||||
$min = (float) get_parameter ('min');
|
||||
$matches = (bool) get_parameter ('matches_value');
|
||||
$priority = (int) get_parameter ('priority');
|
||||
|
||||
$result = create_alert_template ($name, $type,
|
||||
array ('description' => $description,
|
||||
'value' => $value,
|
||||
'max_value' => $max,
|
||||
'min_value' => $min,
|
||||
'matches_value' => $matches));
|
||||
'matches_value' => $matches,
|
||||
'priority' => $priority));
|
||||
|
||||
print_result_message ($result,
|
||||
__('Successfully created'),
|
||||
|
@ -289,6 +294,7 @@ if ($id && ! $create_template) {
|
|||
$field1 = $template['field1'];
|
||||
$field2 = $template['field2'];
|
||||
$field3 = $template['field3'];
|
||||
$priority = $template['priority'];
|
||||
}
|
||||
|
||||
echo '<h1>'.__('Configure alert template').'</h1>';
|
||||
|
@ -430,15 +436,24 @@ if ($step == 2) {
|
|||
$table->data[1][1] = print_textarea ('description', 10, 30,
|
||||
$description, '', true);
|
||||
|
||||
$table->data[2][0] = __('Condition type');
|
||||
$table->data[2][1] = print_select (get_alert_templates_types (), 'type',
|
||||
$type, '', __('Select'), 0, true, false, false);
|
||||
$table->data[2][0] = __('Priority');
|
||||
$table->data[2][1] = print_select (get_priorities (), 'priority',
|
||||
$priority, '', 0, 0, true, false, false);
|
||||
$table->data[2][1] .= '<span id="matches_value" '.($show_matches ? '' : 'style="display: none"').'>';
|
||||
$table->data[2][1] .= ' '.print_checkbox ('matches_value', 1, $matches, true);
|
||||
$table->data[2][1] .= print_label (__('Trigger when matches the value'),
|
||||
'checkbox-matches_value', true);
|
||||
$table->data[2][1] .= '</span>';
|
||||
|
||||
$table->data[3][0] = __('Condition type');
|
||||
$table->data[3][1] = print_select (get_alert_templates_types (), 'type',
|
||||
$type, '', __('Select'), 0, true, false, false);
|
||||
$table->data[3][1] .= '<span id="matches_value" '.($show_matches ? '' : 'style="display: none"').'>';
|
||||
$table->data[3][1] .= ' '.print_checkbox ('matches_value', 1, $matches, true);
|
||||
$table->data[3][1] .= print_label (__('Trigger when matches the value'),
|
||||
'checkbox-matches_value', true);
|
||||
$table->data[3][1] .= '</span>';
|
||||
|
||||
$table->data['value'][0] = __('Value');
|
||||
$table->data['value'][1] = print_input_text ('value', $value, '',
|
||||
35, 255, true);
|
||||
|
|
|
@ -249,6 +249,7 @@ CREATE TABLE IF NOT EXISTS `talert_templates` (
|
|||
`recovery_notify` tinyint(1) default '0',
|
||||
`field2_recovery` varchar(255) NOT NULL default '',
|
||||
`field3_recovery` mediumtext NOT NULL,
|
||||
`priority` tinyint(4) default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_alert_action`) REFERENCES talert_actions(`id`)
|
||||
ON DELETE SET NULL ON UPDATE CASCADE
|
||||
|
|
Loading…
Reference in New Issue