View Issue Details

IDProjectCategoryView StatusLast Update
925RackTablesdefaultpublic2013-07-20 20:13
Reporterblaza-pl Assigned Toadoom42  
PrioritylowSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version0.20.5 
Target Version0.20.6Fixed in Version0.20.6 
Summary925: On Rackspace page for Object show location parents
DescriptionCurrently on Objects -> Rackspace tab only the first parent Location for Row is shown. Having in mind that Locations can build a tree this patch changes the display to show Location parents and their parents up to the top level.
TagsNo tags attached.

Activities

blaza-pl

blaza-pl

2013-07-09 12:03

reporter  

object_rackspace_parent-interface.php.patch (1,090 bytes)   
--- inc/interface.php	2013-07-03 10:31:43.000000000 +0200
+++ inc/interface.php	2013-07-09 11:51:07.597131147 +0200
@@ -1567,11 +1567,31 @@
 
 function renderRackMultiSelect ($sname, $racks, $selected)
 {
+
+	$loc_tree = listCells('location');
+	$loc_name_tbl = array();
+	$loc_parents = array();
+	foreach($loc_tree as $loc)
+	{
+		$loc_parents[$loc['id']] = $loc['parent_id'];
+		$loc_name_tbl[$loc['id']] = $loc['name'];
+	}
+	
+
+
 	// Transform the given flat list into a list of groups, each representing a rack row.
 	$rdata = array();
 	foreach ($racks as $rack)
 	{
-		$row_name = ($rack['location_id']) ? $rack['location_name'] . '/' . $rack['row_name'] : $rack['row_name'];
+		$name = "";
+		$id=$rack['location_id'];
+		while(isset($id))
+		{
+			$name = $loc_name_tbl[$id] . " / " . $name;
+			$id = $loc_parents[$id];
+		}
+
+		$row_name = $name . $rack['row_name'];
 		$rdata[$row_name][$rack['id']] = $rack['name'];
 	}
 	echo "<select name=${sname} multiple size=" . getConfigVar ('MAXSELSIZE') . " onchange='getElementsByName(\"updateObjectAllocation\")[0].submit()'>\n";

Issue History

Date Modified Username Field Change
2013-07-09 12:03 blaza-pl New Issue
2013-07-09 12:03 blaza-pl File Added: object_rackspace_parent-interface.php.patch
2013-07-20 20:13 adoom42 Assigned To => adoom42
2013-07-20 20:13 adoom42 Status new => closed
2013-07-20 20:13 adoom42 Resolution open => fixed
2013-07-20 20:13 adoom42 Fixed in Version => 0.20.6
2013-07-20 20:13 adoom42 Target Version => 0.20.6