Don't show vote link for obsolete versions

This commit is contained in:
Alexander Nicolaysen Sørnes
2008-01-18 17:24:17 +01:00
committed by Chris Morgan
parent 6808c187eb
commit 0f5bb1b0f9

View File

@@ -836,17 +836,24 @@ class version {
// main URL // main URL
echo " <tr class=\"color1\"><td><b>URL</b></td><td>".$appLinkURL."</td></tr>\n"; echo " <tr class=\"color1\"><td><b>URL</b></td><td>".$appLinkURL."</td></tr>\n";
$oM = new objectManager("voteManager", "Vote");
$oM->setReturnTo($this->objectMakeUrl());
// Votes // Votes
if($_SESSION['current']->isLoggedIn()) if(!$this->iObsoleteBy)
$shVoteLink = ' &nbsp; <a href="'.$oM->makeUrl("edit", $_SESSION['current']->iUserId).'&iVersionId='.$this->iVersionId.'">Vote</a>'; {
else $oM = new objectManager("voteManager", "Vote");
$shVoteLink = ''; $oM->setReturnTo($this->objectMakeUrl());
echo html_tr(array(
"<b>Votes</b>", if($_SESSION['current']->isLoggedIn())
vote_count_version_total($this->iVersionId).$shVoteLink), $shVoteLink = ' &nbsp; <a href="'.$oM->makeUrl("edit", $_SESSION['current']->iUserId).'&iVersionId='.$this->iVersionId.'">Vote</a>';
"color0"); else
$shVoteLink = '';
$shVoteText = vote_count_version_total($this->iVersionId).$shVoteLink;
} else
{
$shVoteText = 'Marked as obsolete';
}
echo html_tr(array('<b>Votes</b>', $shVoteText), 'color0');
$sRating = $this->sTestedRating; $sRating = $this->sTestedRating;
$sRelease = $this->sTestedRelease; $sRelease = $this->sTestedRelease;