2012-04-13 Junichi Satoh <junichi@rworks.jp>

* godmode/alerts/configure_alert_compound.php: Added special days
	feature.

	* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
	extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
	extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
	extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql: Added column
	'special_day' to 'talert_compound'.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5965 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2012-04-13 06:41:28 +00:00
parent 3c3f8ab38b
commit 506809d4e5
8 changed files with 42 additions and 3 deletions

View File

@ -1,3 +1,14 @@
2012-04-13 Junichi Satoh <junichi@rworks.jp>
* godmode/alerts/configure_alert_compound.php: Added special days
feature.
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql: Added column
'special_day' to 'talert_compound'.
2012-04-12 Vanessa Gil <vanessa.gil@artica.es>
* extensions/tree.php

View File

@ -197,3 +197,9 @@ ALTER TABLE `treport_content_item` ADD COLUMN `operation` TEXT DEFAULT '';
-- Table `tmensajes`
-- -----------------------------------------------------
ALTER TABLE `tmensajes` MODIFY COLUMN `mensaje` TEXT NOT NULL DEFAULT '';
-- -----------------------------------------------------
-- Table `talert_compound`
-- -----------------------------------------------------
ALTER TABLE `talert_compound` ADD COLUMN `special_day` tinyint(1) DEFAULT '0';

View File

@ -193,3 +193,9 @@ ALTER TABLE treport_content_item ADD (operation CLOB default '');
-- Table `tmensajes`
-- -----------------------------------------------------
ALTER TABLE tmensajes MODIFY mensaje VARCHAR2(255) NOT NULL DEFAULT '';
-- -----------------------------------------------------
-- Table `talert_compound`
-- -----------------------------------------------------
alter table talert_compound add (special_day NUMBER(5,0) default 0);

View File

@ -185,3 +185,9 @@ ALTER TABLE "treport_content_item" ADD COLUMN "operation" text default '';
-- Table `tmensajes`
-- -----------------------------------------------------
ALTER TABLE "tmensajes" ALTER COLUMN "mensaje" TYPE TEXT;
-- -----------------------------------------------------
-- Table `talert_compound`
-- -----------------------------------------------------
ALTER TABLE "talert_compound" ADD COLUMN "special_day" SMALLINT default 0;

View File

@ -131,6 +131,7 @@ function update_compound ($step) {
$friday = (bool) get_parameter ('friday');
$saturday = (bool) get_parameter ('saturday');
$sunday = (bool) get_parameter ('sunday');
$special_day = (bool) get_parameter ('special_day');
$time_from = (string) get_parameter ('time_from');
$time_from = date ("H:s:00", strtotime ($time_from));
$time_to = (string) get_parameter ('time_to');
@ -151,6 +152,7 @@ function update_compound ($step) {
'friday' => $friday,
'saturday' => $saturday,
'sunday' => $sunday,
'special_day' => $special_day,
'time_from' => $time_from,
'time_to' => $time_to,
'time_threshold' => $threshold,
@ -166,6 +168,7 @@ function update_compound ($step) {
'friday' => $friday,
'saturday' => $saturday,
'sunday' => $sunday,
'special_day' => $special_day,
'time_from' => "#to_date('" . $time_from . "', 'hh24:mi:ss')",
'time_to' => "#to_date('" . $time_to . "', 'hh24:mi:ss')",
'time_threshold' => $threshold,
@ -226,6 +229,7 @@ $thursday = true;
$friday = true;
$saturday = true;
$sunday = true;
$special_day = false;
$default_action = 0;
$field1 = '';
$field2 = '';
@ -250,6 +254,7 @@ if ($id && ! $create_compound) {
$friday = (bool) $compound['friday'];
$saturday = (bool) $compound['saturday'];
$sunday = (bool) $compound['sunday'];
$special_day = (bool) $template['special_day'];
$max_alerts = $compound['max_alerts'];
$min_alerts = $compound['min_alerts'];
$threshold = $compound['time_threshold'];
@ -337,7 +342,6 @@ if ($step == 2) {
$table->rowstyle['preview'] = 'display: none';
}
$table->colspan = array ();
$table->colspan[0][1] = 3;
$table->colspan[4][1] = 3;
$table->colspan['actions'][1] = 3;
$table->colspan['field1'][1] = 3;
@ -361,6 +365,9 @@ if ($step == 2) {
$table->data[0][1] .= __('Sun');
$table->data[0][1] .= html_print_checkbox ('sunday', 1, $sunday, true);
$table->data[0][2] = __('Use special days list');
$table->data[0][3] = html_print_checkbox ('special_day', 1, $special_day, true);
$table->data[1][0] = __('Time from');
$table->data[1][1] = html_print_input_text ('time_from', $time_from, '', 7, 7,
true);

View File

@ -405,7 +405,8 @@ CREATE TABLE talert_compound (
last_reference NUMBER(19, 0) default 0 NOT NULL,
times_fired NUMBER(10, 0) default 0 NOT NULL,
disabled NUMBER(5, 0) default 0,
priority NUMBER(5, 0) default 0
priority NUMBER(5, 0) default 0,
special_day NUMBER(5, 0) default 0
);
CREATE SEQUENCE talert_compound_s INCREMENT BY 1 START WITH 1;

View File

@ -332,7 +332,8 @@ CREATE TABLE "talert_compound" (
"last_reference" BIGINT NOT NULL default 0,
"times_fired" INTEGER NOT NULL default 0,
"disabled" SMALLINT default 0,
"priority" SMALLINT default 0
"priority" SMALLINT default 0,
"special_day" SMALLINT default 0
);
CREATE TYPE type_talert_compound_elements_operation AS ENUM ('NOP', 'AND','OR','XOR','NAND','NOR','NXOR');

View File

@ -361,6 +361,7 @@ CREATE TABLE IF NOT EXISTS `talert_compound` (
`times_fired` int(3) NOT NULL default '0',
`disabled` tinyint(1) default '0',
`priority` tinyint(4) default '0',
`special_day` tinyint(1) default 0,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
ON DELETE CASCADE ON UPDATE CASCADE