summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/export.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-02 08:34:41 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-02 08:34:41 +0000
commit82e68eabae069748d6691cab742f5fde436a56cb (patch)
tree17d7ca73441a35f93acd529c47caaf7387973382 /frontends/php/include/export.inc.php
parent83b5e44b019bfa89d96c3e14a903497eb93bcde7 (diff)
- added possibility to add triggers with same description but different expression
- fixes in export (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5575 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/export.inc.php')
-rw-r--r--frontends/php/include/export.inc.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/frontends/php/include/export.inc.php b/frontends/php/include/export.inc.php
index a86f4a5b..84b0c52d 100644
--- a/frontends/php/include/export.inc.php
+++ b/frontends/php/include/export.inc.php
@@ -325,22 +325,23 @@
// based on mod by scricca
$data = DBfetch(DBselect('SELECT hp.* FROM hosts_profiles hp WHERE hp.hostid='.$hostid));
- if(!$data) return false;
-
- zbx_xmlwriter_start_element ($memory,XML_TAG_HOSTPROFILE);
-
- $map =& $ZBX_EXPORT_MAP[XML_TAG_HOSTPROFILE];
-
- foreach($map['attribures'] as $db_name => $xml_name){
- if(empty($xml_name)) $xml_name = $db_name;
- zbx_xmlwriter_write_attribute($memory, $xml_name, $data[$db_name]);
- }
- foreach($map['elements'] as $db_name => $xml_name){
- if(empty($data[$db_name])) continue;
- if(empty($xml_name)) $xml_name = $db_name;
- zbx_xmlwriter_write_element($memory, $xml_name, $data[$db_name]);
+// if(!$data) return false;
+ if($data){
+ zbx_xmlwriter_start_element ($memory,XML_TAG_HOSTPROFILE);
+
+ $map =& $ZBX_EXPORT_MAP[XML_TAG_HOSTPROFILE];
+
+ foreach($map['attribures'] as $db_name => $xml_name){
+ if(empty($xml_name)) $xml_name = $db_name;
+ zbx_xmlwriter_write_attribute($memory, $xml_name, $data[$db_name]);
+ }
+ foreach($map['elements'] as $db_name => $xml_name){
+ if(empty($data[$db_name])) continue;
+ if(empty($xml_name)) $xml_name = $db_name;
+ zbx_xmlwriter_write_element($memory, $xml_name, $data[$db_name]);
+ }
+ zbx_xmlwriter_end_element($memory); // XML_TAG_HOSTPROFILE
}
- zbx_xmlwriter_end_element($memory);
//--
if($db_groups = DBselect('select g.name from groups g, hosts_groups hg'.