Changeset 6206
- Timestamp:
- 08/20/08 16:41:18 (5 months ago)
- Location:
- trunk/centreon/www/include/views/graphs
- Files:
-
- 2 modified
-
GetODSXmlGraph.php (modified) (9 diffs)
-
GetODSXmlTree.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/centreon/www/include/views/graphs/GetODSXmlGraph.php
r5943 r6206 48 48 */ 49 49 function getMyHostIDService($svc_id = NULL) { 50 if (!$svc_id) return;51 50 global $pearDB; 51 52 if (!$svc_id) 53 return; 54 52 55 $DBRESULT =& $pearDB->query("SELECT host_id FROM host h, host_service_relation hs WHERE h.host_id = hs.host_host_id AND hs.service_service_id = '".$svc_id."'"); 53 56 if (PEAR::isError($DBRESULT)) … … 121 124 122 125 $graphTs = array( NULL => NULL ); 123 $DBRESULT =& $pearDB->query("SELECT graph_id, name FROM giv_graphs_template ORDER BY name");126 $DBRESULT =& $pearDB->query("SELECT `graph_id`, `name` FROM `giv_graphs_template` ORDER BY `name`"); 124 127 if (PEAR::isError($DBRESULT)) 125 128 print "Mysql Error : ".$DBRESULT->getDebugInfo(); … … 142 145 $tab_tmp = split(",", $openid); 143 146 147 print_r($tab_tmp); 148 144 149 foreach ($tab_tmp as $openid) { 145 150 $tab_tmp = split("_", $openid); 146 151 $id = $tab_tmp[1]; 147 152 $type = $tab_tmp[0]; 153 154 print "|$type|"; 148 155 149 156 if ($type == 'HG') { 157 150 158 $hosts = getMyHostGroupHosts($id); 151 159 foreach ($hosts as $host) { … … 166 174 167 175 } else if ($type == 'HH') { 176 168 177 $services = getMyHostServices($id); 169 178 foreach ($services as $svc_id => $svc_name) { … … 177 186 } 178 187 } 188 179 189 } else if ($type == 'ST') { 190 180 191 $services = getMyServiceGroupServices($id); 181 192 foreach ($services as $svc_id => $svc_name) { … … 186 197 } 187 198 } 199 188 200 } else if ($type == 'MS') { 189 array_push($tab_id, $openid);201 array_push($tab_id, $openid); 190 202 } else { 191 $hosts = getMyServiceHosts($id);192 if ($hosts) {193 $host_id = array_pop($hosts);194 if (service_has_graph($host_id, $id) && (($is_admin) || (!$is_admin && isset($lca["LcaHost"][getMyHostName($id)]) && isset($lca["LcaHost"][getMyHostName($id)]["svc"][getMyServiceName($id)]))))195 array_push($tab_id, $openid);203 if (service_has_graph($tab_tmp[2], $tab_tmp[1]) 204 && (($is_admin) || 205 (!$is_admin && isset($lca["LcaHost"][getMyHostName($tab_tmp[2])]) 206 && isset($lca["LcaHost"][getMyHostName($tab_tmp[2])]["svc"][getMyServiceName($tab_tmp[1])])))){ 207 array_push($tab_id, $openid); 196 208 } 197 209 } 198 199 210 } 200 211 } … … 206 217 $tab_id = array(); 207 218 $tab_real_id = array(); 208 219 209 220 if (count($tab_tmp)){ 210 221 foreach ($tab_tmp as $openid) { … … 228 239 229 240 $tab_class = array("1" => "list_one", "0" => "list_two"); 230 241 231 242 foreach ($tab_real_id as $key => $openid) { 232 243 $bad_value = 0; … … 434 445 435 446 if ($type == "SS"){ 436 print "|".$openid."|";437 447 $tab_tmp = split("_", $openid); 438 448 $DBRESULT2 =& $pearDBO->query("SELECT id, service_id, service_description, host_name, special FROM index_data WHERE `trashed` = '0' AND special = '0' AND host_id = '".$tab_tmp[2]."' AND service_id = '".$tab_tmp[1]."'"); -
trunk/centreon/www/include/views/graphs/GetODSXmlTree.php
r6191 r6206 143 143 * get services for host 144 144 */ 145 $services = getMyHost Services($id);145 $services = getMyHostActiveServices($id); 146 146 $graphList = getMyHostGraphs($id); 147 147 $host_name = getMyHostName($id);
