From a542ecdccb8c9230cccaa4dff6d5b9789e2cfc5c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 24 Mar 2006 05:33:17 +0000 Subject: [PATCH] r762: Fixing bug://report/10: - Prevent the PCV values from stacking up like "p4c3c8c2c9c6v3" - If there are no immediate versions for a product, show a blank disabled '; + } // components (can't be a nested - it's not valid) if (is_array($components["$product[productid]"])) { foreach ($components["$product[productid]"] AS $component) { + // set options2 + $OPTIONS2 = ''; + // prefix - $valuepfx .= "c$component[productid]"; + $valuepfx = "p$product[productid]c$component[productid]"; // construct global options - $OPTIONS .= construct_pcv_select_global_version($component['componentmother'], $component['productid'], $versions, 1, $prefix, $select); + $OPTIONS2 .= construct_pcv_select_global_version($component['componentmother'], $component['productid'], $versions, 1, $prefix, $select); // product versions if (is_array($versions["$component[componentmother]"])) { foreach ($versions["$component[componentmother]"] AS $version) { - $OPTIONS .= construct_option($version['version'], "{$valuepfx}v$version[versionid]", $select, 1, $prefix); + $OPTIONS2 .= construct_option($version['version'], "{$valuepfx}v$version[versionid]", $select, 1, $prefix); } } @@ -91,15 +97,17 @@ function construct_pcv_select($action = 'canviewbugs', $select = '', $prefix = ' { foreach ($versions["$component[productid]"] AS $version) { - $OPTIONS .= construct_option($version['version'], "{$valuepfx}v$version[versionid]", $select, 1, $prefix); + $OPTIONS2 .= construct_option($version['version'], "{$valuepfx}v$version[versionid]", $select, 1, $prefix); } } // add optgroup - $HTML .= construct_optgroup($component['title'], 1, $OPTIONS, $prefix); - $OPTIONS = ''; + $OPTIONS .= construct_optgroup($component['title'], 1, $OPTIONS2, $prefix); } } + + // add it as an optgroup + $HTML .= construct_optgroup($product['title'], 0, $OPTIONS, $prefix); } return $HTML; -- 2.22.5