View Issue Details

IDProjectCategoryView StatusLast Update
847RackTablesdefaultpublic2013-05-11 21:40
Reporterblaza-pl Assigned Toadoom42  
PrioritylowSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version0.20.4 
Target Version0.20.5Fixed in Version0.20.5 
Summary847: Display parent and child location on Location view page
DescriptionCurrently on Location view page there is no information about this Location parent or childs. There is only info about Child locations count.

This patch adds to Location Summary portlet info about parent Location.
And it adds a new portlet "Child Locations" which lists all child Locations.
TagsNo tags attached.

Activities

blaza-pl

blaza-pl

2013-05-07 15:13

reporter  

location-view-tree.patch (1,200 bytes)   
--- ../../racktables-test/inc/interface.php	2013-04-09 11:10:21.633224423 +0200
+++ interface.php	2013-04-15 14:50:29.033196148 +0200
@@ -3831,6 +3831,8 @@
 	echo "<td class=pcleft>";
 	$summary = array();
 	$summary['Name'] = $locationData['name'];
+	if (!empty($locationData['parent_id']))
+		$summary['Parent location'] = "<a href='" . makeHref(array('page'=>'location', 'location_id'=>$locationData['parent_id'])) . "'>" . $locationData['parent_name'];
 	$summary['Child locations'] = count($locationData['locations']);
 	$summary['Rows'] = count($locationData['rows']);
 	if ($locationData['has_problems'] == 'yes')
@@ -3852,6 +3854,14 @@
 		echo "<tr><td><a href='".makeHref(array('page'=>'row', 'row_id'=>$row_id))."'>".$name."</td></tr>\n";
 	echo "</table>\n";
 	finishPortlet();
+
+	startPortlet ('Child Locations (' . count($locationData['locations']) . ')');
+	echo "<table border=0 cellspacing=0 cellpadding=5 align=center>\n";
+	foreach ($locationData['locations'] as $loc_id => $name)
+		echo "<tr><td><a href='".makeHref(array('page'=>'location', 'location_id'=>$loc_id))."'>".$name."</td></tr>\n";
+	echo "</table>\n";
+	finishPortlet();
+
 	echo '</td>';
 	echo '</tr></table>';
 }
location-view-tree.patch (1,200 bytes)   
adoom42

adoom42

2013-05-11 21:40

administrator   ~0001397

Thanks for the patch.

Issue History

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