diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2004-03-07 08:07:46 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2004-03-07 08:07:46 +0000 |
| commit | ef4d76165d7365abcc8bfc816ef4f1e8a182ed26 (patch) | |
| tree | fec8b1018121ec81dc43e645ba6803f908b785b3 /frontends/php | |
| parent | 23f5bd1e6cacc66e9efbe151e4b809a09150c9eb (diff) | |
| download | zabbix-ef4d76165d7365abcc8bfc816ef4f1e8a182ed26.tar.gz zabbix-ef4d76165d7365abcc8bfc816ef4f1e8a182ed26.tar.xz zabbix-ef4d76165d7365abcc8bfc816ef4f1e8a182ed26.zip | |
- added button "add items from template" (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@1290 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/hosts.php | 7 | ||||
| -rw-r--r-- | frontends/php/include/config.inc.php | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 0d92566c..d26a9d00 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -44,6 +44,12 @@ show_messages($result,"Host added","Cannot add host"); unset($HTTP_GET_VARS["hostid"]); } + if($HTTP_GET_VARS["register"]=="add items from template") + { + $result=add_using_host_template($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["host_templateid"]); + show_messages($result,"Items added","Cannot add items"); + unset($HTTP_GET_VARS["hostid"]); + } if($HTTP_GET_VARS["register"]=="update") { $result=@update_host($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["host"],$HTTP_GET_VARS["port"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["useip"],$HTTP_GET_VARS["ip"],$HTTP_GET_VARS["newgroup"],$HTTP_GET_VARS["groups"]); @@ -432,6 +438,7 @@ echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">"; if(isset($HTTP_GET_VARS["hostid"])) { + echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add items from template\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('Delete selected host?');\">"; } diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 14c2370c..0c5e0350 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -2776,6 +2776,14 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; function add_using_host_template($hostid,$host_templateid) { + global $ERROR_MSG; + + if(!isset($host_templateid)||($host_templateid==0)) + { + $ERROR_MSG="Select template first"; + return 0; + } + $host=get_host_by_hostid($hostid); $sql="select itemid from items where hostid=$host_templateid"; $result=DBselect($sql); |
