From 8358a09a134ed55dc7c47cd33f9ee5d3fca43c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Sat, 21 Apr 2007 18:00:46 +0000 Subject: [PATCH] Use objectManager to display a user's rejected versions --- appsubmit.php | 26 -------------- include/sidebar_login.php | 17 +++++++--- include/version.php | 71 +++++++++++++++------------------------ 3 files changed, 40 insertions(+), 74 deletions(-) diff --git a/appsubmit.php b/appsubmit.php index 9ea9fe9..a2efd1c 100644 --- a/appsubmit.php +++ b/appsubmit.php @@ -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 '

The Resubmit Version Queue is empty.

',"\n"; - echo html_frame_end(" "); - } - else - { - //help - echo "
\n\n"; - echo "

This is the list of versions waiting for re-submission or deletion.

\n"; - echo "

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 .
\n"; - echo "

Note that versions linked to application that have not been approved yet are not displayed in this list.

\n"; - echo "the AppDB.
\n"; - echo "
\n\n"; - - //show Version list - Version::showList($hResult); - - - } apidb_footer(); } diff --git a/include/sidebar_login.php b/include/sidebar_login.php index c233cee..7e4d586 100644 --- a/include/sidebar_login.php +++ b/include/sidebar_login.php @@ -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 */ diff --git a/include/version.php b/include/version.php index bef0e33..fe66050 100644 --- a/include/version.php +++ b/include/version.php @@ -960,47 +960,6 @@ class Version { return $sLink; } - function showList($hResult) - { - //show applist - echo html_frame_start("","90%","",0); - echo " - - - - - - - - "; - - $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 "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "\n\n"; - $c++; - } - echo "
Submission DateSubmitterVendorApplicationVersionAction
".print_date(mysqltimestamp_to_unixtimestamp($oVersion->sSubmitTime))."\n"; - echo $oSubmitter->sEmail ? "sEmail."\">":""; - echo $oSubmitter->sRealname; - echo $oSubmitter->sEmail ? "":""; - echo " ".$sVendor."".$oApp->sName."".$oVersion->sName."[iVersionId.">process]
\n\n"; - echo html_frame_end(" "); - } - // 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)) - return TRUE; + + 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(