From 450bedfbd08dbb30b3a6fa47abe411e2bc689024 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Mon, 29 Aug 2005 10:06:42 +0000 Subject: - misc fixes for host-templates linkage (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@2009 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/items.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'frontends/php/include/items.inc.php') 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)) { -- cgit