diff --git a/include/application.php b/include/application.php index 44bc97b..6baeeaa 100644 --- a/include/application.php +++ b/include/application.php @@ -1031,8 +1031,10 @@ class Application { } $aLicenses = version::getLicenses(); + $aWineVersions = get_bugzilla_versions(); $oFilter->AddFilterInfo('appVersion.rating', 'Rating', array(FILTER_EQUALS), FILTER_VALUES_ENUM, array('Platinum', 'Gold', 'Silver', 'Bronze', 'Garbage')); + $oFilter->AddFilterInfo('appVersion.ratingRelease', 'Tested Wine version', array(FILTER_EQUALS), FILTER_VALUES_ENUM, $aWineVersions); $oFilter->AddFilterInfo('appFamily.catId', 'Category', array(FILTER_EQUALS), FILTER_VALUES_ENUM, $aCatIds, $aCatNames); $oFilter->AddFilterInfo('appVersion.license', 'License', array(FILTER_EQUALS), FILTER_VALUES_ENUM, $aLicenses); $oFilter->AddFilterInfo('appFamily.appName', 'Name', array(FILTER_CONTAINS, FILTER_STARTS_WITH, FILTER_ENDS_WITH), FILTER_VALUES_NORMAL); diff --git a/include/util.php b/include/util.php index 55af094..fe80fc3 100644 --- a/include/util.php +++ b/include/util.php @@ -163,6 +163,27 @@ function get_xml_tag ($file, $mode = null) } /* bugzilla functions */ + +// Returns an array containg the Wine versions stored in our Bugzilla DB +function get_bugzilla_versions() +{ + $aVersions = array(); + $sTable = BUGZILLA_DB.".versions"; + $sWhere = "WHERE product_id=".BUGZILLA_PRODUCT_ID; + $sQuery = "SELECT value FROM $sTable $sWhere ORDER BY id desc limit 6"; + + $hResult = query_bugzilladb($sQuery); + if(!$hResult) return $aVersions; // empty + + // build the list of versions + while(list($sValue) = query_fetch_row($hResult)) + { + $aVersions[] = $sValue; + } + + return $aVersions; +} + // $sVarname - name of the selection array that this function will output // this is the name to use to retrieve the selection on the form postback // $sSelectedValue - the currently selected entry @@ -171,19 +192,8 @@ function make_bugzilla_version_list($sVarname, $sSelectedValue) { $sStr = ""; - $sTable = BUGZILLA_DB.".versions"; - $sWhere = "WHERE product_id=".BUGZILLA_PRODUCT_ID; - $sQuery = "SELECT value FROM $sTable $sWhere ORDER BY id desc limit 6"; - - $hResult = query_bugzilladb($sQuery); - if(!$hResult) return; - // build the list of versions - $aVersions = array(); - while(list($sValue) = query_fetch_row($hResult)) - { - $aVersions[] = $sValue; - } + $aVersions = get_bugzilla_versions(); // build the selection array $sStr.= "