Skip to content

Commit

Permalink
One more correction for the search results and a slight update the th…
Browse files Browse the repository at this point in the history
…e lineage function to make it more streamlined.
  • Loading branch information
wilpig committed Jul 29, 2015
1 parent 352980c commit 349e8c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions assets.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2622,14 +2622,12 @@ function GetDeviceDCID(){
function GetDeviceLineage() {
$devList=array();
$num=1;
$devList[$num]=new Device();
$devList[$num]->DeviceID=$this->DeviceID;
$devList[$num]=new Device($this->DeviceID);
$devList[$num]->GetDevice();

while ( $devList[$num]->ParentDevice <> 0) {
while($devList[$num]->ParentDevice>0){
$num++;
$devList[$num]=new Device();
$devList[$num]->DeviceID = $devList[$num-1]->ParentDevice;
$devList[$num]=new Device($devList[$num-1]->ParentDevice);
$devList[$num]->GetDevice();
}
return $devList;
Expand Down
6 changes: 3 additions & 3 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
$childList=array(); // List of all blade devices
$dctemp=array(); // List of datacenters involved with result set
$pduList=array(); // List of CDUs
while(list($devID,$device)=each($devList)){
if($device->DeviceType="CDU"){
foreach($devList as $devID => $device){
if($device->DeviceType=="CDU"){
$pduList[$devID]=$device;
}else{
$temp[$x]['devid']=$devID;
Expand All @@ -108,7 +108,7 @@
$temp[$x]['rights']=$device->Rights;
$cabtemp[$device->Cabinet]="";
++$x;
if($device->ParentDevice!=0){
if($device->ParentDevice>0){
foreach($uncleDaddy=$device->GetDeviceLineage() as $branches){
if($branches->ParentDevice>0){
$childList[$branches->ParentDevice]=""; // Create a list of chassis devices based on children present
Expand Down

0 comments on commit 349e8c7

Please sign in to comment.