summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/items.inc.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-08-29 10:06:42 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-08-29 10:06:42 +0000
commit450bedfbd08dbb30b3a6fa47abe411e2bc689024 (patch)
treeb2a57904c928e0d63785109b7d8db93723e8e365 /frontends/php/include/items.inc.php
parent2ce640571ab5c0db1a26858f96ba804e36f1fb37 (diff)
downloadzabbix-450bedfbd08dbb30b3a6fa47abe411e2bc689024.tar.gz
zabbix-450bedfbd08dbb30b3a6fa47abe411e2bc689024.tar.xz
zabbix-450bedfbd08dbb30b3a6fa47abe411e2bc689024.zip
- misc fixes for host-templates linkage (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2009 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/items.inc.php')
-rw-r--r--frontends/php/include/items.inc.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php
index b58a4685..7b03f235 100644
--- a/frontends/php/include/items.inc.php
+++ b/frontends/php/include/items.inc.php
@@ -186,7 +186,7 @@
# Add item to hardlinked hosts
- function add_item_to_templates($itemid)
+ function add_item_to_linked_hosts($itemid,$hostid=0)
{
if($itemid<=0)
{
@@ -195,7 +195,15 @@
$item=get_item_by_itemid($itemid);
- $sql="select hostid,templateid,items from hosts_templates where templateid=".$item["hostid"];
+ // Link with one host only
+ if($hostid!=0)
+ {
+ $sql="select hostid,templateid,items from hosts_templates where hostid=$hostid and templateid=".$item["hostid"];
+ }
+ else
+ {
+ $sql="select hostid,templateid,items from hosts_templates where templateid=".$item["hostid"];
+ }
$result=DBselect($sql);
while($row=DBfetch($result))
{