Show supermaintainers names in version's page

This commit is contained in:
Jonathan Ernst
2005-02-17 01:01:01 +00:00
committed by WineHQ
parent 045679d5bb
commit 7d2505777f
2 changed files with 12 additions and 16 deletions

View File

@@ -239,7 +239,7 @@ if($_REQUEST['appId'])
if($other_maintainers)
{
echo " <tr><td align=\"left\"><ul>\n";
while(list($index, list($userIdValue)) = each($other_maintainers))
while(list($index, $userIdValue) = each($other_maintainers))
{
$oUser = new User($userIdValue);
echo " <li>".$oUser->sRealname."</li>\n";
@@ -368,13 +368,16 @@ else if($_REQUEST['versionId'])
echo "<tr><td align=\"center\" colspan=\"2\">$img</td></tr>\n";
// display all maintainers of this application
echo "<tr class=\"color0\"><td align=\"left\" colspan=\"2\"><b>Maintainers of this application:</b>\n";
echo "<tr class=\"color0\"><td align=\"left\" colspan=\"2\"><b>Maintainers of this version:</b>\n";
echo "<table width=\"250\" border=\"0\">";
$other_maintainers = getMaintainersUserIdsFromAppIdVersionId($oApp->iAppId, $oVersion->iVersionId);
if($other_maintainers)
$aMaintainers = getMaintainersUserIdsFromAppIdVersionId($oVersion->iVersionId);
$aSupermaintainers = getSuperMaintainersUserIdsFromAppId($oVersion->iAppId);
$aAllMaintainers = array_merge($aMaintainers,$aSupermaintainers);
$aAllMaintainers = array_unique($aAllMaintainers);
if(sizeof($aAllMaintainers)>0)
{
echo "<tr class=\"color0\"><td align=\"left\" colspan=\"2\"><ul>";
while(list($index, list($userIdValue)) = each($other_maintainers))
while(list($index, $userIdValue) = each($aAllMaintainers))
{
$oUser = new User($userIdValue);
echo "<li>".$oUser->sRealname."</li>";

View File

@@ -27,20 +27,16 @@ function getAppsFromUserId($userId)
/*
* get the userIds of maintainers for this appId and versionId
*/
function getMaintainersUserIdsFromAppIdVersionId($appId, $versionId)
function getMaintainersUserIdsFromAppIdVersionId($versionId)
{
$query = "SELECT userId FROM ".
"appMaintainers WHERE appId = '$appId' " .
"AND versionId = '$versionId';";
"appMaintainers WHERE versionId = '$versionId';";
$result = query_appdb($query);
if(mysql_num_rows($result) == 0)
return; // no sub categories
$retval = array();
$c = 0;
while($row = mysql_fetch_object($result))
{
$retval[$c] = array($row->userId);
$retval[$c] = $row->userId;
$c++;
}
@@ -56,14 +52,11 @@ function getSuperMaintainersUserIdsFromAppId($appId)
"appMaintainers WHERE appId = '$appId' " .
"AND superMaintainer = '1';";
$result = query_appdb($query);
if(!$result || mysql_num_rows($result) == 0)
return; // no sub categories
$retval = array();
$c = 0;
while($row = mysql_fetch_object($result))
{
$retval[$c] = array($row->userId);
$retval[$c] = $row->userId;
$c++;
}