From 66e884d65a578549824db57dc53f9ca988883b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Thu, 20 Dec 2007 01:30:29 +0100 Subject: [PATCH] distribution: Sort test results by Wine version as well as rating --- include/distribution.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/include/distribution.php b/include/distribution.php index 25526cf..1169bf5 100644 --- a/include/distribution.php +++ b/include/distribution.php @@ -51,24 +51,33 @@ class distribution { if($_SESSION['current']->hasPriv("admin")) { $sQuery = "SELECT testingId - FROM testResults - WHERE distributionId = '?' - ORDER BY testedRating;" ; + FROM testResults, ?.versions + WHERE + versions.value = testResults.testedRelease + AND + versions.product_id = '?' + AND + distributionId = '?' + ORDER BY testedRating,bugs.versions.id DESC"; } else /* only let users view test results that aren't queued and for apps that */ /* aren't queued or versions that aren't queued */ { $sQuery = "SELECT testingId - FROM testResults, appFamily, appVersion + FROM testResults, appFamily, appVersion, ?.versions WHERE testResults.state = 'accepted' AND + versions.value = testResults.testedRelease + AND + versions.product_id = '?' + AND testResults.versionId = appVersion.versionId AND appFamily.appId = appVersion.appId AND appFamily.state = 'accepted' AND appVersion.state = 'accepted' AND distributionId = '?' - ORDER BY testedRating;"; + ORDER BY testedRating,bugs.versions.id DESC"; } - if($hResult = query_parameters($sQuery, $this->iDistributionId)) + if($hResult = query_parameters($sQuery, BUGZILLA_DB, BUGZILLA_PRODUCT_ID, $this->iDistributionId)) { while($oRow = query_fetch_object($hResult)) {