Module: appdb Branch: master Commit: d98e38e3059bab7c8d5eee20a7bf1248892e71ba URL: http://source.winehq.org/git/appdb.git/?a=commit;h=d98e38e3059bab7c8d5eee20a...
Author: Alexander Nicolaysen Sørnes alex@thehandofagony.com Date: Mon Jun 16 10:53:49 2008 +0200
browse apps: Allow filtering by Wine version
---
include/application.php | 2 ++ include/util.php | 28 +++++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-)
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,28 +163,38 @@ function get_xml_tag ($file, $mode = null) }
/* bugzilla functions */ -// $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 -// returns a string that contains the version list output -function make_bugzilla_version_list($sVarname, $sSelectedValue) -{ - $sStr = "";
+// 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; + if(!$hResult) return $aVersions; // empty
// build the list of versions - $aVersions = array(); 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 +// returns a string that contains the version list output +function make_bugzilla_version_list($sVarname, $sSelectedValue) +{ + $sStr = ""; + + // build the list of versions + $aVersions = get_bugzilla_versions(); + // build the selection array $sStr.= "<select name='$sVarname'>\n"; $sStr.= "<option value="">Choose ...</option>\n";