ChangeSet ID: 31327 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner@winehq.org 2007/08/10 21:20:51
Modified files: include : util.php
Log message: Chris Morgan cmorgan@alum.wpi.edu Bugzilla now has an id column that we can order by. Fix wine version ordering and remove order processing code.
Patch: http://cvs.winehq.org/patch.py?id=31327
Old revision New revision Changes Path 1.102 1.103 +2 -26 appdb/include/util.php
Index: appdb/include/util.php diff -u -p appdb/include/util.php:1.102 appdb/include/util.php:1.103 --- appdb/include/util.php:1.102 11 Aug 2007 2:20:51 -0000 +++ appdb/include/util.php 11 Aug 2007 2:20:51 -0000 @@ -159,42 +159,18 @@ function make_bugzilla_version_list($sVa
$sTable = BUGZILLA_DB.".versions"; $sWhere = "WHERE product_id=".BUGZILLA_PRODUCT_ID; - $sQuery = "SELECT value FROM $sTable $sWhere"; + $sQuery = "SELECT value FROM $sTable $sWhere ORDER BY id desc limit 6";
$hResult = query_bugzilladb($sQuery); if(!$hResult) return;
- // NOTE: perform some version list pruning - // - Reverse the order, we want the newest entries first - // and we can't use 'order by' since we have no column - // to order by, but the entries should come out in the - // order they were added - // - Trim the list, we don't want every version of wine ever released and - // we don't want the "CVS" version included since we can never figure out - // what version of Wine any given "CVS" version is - // - // TODO: if we ever get a reasonable way to order the list replace this code - // with that + // build the list of versions $aVersions = array(); while(list($sValue) = query_fetch_row($hResult)) { - // exclude unspecified versions and the "CVS" version - if(($sValue != "unspecified") && ($sValue != "CVS")) $aVersions[] = $sValue; }
- // now reverse the array order since the oldest - // versions were added first - $aVersions = array_reverse($aVersions); - - // now trim off all but the last X versions - $iVersionsToKeep = 6; - $aVersions = array_slice($aVersions, 0, $iVersionsToKeep); - - // DONE TRIMMING VERSIONS - ///////////////////////// - - // build the selection array $sStr.= "<select name='$sVarname'>\n"; $sStr.= "<option value="">Choose ...</option>\n";