From 734c585239ddd86f8d5566e25b404778dd387625 Mon Sep 17 00:00:00 2001 From: wilpig Date: Wed, 4 Jul 2012 23:46:59 -0500 Subject: [PATCH] Set 1 as the minimum value for rack position. Also added in loop to search for 0 height devices in rack view. #11 --- cabnavigator.php | 42 +++++++++++++++++++++++++++++++----------- css/inventory.css | 3 +++ devices.php | 5 +++-- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/cabnavigator.php b/cabnavigator.php index ab28ae913..b71e9f63c 100644 --- a/cabnavigator.php +++ b/cabnavigator.php @@ -12,7 +12,7 @@ exit; } - $head=$legend=""; + $head=$legend=$zeroheight=""; $cab=new Cabinet(); $audit=new CabinetAudit(); $pdu=new PowerDistribution(); @@ -78,9 +78,9 @@ $legend.='

     - Reservation

'; } if($config->ParameterArray["FreeSpaceColor"] != "#FFFFFF"){ - $legend.='

     - FreeSpace

'; + $legend.='

     - Free Space

'; } - $legend.='

     - Normal

'; + $legend.='

     - Occupied Space

'; } ?> @@ -128,16 +128,22 @@ function verifyDelete(formname) { Cabinet Location; ?> PosDevice Position + $device->Height - 1; + while(list($devID,$device)=each($devList)){ + $devTop=$device->Position + $device->Height - 1; $templ->TemplateID = $device->TemplateID; - $templ->GetTemplateByID( $facDB ); + $templ->GetTemplateByID($facDB); - if ( $device->NominalWatts > 0 ) - $totalWatts += $device->NominalWatts; - else - $totalWatts += $templ->Wattage; + $highlight=""; + if($device->TemplateID==0){$highlight.="(T)";} + if($device->Owner==0){$highlight.="(O)";} + $highlight.= ""; + + if($device->NominalWatts >0){ + $totalWatts+=$device->NominalWatts; + }else{ + $totalWatts+=$templ->Wattage; + } $totalWeight += $templ->Weight; $totalMoment += ( $templ->Weight * ( $device->Position + ( $device->Height / 2 ) ) ); @@ -159,6 +165,9 @@ function verifyDelete(formname) { } } + if($device->Height<1){ + $zeroheight.=" $highlight $device->Label\n"; + } for($i = $devTop; $i >= $device->Position; $i--){ if($i==$devTop){ $highlight=""; @@ -168,9 +177,10 @@ function verifyDelete(formname) { if ($device->Owner==0) { $highlight.="(O)"; } - $highlight .= ""; print "$iHeight>$highlight $device->Label\n"; + + }else{ print "$i\n"; } @@ -259,6 +269,16 @@ function verifyDelete(formname) { Keylock ); ?> + + Zero-U Devices +
+ $zeroheight +
+ \n"; + } +?>
Power Distribution
-
+
@@ -496,7 +496,8 @@ function setPreferredLayout() { WriteAccess || $dev->ESX){ +// if($user->WriteAccess || $dev->ESX){ + if(($user->WriteAccess || $dev->ESX) && ($dev->DeviceType=="Server" || $dev->DeviceType=="")){ echo "
\n VMWare ESX Server Information"; // If the user doesn't have write access display the list of VMs but not the configuration information. if($user->WriteAccess){