Show links in maintainer processing form

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-03-17 19:39:29 +00:00
committed by WineHQ
parent fafe8c505d
commit 75e6320a51
2 changed files with 43 additions and 51 deletions

View File

@@ -479,58 +479,49 @@ class maintainer
*/ */
echo '<tr valign=top><td class=color0 style=\'text-align:right\'><b>Other maintainers of this app:</b></td>',"\n"; echo '<tr valign=top><td class=color0 style=\'text-align:right\'><b>Other maintainers of this app:</b></td>',"\n";
$bFoundMaintainers = false; /* Fetch maintainers and super maintainers */
$bFirstDisplay = true; /* if false we need to fix up table rows appropriately */
/* display maintainers for the version */
$oVersion = new Version($this->iVersionId); $oVersion = new Version($this->iVersionId);
$aOtherUsers = $oVersion->getMaintainersUserIds(); $aOtherMaintainers = $oVersion->getMaintainersUserIds();
if($aOtherUsers) $aOtherSuperMaintainers =
{ Maintainer::getSuperMaintainersUserIdsFromAppId($this->iAppId);
if($aOtherMaintainers || $aOtherSuperMaintainers)
$bFoundMaintainers = true; $bFoundMaintainers = true;
while(list($index, $iUserId) = each($aOtherUsers)) else
$bFoundMaintainers = false;
echo "<td>\n";
/* display maintainers for the version */
if($aOtherMaintainers)
{
while(list($index, $iUserId) = each($aOtherMaintainers))
{ {
$oUser = new User($iUserId); $oUser = new User($iUserId);
if($bFirstDisplay) echo "$oUser->sRealname<br />\n";
{
echo "<td>".$oUser->sRealname."</td></tr>\n";
$bFirstDisplay = false;
} else
{
echo "<tr><td class=\"color0\"></td><td>".$oUser->sRealname."</td></tr>\n";
}
} }
} }
/* display super maintainers for the given app */ /* display super maintainers for the given app */
$aOtherUsers = Maintainer::getSuperMaintainersUserIdsFromAppId($this->iAppId);
if($aOtherUsers) if($aOtherSuperMaintainers)
{ {
$bFoundMaintainers = true; while(list($index, $iUserId) = each($aOtherSuperMaintainers))
while(list($index, $iUserId) = each($aOtherUsers))
{ {
$oUser = new User($iUserId); $oUser = new User($iUserId);
if($bFirstDisplay) echo "$oUser->sRealname*<br />\n";
{
echo "<td>".$oUser->sRealname."*</td></tr>\n";
$bFirstDisplay = false;
} else
{
echo "<tr><td class=\"color0\"></td><td>".$oUser->sRealname."*</td></tr>\n";
}
} }
} }
if(!$bFoundMaintainers) if(!$bFoundMaintainers)
{ {
echo "<td>No other maintainers</td></tr>\n"; echo "No other maintainers";
} }
// Show which other apps the user maintains echo "</td></tr>\n";
echo '<tr valign="top"><td class="color0" style=\'text-align:right\'><b>This user also maintains these apps:</b></td>',"\n";
// Show which other apps the user maintains
echo '<tr valign="top"><td class="color0" style=\'text-align:right\'><b>This user also maintains these apps:</b></td><td>',"\n";
$bFirstDisplay = true;
$oUser = new User($this->iUserId); $oUser = new User($this->iUserId);
$aOtherApps = Maintainer::getAppsMaintained($oUser); $aOtherApps = Maintainer::getAppsMaintained($oUser);
if($aOtherApps) if($aOtherApps)
@@ -538,37 +529,29 @@ class maintainer
while(list($index, list($iAppIdOther, $iVersionIdOther, $bSuperMaintainerOther)) = each($aOtherApps)) while(list($index, list($iAppIdOther, $iVersionIdOther, $bSuperMaintainerOther)) = each($aOtherApps))
{ {
$oApp = new Application($iAppIdOther); $oApp = new Application($iAppIdOther);
$oVersion = new Version($iVersionIdOther);
if($bFirstDisplay) if($bSuperMaintainerOther)
{ echo $oApp->objectMakeLink()."*<br />\n";
$bFirstDisplay = false; else
if($bSuperMaintainerOther) echo $oVersion->fullNameLink($iVersionIdOther)."<br />\n";
echo "<td>".$oApp->sName."*</td></tr>\n";
else
echo "<td>".$oApp->sName." ".$oVersion->sName."</td></tr>\n";
} else
{
if($bSuperMaintainerOther)
echo "<td class=color0></td><td>".$oApp->sName."*</td></tr>\n";
else
echo "<td class=color0></td><td>".$oApp->sName." ".$oVersion->sName."</td></tr>\n";
}
} }
} else } else
{ {
echo "<td>User maintains no other applications</td></tr>\n"; echo "User maintains no other applications";
} }
echo "</td></tr>\n";
$oApp = new Application($this->iAppId); $oApp = new Application($this->iAppId);
$oVersion = new Version($this->iVersionId); $oVersion = new Version($this->iVersionId);
//app name //app name
echo '<tr valign=top><td class=color0 style=\'text-align:right\'><b>App Name:</b></td>',"\n"; echo '<tr valign=top><td class=color0 style=\'text-align:right\'><b>App Name:</b></td>',"\n";
echo "<td>".$oApp->sName."</td></tr>\n"; echo "<td>".$oApp->objectMakeLink()."</td></tr>\n";
//version //version
echo '<tr valign=top><td class=color0 style=\'text-align:right\'><b>App Version:</b></td>',"\n"; echo '<tr valign=top><td class=color0 style=\'text-align:right\'><b>App Version:</b></td>',"\n";
echo "<td>".$oVersion->sName."</td></tr>\n"; echo "<td>".$oVersion->objectMakeLink()."</td></tr>\n";
//maintainReason //maintainReason
echo '<tr valign=top><td class=color0 style=\'text-align:right\'><b>Maintainer request reason:</b></td>',"\n"; echo '<tr valign=top><td class=color0 style=\'text-align:right\'><b>Maintainer request reason:</b></td>',"\n";

View File

@@ -956,6 +956,15 @@ class Version {
return "$oRow->appName $oRow->versionName"; return "$oRow->appName $oRow->versionName";
} }
/* Creates a link to the version labelled with the full application name */
function fullNameLink($iVersionId)
{
$oVersion = new version($iVersionId);
$sLink = "<a href=\"".$oVersion->objectMakeUrl()."\">".
$oVersion->fullName($iVersionId)."</a>";
return $sLink;
}
function showList($hResult) function showList($hResult)
{ {
//show applist //show applist