diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-08-29 10:06:42 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-08-29 10:06:42 +0000 |
commit | 450bedfbd08dbb30b3a6fa47abe411e2bc689024 (patch) | |
tree | b2a57904c928e0d63785109b7d8db93723e8e365 /frontends/php/include/triggers.inc.php | |
parent | 2ce640571ab5c0db1a26858f96ba804e36f1fb37 (diff) | |
download | zabbix-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/triggers.inc.php')
-rw-r--r-- | frontends/php/include/triggers.inc.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/frontends/php/include/triggers.inc.php b/frontends/php/include/triggers.inc.php index 59ea982d..a5a88820 100644 --- a/frontends/php/include/triggers.inc.php +++ b/frontends/php/include/triggers.inc.php @@ -329,7 +329,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; # Add item to hardlinked hosts - function add_trigger_to_templates($triggerid) + function add_trigger_to_linked_hosts($triggerid,$hostid=0) { if($triggerid<=0) { @@ -347,9 +347,15 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; $row=DBfetch($result); - $hostid=$row["hostid"]; - - $sql="select hostid,templateid,triggers from hosts_templates where templateid=$hostid"; + if($hostid==0) + { + $sql="select hostid,templateid,triggers from hosts_templates where templateid=".$row["hostid"]; + } + // Link to one host only + else + { + $sql="select hostid,templateid,triggers from hosts_templates where hostid=$hostid and templateid=".$row["hostid"]; + } $result=DBselect($sql); // Loop: linked hosts while($row=DBfetch($result)) |