diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | create/mysql/schema.sql | 11 | ||||
-rw-r--r-- | create/postgresql/schema.sql | 12 | ||||
-rw-r--r-- | frontends/php/config.php | 42 | ||||
-rw-r--r-- | frontends/php/include/local_en.inc.php | 2 | ||||
-rw-r--r-- | upgrades/dbpatches/1.1alpha4_to_1.1alpha5/mysql/patch.sql | 6 | ||||
-rw-r--r-- | upgrades/dbpatches/1.1alpha4_to_1.1alpha5/postgresql/patch.sql | 7 |
7 files changed, 81 insertions, 0 deletions
@@ -1,5 +1,6 @@ Changes for 1.1alpha5: + - added table 'escalations' (Alexei) - selection of configuration areas in config.php (Alexei) Changes for 1.1alpha4: diff --git a/create/mysql/schema.sql b/create/mysql/schema.sql index 747e45fa..2e66493b 100644 --- a/create/mysql/schema.sql +++ b/create/mysql/schema.sql @@ -606,3 +606,14 @@ CREATE TABLE images ( PRIMARY KEY (imageid), UNIQUE (imagetype, name) ) type=InnoDB; + +-- +-- Table structure for table 'escalations' +-- + +CREATE TABLE escalations ( + escalationid int(4) NOT NULL auto_increment, + name varchar(64) DEFAULT '0' NOT NULL, + PRIMARY KEY (escalationid), + UNIQUE (name) +) type=InnoDB; diff --git a/create/postgresql/schema.sql b/create/postgresql/schema.sql index fc9ef9b9..2a7b43ca 100644 --- a/create/postgresql/schema.sql +++ b/create/postgresql/schema.sql @@ -612,4 +612,16 @@ CREATE TABLE trends ( FOREIGN KEY (itemid) REFERENCES items ); +-- +-- Table structure for table 'escalations' +-- + +CREATE TABLE escalations ( + escalationid serial DEFAULT '0' NOT NULL, + name varchar(64) DEFAULT '0' NOT NULL, + PRIMARY KEY (escalationid) +); + +CREATE UNIQUE INDEX escalations_name on escalations (name); + VACUUM ANALYZE; diff --git a/frontends/php/config.php b/frontends/php/config.php index af172a66..5eee5389 100644 --- a/frontends/php/config.php +++ b/frontends/php/config.php @@ -95,6 +95,7 @@ $h2=$h2."<select class=\"biginput\" name=\"config\" onChange=\"submit()\">"; $h2=$h2."<option value=\"0\" ".iif(isset($_GET["config"])&&$_GET["config"]==0,"selected","").">".S_HOUSEKEEPER; $h2=$h2."<option value=\"1\" ".iif(isset($_GET["config"])&&$_GET["config"]==1,"selected","").">".S_MEDIA_TYPES; + $h2=$h2."<option value=\"2\" ".iif(isset($_GET["config"])&&$_GET["config"]==2,"selected","").">".S_ESCALATION_RULES; $h2=$h2."</select>"; show_header2($h1, $h2, "<form name=\"form2\" method=\"get\" action=\"config.php\">", "</form>"); @@ -275,5 +276,46 @@ ?> <?php + if($_GET["config"]==2) + { + echo "<br>"; + show_table_header(S_ESCALATION_RULES_BIG); + + table_begin(); + table_header(array(S_ID,S_DESCRIPTION_SMALL,S_ACTIONS)); + + $result=DBselect("select mt.mediatypeid,mt.type,mt.description,mt.smtp_server,mt.smtp_helo,mt.smtp_email,mt.exec_path from media_type mt order by mt.type"); + $col=0; + while($row=DBfetch($result)) + { + if($row["type"]==0) + { + $type=S_EMAIL; + } + else if($row["type"]==1) + { + $type=S_SCRIPT; + } + else + { + $type=S_UNKNOWN; + } + $actions="<a href=\"config.php?config=1®ister=change&mediatypeid=".$row["mediatypeid"]."\">".S_CHANGE."</a>"; + table_row(array( + $row["mediatypeid"], + $row["description"], + $actions),$col++); + } + if(DBnum_rows($result)==0) + { + echo "<TR BGCOLOR=#EEEEEE>"; + echo "<TD COLSPAN=4 ALIGN=CENTER>".S_NO_MEDIA_TYPES_DEFINED."</TD>"; + echo "<TR>"; + } + table_end(); + } +?> + +<?php show_footer(); ?> diff --git a/frontends/php/include/local_en.inc.php b/frontends/php/include/local_en.inc.php index 12713912..f0534da3 100644 --- a/frontends/php/include/local_en.inc.php +++ b/frontends/php/include/local_en.inc.php @@ -159,6 +159,8 @@ define("S_DELETE_SELECTED_MEDIA", "Delete selected media?"); define("S_HOUSEKEEPER", "Housekeeper"); define("S_MEDIA_TYPES", "Media types"); + define("S_ESCALATION_RULES", "Escalation rules"); + define("S_ESCALATION_RULES_BIG", "ESCALATION RULES"); // Latest values define("S_LATEST_VALUES", "Latest values"); diff --git a/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/mysql/patch.sql b/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/mysql/patch.sql new file mode 100644 index 00000000..cbad7e3a --- /dev/null +++ b/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/mysql/patch.sql @@ -0,0 +1,6 @@ +CREATE TABLE escalations ( + escalationid int(4) NOT NULL auto_increment, + name varchar(64) DEFAULT '0' NOT NULL, + PRIMARY KEY (escalationid), + UNIQUE (name) +) type=InnoDB; diff --git a/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/postgresql/patch.sql b/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/postgresql/patch.sql new file mode 100644 index 00000000..e47a30fd --- /dev/null +++ b/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/postgresql/patch.sql @@ -0,0 +1,7 @@ +CREATE TABLE escalations ( + escalationid serial DEFAULT '0' NOT NULL, + name varchar(64) DEFAULT '0' NOT NULL, + PRIMARY KEY (escalationid) +); + +CREATE UNIQUE INDEX escalations_name on escalations (name); |