diff --git a/appsubmit.php b/appsubmit.php
index a2efd1c..af1ab95 100644
--- a/appsubmit.php
+++ b/appsubmit.php
@@ -424,32 +424,9 @@ if ($aClean['sSub'])
}
else // if ($aClean['sSub']) is not defined, display the main app queue page
{
- apidb_header("Resubmit application");
-
- // get queued apps that the current user should see
- $hResult = $_SESSION['current']->getAppRejectQueueQuery(true); // query for the app family
-
- if(!$hResult || !mysql_num_rows($hResult))
- {
- //no apps in queue
- echo html_frame_start("Application Queue","90%");
- echo '
The Resubmit Application Queue is empty.
',"\n";
- echo html_frame_end(" ");
- }
- else
- {
- //help
- echo "| \n\n";
- echo " This is the list of applications waiting for re-submission, or to be deleted. \n";
- echo "To view a submission, click on its name. From that page you can delete or edit and\n";
- echo "re-submit it into the AppDB . \n";
- echo " |
\n\n";
-
- //show applist
- Application::showList($hResult);
- }
-
- apidb_footer();
+ /* Displaying of the app queue is now done by objectManager, so redirect to the
+ front page instead */
+ util_redirect_and_exit(BASE);
}
?>
diff --git a/include/application.php b/include/application.php
index b5bcbdd..54269d5 100644
--- a/include/application.php
+++ b/include/application.php
@@ -739,50 +739,6 @@ class Application {
return $ob->appName;
}
- function showList($hResult)
- {
- //show applist
- echo html_frame_start("","90%","",0);
- echo "
-
- | Submission Date |
- Submitter |
- Vendor |
- Application |
- Action |
-
";
-
- $c = 1;
- while($oRow = mysql_fetch_object($hResult))
- {
- $oApp = new Application($oRow->appId);
- $oSubmitter = new User($oApp->iSubmitterId);
- if($oApp->iVendorId)
- {
- $oVendor = new Vendor($oApp->iVendorId);
- $sVendor = $oVendor->sName;
- } else
- {
- $sVendor = get_vendor_from_keywords($oApp->sKeywords);
- }
- if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
- echo "\n";
- echo " | ".print_date(mysqltimestamp_to_unixtimestamp($oApp->sSubmitTime))." | \n";
- echo " \n";
- echo $oSubmitter->sEmail ? "sEmail."\">":"";
- echo $oSubmitter->sRealname;
- echo $oSubmitter->sEmail ? "":"";
- echo " | \n";
- echo " ".$sVendor." | \n";
- echo " ".$oApp->sName." | \n";
- echo " [iAppId.">process] | \n";
- echo "
\n\n";
- $c++;
- }
- echo "
\n\n";
- echo html_frame_end(" ");
- }
-
/* List applications submitted by a given user */
function listSubmittedBy($iUserId, $bQueued = true)
{
@@ -844,7 +800,11 @@ class Application {
if($bQueued && !application::canEdit())
{
- $sQuery .= "AND appFamily.submitterId = '?'";
+ /* Without global edit rights a user can only view his rejected apps */
+ if(!$bRejected)
+ return FALSE;
+
+ $sQuery .= " AND appFamily.submitterId = '?'";
$hResult = query_parameters($sQuery, $sQueued,
$_SESSION['current']->iUserId);
} else
@@ -889,10 +849,21 @@ class Application {
$sVendor,
$this->sName);
- if($this->canEdit() || $oObject->bQueued)
+ /* If the user has global edit rights canEdit() will return true even if
+ the appId is not defined, in which case he should use adminAppQueue.
+ This will soon be replaced by a unified objectManager link */
+ $oApp = new application();
+ if($oApp->canEdit())
+ {
$aCells[] = "[ iAppId\">".
"$sEditLinkLabel ]";
+ } else if($this->canEdit())
+ {
+ $aCells[] = "[ iAppId\">".
+ "$sEditLinkLabel ]";
+ }
echo html_tr($aCells, $sClass);
}
@@ -901,9 +872,19 @@ class Application {
{
if($_SESSION['current']->hasPriv("admin"))
return TRUE;
- else if($this)
- return maintainer::isUserSuperMaintainer($_SESSION['current'],
- $this->iAppId);
+
+ if(is_object($this) && $this->iAppId)
+ {
+ if(maintainer::isUserSuperMaintainer($_SESSION['current'],
+ $this->iAppId))
+ return TRUE;
+
+ if($this->sQueued != "true" && $this->iSubmitterId =
+ $_SESSION['current']->iUserId)
+ return TRUE;
+
+ return FALSE;
+ }
else
return FALSE;
}
diff --git a/include/sidebar_login.php b/include/sidebar_login.php
index 7e4d586..0e7af54 100644
--- a/include/sidebar_login.php
+++ b/include/sidebar_login.php
@@ -43,8 +43,9 @@ function global_sidebar_login() {
$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."objectManager.php?".
+ "sClass=application&bIsQueue=true&bIsRejected=true&sTitle=".
+ "Rejected+Applications", "center");
}
/* Display the user's rejected versions */
diff --git a/include/user.php b/include/user.php
index 71e9c1e..6562c98 100644
--- a/include/user.php
+++ b/include/user.php
@@ -316,41 +316,6 @@ class User {
return ($this->isLoggedIn() && $this->getPref("send_email","yes")=="yes");
}
- function getAppRejectQueueQuery($queryAppFamily)
- {
- /* escape input as we can't easily use query_parameters() */
- $queryAppFamily = mysql_real_escape_string($queryAppFamily);
-
- if($this->hasPriv("admin"))
- {
- if($queryAppFamily)
- {
- $sQuery = "SELECT appFamily.appId FROM appFamily WHERE queued = 'rejected'";
- } else
- {
- $sQuery = "SELECT appVersion.versionId FROM appVersion, appFamily
- WHERE appFamily.appId = appVersion.appId
- AND appFamily.queued = 'false' AND appVersion.queued = 'rejected'";
- }
- } else
- {
- if($queryAppFamily)
- {
- $sQuery = "SELECT appFamily.appId FROM appFamily
- WHERE queued = 'rejected'
- AND appFamily.submitterId = '".mysql_real_escape_string($this->iUserId)."';";
- } else
- {
- $sQuery = "SELECT appVersion.versionId FROM appVersion, appFamily
- WHERE appFamily.appId = appVersion.appId
- AND appFamily.queued = 'false' AND appVersion.queued = 'rejected'
- AND appVersion.submitterId = '".mysql_real_escape_string($this->iUserId)."';";
- }
- }
-
- return query_appdb($sQuery);
- }
-
function isAppSubmitter($iAppId)
{
$hResult = query_parameters("SELECT appId FROM appFamily