appdb/include testData.php

WineHQ wineowner at wine.codeweavers.com
Thu Apr 19 19:02:20 CDT 2007


ChangeSet ID:	31058
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/04/19 19:02:20

Modified files:
	include        : testData.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Make testData's objectGetEntries more consistent for rejected testData. Don't allow
	maintainers to view rejected entries for the versions they maintain, but show them their own
	rejected entries instead

Patch: http://cvs.winehq.org/patch.py?id=31058

Old revision  New revision  Changes     Path
 1.41          1.42          +30 -17     appdb/include/testData.php

Index: appdb/include/testData.php
diff -u -p appdb/include/testData.php:1.41 appdb/include/testData.php:1.42
--- appdb/include/testData.php:1.41	20 Apr 2007  0: 2:20 -0000
+++ appdb/include/testData.php	20 Apr 2007  0: 2:20 -0000
@@ -267,8 +267,7 @@ class testData{
                 $sSubject =  "Submitted testing data rejected";
                 $sMsg  = "The testing data you submitted for '$sName' has ".
                         "been rejected by ".$_SESSION['current']->sRealname.".";
-                $sMsg .= APPDB_ROOT."testResults.php?sSub=view&iTestingId=".
-                        $this->iTestingId."\n";
+                $sMsg .= $this->objectMakeUrl()."\n";
                 $sMsg .= "Reason given:\n";
             break;
             case "delete":
@@ -696,7 +695,18 @@ class testData{
         $sQueued = objectManager::getQueueString($bQueued, $bRejected);
         if($bQueued && !$oTest->canEdit())
         {
-            if($oTest->canEditSome())
+            if($bRejected)
+            {
+                $sQuery = "SELECT COUNT(testingId) AS count FROM
+                        testResults, appVersion WHERE
+                        appVersion.queued = 'false'
+                        AND
+                        appVersion.versionId = testResults.versionId
+                        AND
+                        testResults.submitterId = '?'
+                        AND
+                        testResults.queued = '?'";
+            } else
             {
                 $sQuery = "SELECT COUNT(testingId) AS count FROM
                         testResults, appVersion, appMaintainers WHERE
@@ -713,9 +723,10 @@ class testData{
                             )
                             AND
                             testResults.queued = '?'";
-                $hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
-                                            $sQueued);
             }
+
+            $hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
+                                        $sQueued);
         } else
         {
             $sQuery = "SELECT COUNT(testingId) as count FROM testResults,
@@ -743,7 +754,17 @@ class testData{
         $sQueued = objectManager::getQueueString($bQueued, $bRejected);
         if($bQueued && !$oTest->canEdit())
         {
-            if($oTest->canEditSome())
+            if($bRejected)
+            {
+                $sQuery = "SELECT testResults.* FROM testResults, appVersion WHERE
+                        appVersion.queued = 'false'
+                        AND
+                        appVersion.versionId = testResults.versionId
+                        AND
+                        testResults.submitterId = '?'
+                        AND
+                        testResults.queued = '?'";
+            } else
             {
                 $sQuery = "SELECT testResults.* FROM testResults, appVersion,
                             appMaintainers WHERE
@@ -760,9 +781,9 @@ class testData{
                             )
                             AND
                             testResults.queued = '?'";
-                $hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
-                                            $sQueued);
             }
+            $hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
+                                        $sQueued);
         } else
         {
             $sQuery = "SELECT testResults.* FROM testResults, appVersion WHERE
@@ -810,21 +831,13 @@ class testData{
                 $this->sTestedRelease,
                 $this->sTestedRating);
 
-        if($this->canEditSome())
+        if($this->canEdit() or $this->sQueued == "rejected")
             $aCells[] = "[ <a href=\"".$oObject->makeUrl("edit",
                 $this->iTestingId)."\">$sEditLinkLabel</a> ]";
 
         echo html_tr($aCells, $this->sTestedRating);
     }
 
-    function canEditSome()
-    {
-        if($this->canEdit() || maintainer::isUserMaintainer($_SESSION['current']))
-            return TRUE;
-        else
-            return FALSE;
-    }
-
     function canEdit()
     {
         if($_SESSION['current']->hasPriv("admin"))



More information about the wine-cvs mailing list