Use objectManager to display a user's rejected versions

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-04-21 18:00:46 +00:00
committed by WineHQ
parent 2e0831cd22
commit 8358a09a13
3 changed files with 40 additions and 74 deletions

View File

@@ -449,32 +449,6 @@ else // if ($aClean['sSub']) is not defined, display the main app queue page
Application::showList($hResult);
}
// get queued versions (only versions where application are not queued already)
$hResult = $_SESSION['current']->getAppRejectQueueQuery(false); // query for the app version
if(!$hResult || !mysql_num_rows($hResult))
{
//no apps in queue
echo html_frame_start("Version Queue","90%");
echo '<p><b>The Resubmit Version Queue is empty.</b></p>',"\n";
echo html_frame_end("&nbsp;");
}
else
{
//help
echo "<div align=center><table width='90%' border=0 cellpadding=3 cellspacing=0><tr><td>\n\n";
echo "<p>This is the list of versions waiting for re-submission or deletion.</p>\n";
echo "<p>To view a submission, click on its name. From that page you can delete or edit and re-submit it into \n";
echo "the AppDB .<br>\n";
echo "<p>Note that versions linked to application that have not been approved yet are not displayed in this list.</p>\n";
echo "the AppDB.<br>\n";
echo "</td></tr></table></div>\n\n";
//show Version list
Version::showList($hResult);
}
apidb_footer();
}

View File

@@ -39,12 +39,21 @@ function global_sidebar_login() {
}
}
/* Display the user's rejected applications/versions */
$iAppsRejected = application::objectGetEntriesCount(true, true) +
version::objectGetEntriesCount(true, true);
/* Display the user's rejected applications */
$iAppsRejected = application::objectGetEntriesCount(true, true);
if($iAppsRejected && !$_SESSION['current']->hasPriv("admin"))
{
$g->add("Review Rejected Apps ($iAppsRejected)", BASE."appsubmit.php", "center");
$g->add("Review Rejected Apps ($iAppsRejected)", BASE."appsubmit.php",
"center");
}
/* Display the user's rejected versions */
$iVersionsRejected = version::objectGetEntriesCount(true, true);
if($iVersionsRejected && !$_SESSION['current']->hasPriv("admin"))
{
$g->add("Review Rejected Versiosn ($iVersionsRejected)",
BASE."objectManager.php?sClass=version_queue&bIsRejected=true".
"&bIsQueue=true&sTitle=Rejected+Versions", "center");
}
/* Display the user's rejected test results */

View File

@@ -960,47 +960,6 @@ class Version {
return $sLink;
}
function showList($hResult)
{
//show applist
echo html_frame_start("","90%","",0);
echo "<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\">
<tr class=color4>
<td>Submission Date</td>
<td>Submitter</td>
<td>Vendor</td>
<td>Application</td>
<td>Version</td>
<td align=\"center\">Action</td>
</tr>";
$c = 1;
while($oRow = mysql_fetch_object($hResult))
{
$oVersion = new Version($oRow->versionId);
$oApp = new Application($oVersion->iAppId);
$oSubmitter = new User($oVersion->iSubmitterId);
$oVendor = new Vendor($oApp->iVendorId);
$sVendor = $oVendor->sName;
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
echo "<tr class=\"$bgcolor\">\n";
echo " <td>".print_date(mysqltimestamp_to_unixtimestamp($oVersion->sSubmitTime))."</td>\n";
echo " <td>\n";
echo $oSubmitter->sEmail ? "<a href=\"mailto:".$oSubmitter->sEmail."\">":"";
echo $oSubmitter->sRealname;
echo $oSubmitter->sEmail ? "</a>":"";
echo " </td>\n";
echo " <td>".$sVendor."</td>\n";
echo " <td>".$oApp->sName."</td>\n";
echo " <td>".$oVersion->sName."</td>\n";
echo " <td align=\"center\">[<a href=".$_SERVER['PHP_SELF']."?sAppType=version&sSub=view&iVersionId=".$oVersion->iVersionId.">process</a>]</td>\n";
echo "</tr>\n\n";
$c++;
}
echo "</table>\n\n";
echo html_frame_end("&nbsp;");
}
// display the versions
function display_approved($aVersionsIds)
{
@@ -1221,13 +1180,37 @@ class Version {
{
if($_SESSION['current']->hasPriv("admin"))
return TRUE;
else if($this->iVersionId &&
maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
else if($this->iVersionId)
{
if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
return TRUE;
if($this->iSubmitterId == $_SESSION['current']->iUserId)
return TRUE;
return FALSE;
}
else
return FALSE;
}
function mustBeQueued()
{
if($_SESSION['current']->hasPriv("admin"))
return FALSE;
else if($this->iVersionId)
{
if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
return FALSE;
return TRUE;
}
else
return TRUE;
}
function objectGetHeader()
{
$aCells = array(