diff --git a/include/application.php b/include/application.php index d7e2c15..f91404c 100644 --- a/include/application.php +++ b/include/application.php @@ -913,6 +913,37 @@ class Application { echo "

To view a submission, click on its name. ". "From that page you can edit, delete or approve it into the AppDB.

\n"; } + + function objectGetEntriesCount($bQueued, $bRejected) + { + $sQueued = objectManager::getQueueString($bQueued, $bRejected); + + if($bQueued && !application::canEdit()) + { + /* Without edit rights users can only resubmit their rejected entries */ + if(!$bRejected) + return FALSE; + + $sQuery = "SELECT COUNT(appId) as count FROM appFamily WHERE + submitterId = '?' + AND + queued = '?'"; + $hResult = query_parameters($sQuery, $_SESSION['current']->iUserId, + $sQueued); + } else + { + $sQuery = "SELECT COUNT(appId) as count FROM appFamily WHERE queued = '?'"; + $hResult = query_parameters($sQuery, $sQueued); + } + + if(!$hResult) + return FALSE; + + if(!$oRow = mysql_fetch_object($hResult)) + return FALSE; + + return $oRow->count; + } } function get_vendor_from_keywords($sKeywords) diff --git a/include/sidebar_admin.php b/include/sidebar_admin.php index ecbcaa8..b56dc9b 100644 --- a/include/sidebar_admin.php +++ b/include/sidebar_admin.php @@ -9,7 +9,7 @@ function global_admin_menu() { $g = new htmlmenu("Global Admin"); - $g->add("View App Queue (".$_SESSION['current']->getQueuedAppCount().")", + $g->add("View App Queue (".application::objectGetEntriesCount(true, false).")", BASE."objectManager.php?sClass=application&bIsQueue=true&sTitle=". "Application%20Queue"); $g->add("View Version Queue (".$_SESSION['current']->getQueuedVersionCount().")", @@ -41,6 +41,10 @@ function global_admin_menu() { $g->addmisc(" "); + $g->add("View Rejected Applications (".application::objectGetEntriesCount(true, + true).")", + BASE."objectManager.php?sClass=application&bIsQueue=true&bIsRejected=true&". + "sTitle=Rejected%20Applications"); $g->add("View Rejected Test Results (".testData::objectGetEntriesCount(true, true).")", BASE."objectManager.php?sClass=testData&bIsQueue=true&bIsRejected=true&".