From 82e68eabae069748d6691cab742f5fde436a56cb Mon Sep 17 00:00:00 2001 From: artem Date: Wed, 2 Apr 2008 08:34:41 +0000 Subject: - 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 --- frontends/php/include/export.inc.php | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'frontends/php/include/export.inc.php') 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'. -- cgit