From 0cd6de7970ed6b5d7a981e6ec369e8abc6390516 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Thu, 7 Jun 2007 02:43:57 +0000 Subject: [PATCH] Programmatically fix up the bugzilla versions list. Sort the versions with the newest version first, limit the total number of versions to 6 by truncating the array and manually add the 'CVS' entry since we trim this entry off. This should make it easier for users to figure out which version to pick. --- include/util.php | 53 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/include/util.php b/include/util.php index 0fff4d7..7c70c19 100644 --- a/include/util.php +++ b/include/util.php @@ -164,25 +164,52 @@ function make_bugzilla_version_list($varname, $cvalue) { $table = BUGZILLA_DB.".versions"; $where = "WHERE product_id=".BUGZILLA_PRODUCT_ID; - $sQuery = "SELECT value FROM $table $where ORDER BY value"; + $sQuery = "SELECT value FROM $table $where"; $hResult = query_bugzilladb($sQuery); if(!$hResult) return; - echo "\n"; + echo "\n"; + foreach($aVersions as $sKey => $sValue) + { + if($sValue == $cvalue) + echo "