Allow selecting stable Wine versions even if they are old

This commit is contained in:
Alexander Nicolaysen Sørnes
2009-06-11 22:51:02 +02:00
committed by Alexander Nicolaysen Sørnes
parent 301ad3cd1a
commit 591cf938b5
2 changed files with 22 additions and 7 deletions

View File

@@ -33,6 +33,10 @@ define("BUGZILLA_ROOT","http://bugs.winehq.org/"); // path to bugzilla
// How old (days) a test report has to before it is judged to be aged // How old (days) a test report has to before it is judged to be aged
define("TESTDATA_AGED_THRESHOLD", 175); define("TESTDATA_AGED_THRESHOLD", 175);
// Show versions from these branches even if they are not among the most recent ones
// Separate by commas if there are more than one
define("STABLE_BRANCHES", "1.0."););
/* /*
* apps database info * apps database info
*/ */

View File

@@ -169,17 +169,28 @@ function get_bugzilla_versions()
{ {
$aVersions = array(); $aVersions = array();
$sTable = BUGZILLA_DB.".versions"; $sTable = BUGZILLA_DB.".versions";
$sWhere = "WHERE product_id=".BUGZILLA_PRODUCT_ID;
// The empty string will fetch the most recent versions
$aBranches = array('');
// Get a list of stable branches
if(STABLE_BRANCHES)
$aBranches = array_merge($aBranches, explode(',', STABLE_BRANCHES));
foreach($aBranches as $sBranch)
{
$sWhere = "WHERE product_id =".BUGZILLA_PRODUCT_ID." AND value LIKE '$sBranch%'";
$sQuery = "SELECT value FROM $sTable $sWhere ORDER BY id desc limit 6"; $sQuery = "SELECT value FROM $sTable $sWhere ORDER BY id desc limit 6";
$hResult = query_bugzilladb($sQuery); $hResult = query_bugzilladb($sQuery);
if(!$hResult) return $aVersions; // empty if($hResult)
{
// build the list of versions
while(list($sValue) = query_fetch_row($hResult)) while(list($sValue) = query_fetch_row($hResult))
{ {
if(!in_array($sValue, $aVersions))
$aVersions[] = $sValue; $aVersions[] = $sValue;
} }
}
}
return $aVersions; return $aVersions;
} }