View Issue Details

IDProjectCategoryView StatusLast Update
463RackTablesdefaultpublic2011-08-28 11:38
Reporteruser243Assigned Toinfrastation  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version0.19.7 
Target Version0.19.8Fixed in Version0.19.8 
Summary463: Autoport-Startnumber
DescriptionI've added this Startnumber feature to the Autoports function(post on the mailing-list).

Now i added backwards compatibility to this funktion. I attached the patch file
TagsNo tags attached.

Activities

2011-08-23 20:30

 

autoports.diff (817 bytes)   
Index: inc/functions.php
===================================================================
--- inc/functions.php	(revision 4754)
+++ inc/functions.php	(working copy)
@@ -998,13 +998,15 @@
 		foreach (explode ('+', $portlist) as $product)
 		{
 			$tmp = explode ('*', $product);
-			if (count ($tmp) != 3)
+			if (count ($tmp) > 4 || count ($tmp) < 3)
 				continue;
+			//the new format looks like this <number of ports>*<port_type_id>[*<sprintf_name>*<startnumber>]
 			$nports = $tmp[0];
 			$port_type = $tmp[1];
 			$format = $tmp[2];
+			$startnum = isset($tmp[3]) ? $tmp[3] : 0;
 			for ($i = 0; $i < $nports; $i++)
-				$ret[] = array ('type' => $port_type, 'name' => @sprintf ($format, $i));
+				$ret[] = array ('type' => $port_type, 'name' => @sprintf ($format, ($i+$startnum)));
 		}
 	}
 	return $ret;
autoports.diff (817 bytes)   
infrastation

infrastation

2011-08-28 11:38

administrator   ~0000411

Committed, thank you.

Issue History

Date Modified Username Field Change
2011-08-23 20:30 user243 New Issue
2011-08-23 20:30 user243 File Added: autoports.diff
2011-08-28 11:30 infrastation Status new => assigned
2011-08-28 11:30 infrastation Assigned To => infrastation
2011-08-28 11:38 infrastation Note Added: 0000411
2011-08-28 11:38 infrastation Status assigned => closed
2011-08-28 11:38 infrastation Resolution open => fixed
2011-08-28 11:38 infrastation Fixed in Version => 0.19.8
2011-08-28 11:38 infrastation Target Version => 0.19.8