ChangeSet ID: 31162
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/06/06 21:43:57
Modified files:
include : util.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
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.
Patch: http://cvs.winehq.org/patch.py?id=31162
Old revision New revision Changes Path
1.88 1.89 +39 -12 appdb/include/util.php
Index: appdb/include/util.php
diff -u -p appdb/include/util.php:1.88 appdb/include/util.php:1.89
--- appdb/include/util.php:1.88 7 Jun 2007 2:43:57 -0000
+++ appdb/include/util.php 7 Jun 2007 2:43:57 -0000
@@ -164,25 +164,52 @@ function make_bugzilla_version_list($var
{
$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;
+ // 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
+ // - Add 'CVS' explicitly since we trim it out
+ //
+ // TODO: if we ever get a reasonable way to order the list replace this code
+ // with that
+ $aVersions = array();
+ while(list($value) = mysql_fetch_row($hResult))
+ {
+ // exclude unspecified versions
+ if($value != "unspecified")
+ $aVersions[] = $value;
+ }
+
+ // now reverse the array order
+ $aVersions = array_reverse($aVersions);
+
+ // now trim off all but the last X versions
+ $iVersionsToKeep = 6;
+ $aVersions = array_slice($aVersions, 0, $iVersionsToKeep);
+
+ // explicitly add 'CVS' since we are eliminating that above
+ $aVersions[] = "CVS";
+
+ // DONE TRIMMING VERSIONS
+ /////////////////////////
+
+
+ // build the selection array
echo "<select name='$varname'>\n";
echo "<option value=\"\">Choose ...</option>\n";
- while(list($value) = mysql_fetch_row($hResult))
+ foreach($aVersions as $sKey => $sValue)
{
- if($value == "unspecified")
- {
- // We do not unspecified versions!!!
- } else
- {
- if($value == $cvalue)
- echo "<option value=$value selected>$value\n";
- else
- echo "<option value=$value>$value\n";
- }
+ if($sValue == $cvalue)
+ echo "<option value=$sValue selected>$sValue\n";
+ else
+ echo "<option value=$sValue>$sValue\n";
}
echo "</select>\n";
}
ChangeSet ID: 31160
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/06/06 21:04:16
Modified files:
include : testData.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Add a column to the test data queue to indicate whether a test result is for a application version
that has maintainers. This lets admins defer processing test results to give appliction and version maintiners
a chance to do so.
Patch: http://cvs.winehq.org/patch.py?id=31160
Old revision New revision Changes Path
1.54 1.55 +7 -0 appdb/include/testData.php
Index: appdb/include/testData.php
diff -u -p appdb/include/testData.php:1.54 appdb/include/testData.php:1.55
--- appdb/include/testData.php:1.54 7 Jun 2007 2: 4:16 -0000
+++ appdb/include/testData.php 7 Jun 2007 2: 4:16 -0000
@@ -897,6 +897,7 @@ class testData{
"Application",
"Version",
"Release",
+ "Has maintainer",
"Rating");
return $aCells;
}
@@ -911,12 +912,18 @@ class testData{
$oVersion = new version($this->iVersionId);
$oApp = new application($oVersion->iAppId);
$oUser = new user($this->iSubmitterId);
+
+ //
+ $hMaintainers = maintainer::getMaintainersForAppIdVersionId(null, $this->iVersionId);
+ $bHasMaintainer = (mysql_num_rows($hMaintainers) == 0) ? false : true;
+
$aCells = array(
print_date(mysqltimestamp_to_unixtimestamp($this->sSubmitTime)),
$oUser->objectMakeLink(),
$oApp->objectMakeLink(),
$oVersion->objectMakeLink(),
$this->sTestedRelease,
+ ($bHasMaintainer ? "YES" : "no"),
$this->sTestedRating);
if($this->canEdit() or $this->sQueued == "rejected")