Move getMaintainersUserIds...() to version::getMaintainersUserIds() and fixup callers of this function

This commit is contained in:
Chris Morgan
2006-07-07 16:44:41 +00:00
committed by WineHQ
parent 89915be4f1
commit e56e95d63a
3 changed files with 26 additions and 27 deletions

View File

@@ -68,7 +68,8 @@ if ($aClean['sSub'])
$firstDisplay = true; /* if false we need to fix up table rows appropriately */ $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) if($other_users)
{ {
$foundMaintainers = true; $foundMaintainers = true;

View File

@@ -3,30 +3,6 @@
/* functions for maintainers */ /* functions for maintainers */
/*****************************/ /*****************************/
/*
* 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 * get the userIds of super maintainers for this appId
*/ */

View File

@@ -677,7 +677,7 @@ class Version {
// display all maintainers of this application // display all maintainers of this application
echo "<tr class=\"color0\"><td align=\"left\" colspan=\"2\"><b>Maintainers of this version:</b>\n"; echo "<tr class=\"color0\"><td align=\"left\" colspan=\"2\"><b>Maintainers of this version:</b>\n";
echo "<table width=\"250\" border=\"0\">"; echo "<table width=\"250\" border=\"0\">";
$aMaintainers = getMaintainersUserIdsFromAppIdVersionId($this->iVersionId); $aMaintainers = $this->getMaintainersUserIds();
$aSupermaintainers = getSuperMaintainersUserIdsFromAppId($this->iAppId); $aSupermaintainers = getSuperMaintainersUserIdsFromAppId($this->iAppId);
$aAllMaintainers = array_merge($aMaintainers,$aSupermaintainers); $aAllMaintainers = array_merge($aMaintainers,$aSupermaintainers);
$aAllMaintainers = array_unique($aAllMaintainers); $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"); 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;
}
} }
?> ?>