appdb/ admin/adminMaintainerQueue.php include/ ...

WineHQ wineowner at wine.codeweavers.com
Fri Jul 7 11:44:41 CDT 2006


ChangeSet ID:	26327
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2006/07/07 11:44:41

Modified files:
	admin          : adminMaintainerQueue.php 
	include        : maintainer.php version.php 

Log message:
	Chris Morgan <cmorgan at alum.wpi.edu>
	Move getMaintainersUserIds...() to version::getMaintainersUserIds() and fixup callers of this function

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

Old revision  New revision  Changes     Path
 1.29          1.30          +2 -1       appdb/admin/adminMaintainerQueue.php
 1.11          1.12          +0 -24      appdb/include/maintainer.php
 1.66          1.67          +24 -2      appdb/include/version.php

Index: appdb/admin/adminMaintainerQueue.php
diff -u -p appdb/admin/adminMaintainerQueue.php:1.29 appdb/admin/adminMaintainerQueue.php:1.30
--- appdb/admin/adminMaintainerQueue.php:1.29	7 Jul 2006 16:44:41 -0000
+++ appdb/admin/adminMaintainerQueue.php	7 Jul 2006 16:44:41 -0000
@@ -68,7 +68,8 @@ if ($aClean['sSub'])
 
         $firstDisplay = true; /* if false we need to fix up table rows appropriately */
 
-        $other_users = getMaintainersUserIdsFromAppIdVersionId($oRow->versionId);
+        $oVersion = new Version($oRow->versionId);
+        $other_users = $oVersion->getMaintainersUserIds();
         if($other_users)
         {
             $foundMaintainers = true;
Index: appdb/include/maintainer.php
diff -u -p appdb/include/maintainer.php:1.11 appdb/include/maintainer.php:1.12
--- appdb/include/maintainer.php:1.11	7 Jul 2006 16:44:41 -0000
+++ appdb/include/maintainer.php	7 Jul 2006 16:44:41 -0000
@@ -4,30 +4,6 @@
 /*****************************/
 
 /*
- * get the userIds of maintainers for a versionId
- */
-function getMaintainersUserIdsFromAppIdVersionId($versionId)
-{
-    $retval = array();
-
-    /* early out if the versionId isn't valid */
-    if($versionId == 0)
-        return $retval;
-    
-    $sQuery = "SELECT userId FROM ".
-        "appMaintainers WHERE versionId = '?';";
-    $hResult = query_parameters($sQuery, $versionId);
-    $c = 0;
-    while($oRow = mysql_fetch_object($hResult))
-    {
-        $retval[$c] = $oRow->userId;
-        $c++;
-    }
-
-    return $retval;
-}
-
-/*
  * get the userIds of super maintainers for this appId
  */
 function getSuperMaintainersUserIdsFromAppId($appId)
Index: appdb/include/version.php
diff -u -p appdb/include/version.php:1.66 appdb/include/version.php:1.67
--- appdb/include/version.php:1.66	7 Jul 2006 16:44:41 -0000
+++ appdb/include/version.php	7 Jul 2006 16:44:41 -0000
@@ -32,7 +32,7 @@ class Version {
     var $aTestingIds;         // an array that contains the testingId of every test result linked to this version
     var $aMonitorIds;         // an array that contains the monitorId of every monitor linked to this version
 
-    /**    
+    /**
      * constructor, fetches the data.
      */
     function Version($iVersionId = null)
@@ -677,7 +677,7 @@ class Version {
         // display all maintainers of this application
         echo "<tr class=\"color0\"><td align=\"left\" colspan=\"2\"><b>Maintainers of this version:</b>\n";
         echo "<table width=\"250\" border=\"0\">";
-        $aMaintainers = getMaintainersUserIdsFromAppIdVersionId($this->iVersionId);
+        $aMaintainers = $this->getMaintainersUserIds();
         $aSupermaintainers = getSuperMaintainersUserIdsFromAppId($this->iAppId);
         $aAllMaintainers = array_merge($aMaintainers,$aSupermaintainers);
         $aAllMaintainers = array_unique($aAllMaintainers);
@@ -926,6 +926,28 @@ class Version {
             echo html_frame_end("Click the Version Name to view the details of that Version");
         }
     }
+
+    /* returns the maintainers of this version in an array */
+    function getMaintainersUserIds()
+    {
+        $aMaintainers = array();
+
+        /* early out if the versionId isn't valid */
+        if($this->iVersionId == 0)
+            return $aMaintainers;
+    
+        $sQuery = "SELECT userId FROM ".
+            "appMaintainers WHERE versionId = '?';";
+        $hResult = query_parameters($sQuery, $this->iVersionId);
+        $iCount = 0;
+        while($oRow = mysql_fetch_object($hResult))
+        {
+            $aMaintainers[$iCount] = $oRow->userId;
+            $iCount++;
+        }
+
+        return $aMaintainers;
+    }
 }
 
 ?>



More information about the wine-cvs mailing list