diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-01-02 11:58:31 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-01-02 11:58:31 +0000 |
commit | 99fffbaf39e6bdd1382b9673b3a80f7d7f091bf6 (patch) | |
tree | e491f98a257ef398e72d81f0602a666acfb3a271 | |
parent | bc1e6524c3bd99dd5c2befd7a977a47717a1921f (diff) | |
download | zabbix-99fffbaf39e6bdd1382b9673b3a80f7d7f091bf6.tar.gz zabbix-99fffbaf39e6bdd1382b9673b3a80f7d7f091bf6.tar.xz zabbix-99fffbaf39e6bdd1382b9673b3a80f7d7f091bf6.zip |
- screens and actions will not be under control of templates (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2476 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | create/mysql/schema.sql | 2 | ||||
-rw-r--r-- | create/postgresql/schema.sql | 2 | ||||
-rw-r--r-- | frontends/php/hosts.php | 41 | ||||
-rw-r--r-- | frontends/php/include/config.inc.php | 8 | ||||
-rw-r--r-- | frontends/php/include/forms.inc.php | 18 | ||||
-rw-r--r-- | upgrades/dbpatches/1.1beta4_to_1.1beta5/mysql/patch.sql | 3 | ||||
-rw-r--r-- | upgrades/dbpatches/1.1beta4_to_1.1beta5/postgresql/patch.sql | 3 |
8 files changed, 19 insertions, 59 deletions
@@ -1,5 +1,6 @@ Changes for 1.1beta5: + - screens and actions will not be under control of templates (Alexei) - minor fix for enabling recovered hosts (Alexei) - new trigger function: regexp (Alexei) - support of function str() for item type 'log' (Alexei) diff --git a/create/mysql/schema.sql b/create/mysql/schema.sql index 87677cff..02730bcd 100644 --- a/create/mysql/schema.sql +++ b/create/mysql/schema.sql @@ -710,9 +710,7 @@ CREATE TABLE hosts_templates ( templateid int(4) DEFAULT '0' NOT NULL, items int(1) DEFAULT '0' NOT NULL, triggers int(1) DEFAULT '0' NOT NULL, - actions int(1) DEFAULT '0' NOT NULL, graphs int(1) DEFAULT '0' NOT NULL, - screens int(1) DEFAULT '0' NOT NULL, PRIMARY KEY (hosttemplateid), UNIQUE (hostid, templateid) ) type=InnoDB; diff --git a/create/postgresql/schema.sql b/create/postgresql/schema.sql index 95afe961..aceb8912 100644 --- a/create/postgresql/schema.sql +++ b/create/postgresql/schema.sql @@ -719,9 +719,7 @@ CREATE TABLE hosts_templates ( templateid int4 DEFAULT '0' NOT NULL, items int2 DEFAULT '0' NOT NULL, triggers int2 DEFAULT '0' NOT NULL, - actions int2 DEFAULT '0' NOT NULL, graphs int2 DEFAULT '0' NOT NULL, - screens int2 DEFAULT '0' NOT NULL, PRIMARY KEY (hosttemplateid) ); diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 1903751f..ea127748 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -65,19 +65,11 @@ if(isset($_REQUEST["triggers_add"])) $triggers=$triggers|1; if(isset($_REQUEST["triggers_update"])) $triggers=$triggers|2; if(isset($_REQUEST["triggers_delete"])) $triggers=$triggers|4; - $actions=0; - if(isset($_REQUEST["actions_add"])) $actions=$actions|1; - if(isset($_REQUEST["actions_update"])) $actions=$actions|2; - if(isset($_REQUEST["actions_delete"])) $actions=$actions|4; $graphs=0; if(isset($_REQUEST["graphs_add"])) $graphs=$graphs|1; if(isset($_REQUEST["graphs_update"])) $graphs=$graphs|2; if(isset($_REQUEST["graphs_delete"])) $graphs=$graphs|4; - $screens=0; - if(isset($_REQUEST["screens_add"])) $screens=$screens|1; - if(isset($_REQUEST["screens_update"])) $screens=$screens|2; - if(isset($_REQUEST["screens_delete"])) $screens=$screens|4; - $result=add_template_linkage($_REQUEST["hostid"],$_REQUEST["templateid"],$items,$triggers,$actions,$graphs,$screens); + $result=add_template_linkage($_REQUEST["hostid"],$_REQUEST["templateid"],$items,$triggers,$graphs); show_messages($result, S_TEMPLATE_LINKAGE_ADDED, S_CANNOT_ADD_TEMPLATE_LINKAGE); } if($_REQUEST["register"]=="update linkage") @@ -90,19 +82,11 @@ if(isset($_REQUEST["triggers_add"])) $triggers=$triggers|1; if(isset($_REQUEST["triggers_update"])) $triggers=$triggers|2; if(isset($_REQUEST["triggers_delete"])) $triggers=$triggers|4; - $actions=0; - if(isset($_REQUEST["actions_add"])) $actions=$actions|1; - if(isset($_REQUEST["actions_update"])) $actions=$actions|2; - if(isset($_REQUEST["actions_delete"])) $actions=$actions|4; $graphs=0; if(isset($_REQUEST["graphs_add"])) $graphs=$graphs|1; if(isset($_REQUEST["graphs_update"])) $graphs=$graphs|2; if(isset($_REQUEST["graphs_delete"])) $graphs=$graphs|4; - $screens=0; - if(isset($_REQUEST["screens_add"])) $screens=$screens|1; - if(isset($_REQUEST["screens_update"])) $screens=$screens|2; - if(isset($_REQUEST["screens_delete"])) $screens=$screens|4; - $result=update_template_linkage($_REQUEST["hosttemplateid"],$_REQUEST["hostid"],$_REQUEST["templateid"],$items,$triggers,$actions,$graphs,$screens); + $result=update_template_linkage($_REQUEST["hosttemplateid"],$_REQUEST["hostid"],$_REQUEST["templateid"],$items,$triggers,$graphs); show_messages($result, S_TEMPLATE_LINKAGE_UPDATED, S_CANNOT_UPDATE_TEMPLATE_LINKAGE); } if($_REQUEST["register"]=="delete linkage") @@ -428,11 +412,10 @@ <?php if(isset($_REQUEST["hostid"])&&($_REQUEST["config"]==2)) { - table_begin(); - table_header(array(S_HOST,S_TEMPLATE,S_ITEMS,S_TRIGGERS,S_ACTIONS,S_GRAPHS,S_SCREENS,S_ACTIONS)); + $table = new Ctable(S_NO_LINKAGES_DEFINED); + $table->setHeader(array(S_HOST,S_TEMPLATE,S_ITEMS,S_TRIGGERS,S_GRAPHS,S_ACTIONS)); - $result=DBselect("select hosttemplateid,hostid,templateid,items,triggers,actions,graphs,screens from hosts_templates where hostid=".$_REQUEST["hostid"]); - $col=0; + $result=DBselect("select * from hosts_templates where hostid=".$_REQUEST["hostid"]); while($row=DBfetch($result)) { $host=get_host_by_hostid($row["hostid"]); @@ -441,24 +424,16 @@ # $actions="<A HREF=\"hosts.php?config=".$_REQUEST["config"]."&groupid=".$row["groupid"]."#form\">".S_CHANGE."</A>"; $actions="<a href=\"hosts.php?config=2&hostid=".$row["hostid"]."&hosttemplateid=".$row["hosttemplateid"]."\">".S_CHANGE."</a>"; - table_row(array( + $table->addRow(array( $host["host"], $template["host"], get_template_permission_str($row["items"]), get_template_permission_str($row["triggers"]), - get_template_permission_str($row["actions"]), get_template_permission_str($row["graphs"]), - get_template_permission_str($row["screens"]), $actions - ),$col++); - } - if(DBnum_rows($result)==0) - { - echo "<TR BGCOLOR=#EEEEEE>"; - echo "<TD COLSPAN=8 ALIGN=CENTER>".S_NO_LINKAGES_DEFINED."</TD>"; - echo "<TR>"; + )); } - table_end(); + $table->show(); } if(isset($_REQUEST["hostid"])&&$_REQUEST["config"]==2) { diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 2d323c1a..58c0cd35 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -1559,16 +1559,16 @@ echo "</head>"; } # Add host-template linkage - function add_template_linkage($hostid,$templateid,$items,$triggers,$actions,$graphs,$screens) + function add_template_linkage($hostid,$templateid,$items,$triggers,$graphs) { - $sql="insert into hosts_templates (hostid,templateid,items,triggers,actions,graphs,screens) values ($hostid,$templateid,$items,$triggers,$actions,$graphs,$screens)"; + $sql="insert into hosts_templates (hostid,templateid,items,triggers,graphs) values ($hostid,$templateid,$items,$triggers,$graphs)"; return DBexecute($sql); } # Update host-template linkage - function update_template_linkage($hosttemplateid,$hostid,$templateid,$items,$triggers,$actions,$graphs,$screens) + function update_template_linkage($hosttemplateid,$hostid,$templateid,$items,$triggers,$graphs) { - $sql="update hosts_templates set hostid=$hostid,templateid=$templateid,items=$items,triggers=$triggers,actions=$actions,graphs=$graphs,screens=$screens where hosttemplateid=$hosttemplateid"; + $sql="update hosts_templates set hostid=$hostid,templateid=$templateid,items=$items,triggers=$triggers,graphs=$graphs where hosttemplateid=$hosttemplateid"; return DBexecute($sql); } diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index 6b3e2492..9232b99d 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -38,9 +38,7 @@ $template=get_host_by_hostid($templateid); $items=$row["items"]; $triggers=$row["triggers"]; - $actions=$row["actions"]; $graphs=$row["graphs"]; - $screens=$row["screens"]; } else { @@ -48,9 +46,7 @@ $templateid=0; $items=7; $triggers=7; - $actions=7; $graphs=7; - $screens=7; } $col=0; @@ -103,26 +99,12 @@ echo "<input type=checkbox ".iif((4&$triggers)==4,"checked","")." name=\"triggers_delete\" \">".S_DELETE; show_table2_v_delimiter($col++); - echo S_ACTIONS; - show_table2_h_delimiter(); - echo "<input type=checkbox ".iif((1&$actions)==1,"checked","")." name=\"actions_add\" \">".S_ADD; - echo "<input type=checkbox ".iif((2&$actions)==2,"checked","")." name=\"actions_update\" \">".S_UPDATE; - echo "<input type=checkbox ".iif((4&$actions)==4,"checked","")." name=\"actions_delete\" \">".S_DELETE; - - show_table2_v_delimiter($col++); echo S_GRAPHS; show_table2_h_delimiter(); echo "<input type=checkbox ".iif((1&$graphs)==1,"checked","")." name=\"graphs_add\" \">".S_ADD; echo "<input type=checkbox ".iif((2&$graphs)==2,"checked","")." name=\"graphs_update\" \">".S_UPDATE; echo "<input type=checkbox ".iif((4&$graphs)==4,"checked","")." name=\"graphs_delete\" \">".S_DELETE; - show_table2_v_delimiter($col++); - echo S_SCREENS; - show_table2_h_delimiter(); - echo "<input type=checkbox ".iif((1&$screens)==1,"checked","")." name=\"screens_add\" \">".S_ADD; - echo "<input type=checkbox ".iif((2&$screens)==2,"checked","")." name=\"screens_update\" \">".S_UPDATE; - echo "<input type=checkbox ".iif((4&$screens)==4,"checked","")." name=\"screens_delete\" \">".S_DELETE; - show_table2_v_delimiter2($col++); echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add linkage\">"; if(isset($hosttemplateid)) diff --git a/upgrades/dbpatches/1.1beta4_to_1.1beta5/mysql/patch.sql b/upgrades/dbpatches/1.1beta4_to_1.1beta5/mysql/patch.sql index 0daf38db..32f8d88c 100644 --- a/upgrades/dbpatches/1.1beta4_to_1.1beta5/mysql/patch.sql +++ b/upgrades/dbpatches/1.1beta4_to_1.1beta5/mysql/patch.sql @@ -1,5 +1,8 @@ alter table screens_items add elements int(4) DEFAULT '25' NOT NULL; +alter table hosts_templates drop screens; +alter table hosts_templates drop actions; + -- -- Table structure for table 'conditions' -- diff --git a/upgrades/dbpatches/1.1beta4_to_1.1beta5/postgresql/patch.sql b/upgrades/dbpatches/1.1beta4_to_1.1beta5/postgresql/patch.sql index ad07405e..5a7c9ae1 100644 --- a/upgrades/dbpatches/1.1beta4_to_1.1beta5/postgresql/patch.sql +++ b/upgrades/dbpatches/1.1beta4_to_1.1beta5/postgresql/patch.sql @@ -1,5 +1,8 @@ alter table screens_items add elements int4 DEFAULT '25' NOT NULL; +alter table hosts_templates drop screens; +alter table hosts_templates drop actions; + -- -- Table structure for table 'conditions' -- |