Add and use application::objectGetEntriesCount()

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-04-03 00:00:48 +00:00
committed by WineHQ
parent 4402ac64b1
commit 2d9f73340d
2 changed files with 36 additions and 1 deletions

View File

@@ -913,6 +913,37 @@ class Application {
echo "<p>To view a submission, click on its name. ". echo "<p>To view a submission, click on its name. ".
"From that page you can edit, delete or approve it into the AppDB.</p>\n"; "From that page you can edit, delete or approve it into the AppDB.</p>\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) function get_vendor_from_keywords($sKeywords)

View File

@@ -9,7 +9,7 @@ function global_admin_menu() {
$g = new htmlmenu("Global Admin"); $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=". BASE."objectManager.php?sClass=application&bIsQueue=true&sTitle=".
"Application%20Queue"); "Application%20Queue");
$g->add("View Version Queue (".$_SESSION['current']->getQueuedVersionCount().")", $g->add("View Version Queue (".$_SESSION['current']->getQueuedVersionCount().")",
@@ -41,6 +41,10 @@ function global_admin_menu() {
$g->addmisc("&nbsp;"); $g->addmisc("&nbsp;");
$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, $g->add("View Rejected Test Results (".testData::objectGetEntriesCount(true,
true).")", true).")",
BASE."objectManager.php?sClass=testData&bIsQueue=true&bIsRejected=true&". BASE."objectManager.php?sClass=testData&bIsQueue=true&bIsRejected=true&".