View Issue Details

IDProjectCategoryView StatusLast Update
562RackTablesdefaultpublic2012-08-25 20:34
Reporteruser292Assigned Toadoom42  
PrioritynormalSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Product Version0.19.12 
Target Version0.19.14Fixed in Version0.19.14 
Summary562: Select "nearest rack" by default
DescriptionHi,

is there any good reason, why the "nearest rack" option is not checked by default? We're using this so frequently, that it would save us a lot of clicks. If it's not a good default, can we introduce a config variable to turn it on/off?

Cheers
Hannes
TagsNo tags attached.

Activities

2012-06-01 11:10

 

nearest_rack_selected_by_default.patch (1,358 bytes)   
diff --git a/wwwroot/inc/popup.php b/wwwroot/inc/popup.php
index 15244cb..a556b90 100644
--- a/wwwroot/inc/popup.php
+++ b/wwwroot/inc/popup.php
@@ -353,7 +353,7 @@ function renderPopupPortSelector()
 	assertUIntArg ('port');
 	$port_id = $_REQUEST['port'];
 	$port_info = getPortInfo ($port_id);
-	$in_rack = isset ($_REQUEST['in_rack']);
+	$in_rack = $_REQUEST['in_rack'] != 'off';
 
 	// fill port filter structure
 	$filter = array
@@ -391,7 +391,7 @@ function renderPopupPortSelector()
 	echo '<table align="center" valign="bottom"><tr>';
 	echo '<td class="tdleft"><label>Object name:<br><input type=text size=8 name="filter-obj" value="' . htmlspecialchars ($filter['objects'], ENT_QUOTES) . '"></label></td>';
 	echo '<td class="tdleft"><label>Port name:<br><input type=text size=6 name="filter-port" value="' . htmlspecialchars ($filter['ports'], ENT_QUOTES) . '"></label></td>';
-	echo '<td class="tdleft" valign="bottom"><label><input type=checkbox name="in_rack"' . ($in_rack ? ' checked' : '') . '>Nearest racks</label></td>';
+	echo '<td class="tdleft" valign="bottom"><input type="hidden" name="in_rack" value="off" /><label><input type=checkbox name="in_rack"' . ($in_rack ? ' checked' : '') . '>Nearest racks</label></td>';
 	echo '<td valign="bottom"><input type=submit value="show ports"></td>';
 	echo '</tr></table>';
 	finishPortlet();
infrastation

infrastation

2012-06-04 10:45

administrator   ~0000676

Yes, this is reasonable.
adoom42

adoom42

2012-07-15 01:16

administrator   ~0000705

The change will be available in 0.19.14.
infrastation

infrastation

2012-08-24 09:09

administrator   ~0000749

With this change the user gets a PHP warning upon opening the linker popup:

PHP Notice: Undefined index: in_rack in /racktables/wwwroot/inc/popup.php on line 356

Could you review?
adoom42

adoom42

2012-08-25 20:34

administrator   ~0000752

Fixed.

Issue History

Date Modified Username Field Change
2012-06-01 11:10 user292 New Issue
2012-06-01 11:10 user292 File Added: nearest_rack_selected_by_default.patch
2012-06-04 10:45 infrastation Note Added: 0000676
2012-06-04 10:45 infrastation Status new => acknowledged
2012-07-15 01:16 adoom42 Note Added: 0000705
2012-07-15 01:16 adoom42 Assigned To => adoom42
2012-07-15 01:16 adoom42 Status acknowledged => closed
2012-07-15 01:16 adoom42 Resolution open => fixed
2012-07-15 01:16 adoom42 Fixed in Version => 0.19.14
2012-07-15 01:16 adoom42 Target Version => 0.19.14
2012-08-24 09:08 infrastation Status closed => feedback
2012-08-24 09:08 infrastation Resolution fixed => reopened
2012-08-24 09:09 infrastation Note Added: 0000749
2012-08-25 20:34 adoom42 Note Added: 0000752
2012-08-25 20:34 adoom42 Status feedback => closed
2012-08-25 20:34 adoom42 Resolution reopened => fixed