View Issue Details

IDProjectCategoryView StatusLast Update
845RackTablesdefaultpublic2013-05-11 21:19
Reporterblaza-pl Assigned Toadoom42  
PrioritylowSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version0.20.4 
Target Version0.20.5Fixed in Version0.20.5 
Summary845: Display parent location on Rackspace -> Browse
DescriptionIt would be useful to display parent locations on Rackspace -> Browse. As Locations create a tree this makes use of parent child relations.

I have created a patch for that.
Steps To ReproduceCreate a Location "Country"
Create a Location "City" with parent location "Country"
Create a Location "Street" with parent "City
Create a Row "Row1" in Location Street so that Row1 is displayed on Rackspace -> Browse tab

Now with this patch the Column Location would be:
Country » City » Street
TagsNo tags attached.

Activities

blaza-pl

blaza-pl

2013-05-07 15:09

reporter  

location-browse-tree.patch (1,106 bytes)   
--- ../../racktables-test/inc/interface.php	2013-04-16 11:30:24.753325827 +0200
+++ interface.php	2013-04-16 13:14:11.985286286 +0200
@@ -372,8 +372,16 @@
 					continue;
 				$rackListIdx = 0;
 				echo "<tr class=row_${order}><th class=tdleft>";
-				if ($location_id)
-					echo "<a href='".makeHref(array('page'=>'location', 'location_id'=>$location_id))."${cellfilter['urlextra']}'>${row['location_name']}</a>";
+				$locationTree = "";
+				while ($location_id)
+				{
+						$parentLocation = spotEntity('location',$location_id);
+						$locationTree = "&raquo; <a href='".makeHref(array('page'=>'location', 'location_id'=>$parentLocation['id']))."${cellfilter['urlextra']}'>${parentLocation['name']}</a> " . $locationTree;
+						$location_id = $parentLocation['parent_id'];
+				}
+				$locationTree = substr($locationTree,8);
+				echo $locationTree;
+				
 				echo "</th><th class=tdleft><a href='".makeHref(array('page'=>'row', 'row_id'=>$row_id))."${cellfilter['urlextra']}'>${row_name}</a></th>";
 				echo "<th class=tdleft><table border=0 cellspacing=5><tr>";
 				if (!count ($rackList))
location-browse-tree.patch (1,106 bytes)   
adoom42

adoom42

2013-05-11 21:19

administrator   ~0001395

Thanks for the patch.

Issue History

Date Modified Username Field Change
2013-05-07 15:09 blaza-pl New Issue
2013-05-07 15:09 blaza-pl File Added: location-browse-tree.patch
2013-05-11 21:19 adoom42 Note Added: 0001395
2013-05-11 21:19 adoom42 Assigned To => adoom42
2013-05-11 21:19 adoom42 Status new => closed
2013-05-11 21:19 adoom42 Resolution open => fixed
2013-05-11 21:19 adoom42 Fixed in Version => 0.20.5
2013-05-11 21:19 adoom42 Target Version => 0.20.5