Changeset 5861
- Timestamp:
- 07/23/08 19:44:14 (2 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/centreon/www/include/common/XmlTree/GetODSXmlTree.php
r5437 r5861 16 16 */ 17 17 18 19 18 $debugXML = 0; 20 19 $buffer = ''; … … 43 42 */ 44 43 45 46 44 /* Connect to oreon DB */ 47 45 $dsn = array('phptype' => 'mysql', … … 65 63 $lca = getLCASVC($lca); 66 64 } 67 } else 65 } else { 68 66 exit(); 69 67 } 68 70 69 $normal_mode = 1; 71 70 (isset($_GET["mode"])) ? $normal_mode = $_GET["mode"] : $normal_mode = 1; … … 95 94 if (isset($lca["LcaHost"]) && isset($lca["LcaHost"][getMyHostName($host)]) && host_has_one_or_more_GraphService($host)) 96 95 print("<item child='1' id='HH_".$host."_".$id."' text='".getMyHostName($host)."' im0='../16x16/server_network.gif' im1='../16x16/server_network.gif' im2='../16x16/server_network.gif'></item>"); 96 } 97 } 98 } else if ($type == "ST") { 99 /* 100 * Send Service/host list for a SG 101 */ 102 $data = getMyServiceGroupServices($id); 103 foreach ($data as $key => $value){ 104 $tab_value = split("_", $key); 105 $host_name = getMyHostName($tab_value[0]); 106 $service_description = getMyServiceName($tab_value[1], $tab_value[0]); 107 if ($is_admin) { 108 print("<item child='0' id='HS_".$tab_value[1]."_".$tab_value[0]."' text='".$host_name." - ".$service_description."' im0='../16x16/gear.gif' im1='../16x16/gear.gif' im2='../16x16/gear.gif' ></item>"); 109 } else { 110 print("<item child='0' id='HS_".$tab_value[1]."_".$tab_value[0]."' text='".$host_name." - ".$service_description."' im0='../16x16/gear.gif' im1='../16x16/gear.gif' im2='../16x16/gear.gif' ></item>"); 97 111 } 98 112 } … … 119 133 print("<item child='1' id='HH_".$host["host_id"]."' text='".$host["host_name"]."' im0='../16x16/clients.gif' im1='../16x16/server_network.gif' im2='../16x16/server_network.gif'></item>"); 120 134 } 135 } else if ($type == "RS") { 136 /* 137 * Send Service Group list 138 */ 139 $DBRESULT =& $pearDB->query("SELECT DISTINCT * FROM servicegroup ORDER BY `sg_name`"); 140 if (PEAR::isError($DBRESULT)) 141 print "Mysql Error : ".$DBRESULT->getDebugInfo(); 142 while ($SG =& $DBRESULT->fetchRow()){ 143 $i++; 144 if ($is_admin){ 145 if (SGIsNotEmpty($SG["sg_id"])){ 146 print("<item child='1' id='ST_".$SG["sg_id"]."' text='".$SG["sg_name"]."' im0='../16x16/clients.gif' im1='../16x16/clients.gif' im2='../16x16/clients.gif' ></item>"); 147 } 148 } else { 149 if (SGIsNotEmpty($SG["sg_id"]) /*&& isset($lca["LcaHostGroup"]) && isset($lca["LcaHostGroup"][$HG["hg_alias"]])*/){ 150 print("<item child='1' id='ST_".$SG["sg_id"]."' text='".$SG["sg_name"]."' im0='../16x16/clients.gif' im1='../16x16/clients.gif' im2='../16x16/clients.gif' ></item>"); 151 } 152 } 153 } 154 $DBRESULT->free(); 121 155 } else if ($type == "RR") { 122 156 $DBRESULT =& $pearDB->query("SELECT DISTINCT * FROM hostgroup ORDER BY `hg_name`"); … … 178 212 } 179 213 } else { 180 print("<item nocheckbox='1' open='1' call='1' select='1' child='1' id='RR_0' text='All Graphs' im0='../16x16/clients.gif' im1='../16x16/clients.gif' im2='../16x16/clients.gif' >"); 214 print("<item nocheckbox='1' open='1' call='1' select='1' child='1' id='RR_0' text='HostGroups' im0='../16x16/clients.gif' im1='../16x16/clients.gif' im2='../16x16/clients.gif' >"); 215 print("<itemtext>label</itemtext>"); 216 print("</item>"); 217 print("<item nocheckbox='1' open='1' call='1' select='1' child='1' id='RS_0' text='ServiceGroups' im0='../16x16/clients.gif' im1='../16x16/clients.gif' im2='../16x16/clients.gif' >"); 181 218 print("<itemtext>label</itemtext>"); 182 219 print("</item>");
