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. ".
"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)