objectManager, add rejection support. Add support in objectManager for handling rejected
data.
This commit is contained in:
committed by
WineHQ
parent
18bb33902e
commit
c545581571
@@ -64,7 +64,8 @@ if($aClean['iPage'])
|
|||||||
$currentPage = $aClean['iPage'];
|
$currentPage = $aClean['iPage'];
|
||||||
|
|
||||||
$ItemsPerPage = min($ItemsPerPage,100);
|
$ItemsPerPage = min($ItemsPerPage,100);
|
||||||
$totalPages = ceil(appData::objectGetEntriesCount("all", "screenshot")/$ItemsPerPage);
|
$totalPages = ceil(appData::objectGetEntriesCount("all", false,
|
||||||
|
"screenshot")/$ItemsPerPage);
|
||||||
$currentPage = min($currentPage,$totalPages);
|
$currentPage = min($currentPage,$totalPages);
|
||||||
$offset = (($currentPage-1) * $ItemsPerPage);
|
$offset = (($currentPage-1) * $ItemsPerPage);
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ echo "</tr>\n\n";
|
|||||||
/* Display the number of images */
|
/* Display the number of images */
|
||||||
echo "<tr class=color4>\n";
|
echo "<tr class=color4>\n";
|
||||||
echo " <td>Screenshots:</td>\n";
|
echo " <td>Screenshots:</td>\n";
|
||||||
echo " <td>".appData::objectGetEntriesCount("false", "screenshot")."</td>\n";
|
echo " <td>".appData::objectGetEntriesCount("false", false, "screenshot")."</td>\n";
|
||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
echo "</table>\n\n";
|
echo "</table>\n\n";
|
||||||
|
|||||||
@@ -104,8 +104,18 @@ class appData
|
|||||||
return $hResult;
|
return $hResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntriesCount($sQueued, $sType = null)
|
function objectGetEntriesCount($sQueued, $bRejected, $sType = null)
|
||||||
{
|
{
|
||||||
|
/* Not implemented for appData */
|
||||||
|
if($bRejected)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* Compatibility with objectManager */
|
||||||
|
if($sQueued === true)
|
||||||
|
$sQueued = "true";
|
||||||
|
if($sQueued === false)
|
||||||
|
$sQueued = "false";
|
||||||
|
|
||||||
if(($sQueued == "true" || $sQueued == "all") && !appData::canEdit($sType))
|
if(($sQueued == "true" || $sQueued == "all") && !appData::canEdit($sType))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@@ -210,8 +220,12 @@ class appData
|
|||||||
return $aCells;
|
return $aCells;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntries($bQueued, $iRows = 0, $iStart = 0, $sType)
|
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0, $sType)
|
||||||
{
|
{
|
||||||
|
/* Not implemented for appData */
|
||||||
|
if($bRejected)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if($bQueued && !appData::canEdit($sType))
|
if($bQueued && !appData::canEdit($sType))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@@ -268,7 +282,7 @@ class appData
|
|||||||
{
|
{
|
||||||
if(!$iRows)
|
if(!$iRows)
|
||||||
$iRows = appData::objectGetEntriesCount($bQueued ? "true" : "false",
|
$iRows = appData::objectGetEntriesCount($bQueued ? "true" : "false",
|
||||||
$sType);
|
$bRejected, $sType);
|
||||||
$sQuery .= " LIMIT ?,?";
|
$sQuery .= " LIMIT ?,?";
|
||||||
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
|
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
|
||||||
$bQueued ? "true" : "false", $sType,
|
$bQueued ? "true" : "false", $sType,
|
||||||
@@ -300,7 +314,7 @@ class appData
|
|||||||
{
|
{
|
||||||
if(!$iRows)
|
if(!$iRows)
|
||||||
$iRows = appData::objectGetEntriesCount($bQueued ? "true" : "false",
|
$iRows = appData::objectGetEntriesCount($bQueued ? "true" : "false",
|
||||||
$sType);
|
$bRejected, $sType);
|
||||||
$sQuery .= " LIMIT ?,?";
|
$sQuery .= " LIMIT ?,?";
|
||||||
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false", $sType,
|
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false", $sType,
|
||||||
$iStart, $iRows);
|
$iStart, $iRows);
|
||||||
|
|||||||
@@ -838,19 +838,21 @@ class Application {
|
|||||||
return $sLink;
|
return $sLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntries($bQueued)
|
function objectGetEntries($bQueued, $bRejected)
|
||||||
{
|
{
|
||||||
$sQuery = "SELECT * FROM appFamily WHERE
|
$sQuery = "SELECT * FROM appFamily WHERE
|
||||||
appFamily.queued = '?'";
|
appFamily.queued = '?'";
|
||||||
|
|
||||||
|
$sQueued = objectManager::getQueueString($bQueued, $bRejected);
|
||||||
|
|
||||||
if($bQueued && !application::canEdit())
|
if($bQueued && !application::canEdit())
|
||||||
{
|
{
|
||||||
$sQuery .= "AND appFamily.submitterId = '?'";
|
$sQuery .= "AND appFamily.submitterId = '?'";
|
||||||
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false",
|
$hResult = query_parameters($sQuery, $sQueued,
|
||||||
$_SESSION['current']->iUserId);
|
$_SESSION['current']->iUserId);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false");
|
$hResult = query_parameters($sQuery, $sQueued);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
|
|||||||
@@ -367,8 +367,12 @@ class distribution {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get the total number of Distributions in the database */
|
/* Get the total number of Distributions in the database */
|
||||||
function objectGetEntriesCount($bQueued)
|
function objectGetEntriesCount($bQueued, $bRejected)
|
||||||
{
|
{
|
||||||
|
/* Not implemented */
|
||||||
|
if($bRejected)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
$hResult = query_parameters("SELECT count(distributionId) as num_dists FROM
|
$hResult = query_parameters("SELECT count(distributionId) as num_dists FROM
|
||||||
distributions WHERE queued='?'",
|
distributions WHERE queued='?'",
|
||||||
$bQueued ? "true" : "false");
|
$bQueued ? "true" : "false");
|
||||||
@@ -410,8 +414,12 @@ class distribution {
|
|||||||
return $aCells;
|
return $aCells;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntries($bQueued, $iRows = 0, $iStart = 0)
|
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0)
|
||||||
{
|
{
|
||||||
|
/* Not implemented */
|
||||||
|
if($bRejected)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* Only users with edit privileges are allowed to view queued
|
/* Only users with edit privileges are allowed to view queued
|
||||||
items, so return NULL in that case */
|
items, so return NULL in that case */
|
||||||
if($bQueued && !distribution::canEdit())
|
if($bQueued && !distribution::canEdit())
|
||||||
@@ -419,7 +427,7 @@ class distribution {
|
|||||||
|
|
||||||
/* If row limit is 0 we want to fetch all rows */
|
/* If row limit is 0 we want to fetch all rows */
|
||||||
if(!$iRows)
|
if(!$iRows)
|
||||||
$iRows = distribution::objectGetEntriesCount($bQueued);
|
$iRows = distribution::objectGetEntriesCount($bQueued, $bRejected);
|
||||||
|
|
||||||
$sQuery = "SELECT * FROM distributions
|
$sQuery = "SELECT * FROM distributions
|
||||||
WHERE queued = '?' ORDER BY name LIMIT ?,?";
|
WHERE queued = '?' ORDER BY name LIMIT ?,?";
|
||||||
|
|||||||
@@ -193,8 +193,12 @@ class maintainer
|
|||||||
return $hResult;
|
return $hResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ObjectGetEntries($bQueued)
|
function ObjectGetEntries($bQueued, $bRejected)
|
||||||
{
|
{
|
||||||
|
/* Not implemented */
|
||||||
|
if($bRejected)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* Excluding requests for queued apps and versions, as these will be
|
/* Excluding requests for queued apps and versions, as these will be
|
||||||
handled automatically */
|
handled automatically */
|
||||||
$sQuery = "SELECT DISTINCT maintainerId, appMaintainers.submitTime FROM
|
$sQuery = "SELECT DISTINCT maintainerId, appMaintainers.submitTime FROM
|
||||||
@@ -273,8 +277,12 @@ class maintainer
|
|||||||
return $aAppsMaintained;
|
return $aAppsMaintained;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntriesCount($bQueued)
|
function objectGetEntriesCount($bQueued, $bRejected)
|
||||||
{
|
{
|
||||||
|
/* Not implemented */
|
||||||
|
if($bRejected)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* Excluding requests for queued apps and versions, as these are handled
|
/* Excluding requests for queued apps and versions, as these are handled
|
||||||
automatically. One SELECT for super maintainers, one for maintainers. */
|
automatically. One SELECT for super maintainers, one for maintainers. */
|
||||||
$sQuery = "SELECT COUNT(DISTINCT maintainerId) as queued_maintainers FROM
|
$sQuery = "SELECT COUNT(DISTINCT maintainerId) as queued_maintainers FROM
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class ObjectManager
|
|||||||
var $bIsQueue;
|
var $bIsQueue;
|
||||||
var $sTitle;
|
var $sTitle;
|
||||||
var $iId;
|
var $iId;
|
||||||
|
var $bIsRejected;
|
||||||
|
|
||||||
function ObjectManager($sClass, $sTitle = "list", $iId = false)
|
function ObjectManager($sClass, $sTitle = "list", $iId = false)
|
||||||
{
|
{
|
||||||
@@ -58,27 +59,23 @@ class ObjectManager
|
|||||||
$this->checkMethods(array("ObjectGetEntries", "ObjectGetHeader",
|
$this->checkMethods(array("ObjectGetEntries", "ObjectGetHeader",
|
||||||
"ObjectGetInstanceFromRow", "ObjectOutputTableRow", "canEdit"));
|
"ObjectGetInstanceFromRow", "ObjectOutputTableRow", "canEdit"));
|
||||||
|
|
||||||
|
$oObject = new $this->sClass();
|
||||||
/* query the class for its entries */
|
/* query the class for its entries */
|
||||||
/* We pass in $this->bIsQueue to tell the object */
|
/* We pass in $this->bIsQueue to tell the object */
|
||||||
/* if we are requesting a list of its queued objects or */
|
/* if we are requesting a list of its queued objects or */
|
||||||
/* all of its objects */
|
/* all of its objects */
|
||||||
$hResult = call_user_func(array($this->sClass,
|
$hResult = $oObject->objectGetEntries($this->bIsQueue, $this->sIsRejected);
|
||||||
"objectGetEntries"), $this->bIsQueue);
|
|
||||||
|
|
||||||
/* did we get any entries? */
|
/* did we get any entries? */
|
||||||
if(mysql_num_rows($hResult) == 0)
|
if(mysql_num_rows($hResult) == 0)
|
||||||
{
|
{
|
||||||
$sIsQueue = $this->bIsQueue ? "true" : "false";
|
|
||||||
|
|
||||||
if($this->bIsQueue)
|
if($this->bIsQueue)
|
||||||
echo "<center>The queue for '$this->sClass' is empty</center>";
|
echo "<center>The queue for '$this->sClass' is empty</center>";
|
||||||
else
|
else
|
||||||
echo "<center>No entries of '$this->sClass' are present</center>";
|
echo "<center>No entries of '$this->sClass' are present</center>";
|
||||||
|
|
||||||
echo "<br /><center><a href=\"".$_SERVER['PHP_SELF']."?sClass=".
|
echo "<br /><center><a href=\"".$this->makeUrl("add", false,
|
||||||
"$this->sClass&bIsQueue=$sIsQueue&sTitle=".
|
"Add $this->sClass entry")."\">Add an entry?</a></center>";
|
||||||
urlencode($this->sTitle)."&sAction=add\">Add an entry?</a></center>";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,9 +101,8 @@ class ObjectManager
|
|||||||
$oObject = new $this->sClass();
|
$oObject = new $this->sClass();
|
||||||
if($oObject->canEdit())
|
if($oObject->canEdit())
|
||||||
{
|
{
|
||||||
echo "<br /><br /><a href=\"".$_SERVER['PHP_SELF']."?sClass=".
|
echo "<br /><br /><a href=\"".$this->makeUrl("add", false,
|
||||||
"$this->sClass&sAction=add&sTitle=Add\">".
|
"Add $this->sClass")."\">Add entry</a>\n";
|
||||||
"Add entry</a>\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +123,9 @@ class ObjectManager
|
|||||||
echo '<input type="hidden" name="sTitle" value="'.$this->sTitle.'" />';
|
echo '<input type="hidden" name="sTitle" value="'.$this->sTitle.'" />';
|
||||||
echo '<input type="hidden" name="iId" value="'.$this->iId.'" />';
|
echo '<input type="hidden" name="iId" value="'.$this->iId.'" />';
|
||||||
echo '<input type="hidden" name="bIsQueue" '.
|
echo '<input type="hidden" name="bIsQueue" '.
|
||||||
'value='.($this->bIsQueue ? "true" : "false").'>';
|
'value='.($this->bIsQueue ? "true" : "false").' />';
|
||||||
|
echo '<input type="hidden" name=bIsRejected" '.
|
||||||
|
'value='.($this->bIsRejected ? "true" : "false").' />';
|
||||||
|
|
||||||
$oObject = new $this->sClass($this->iId);
|
$oObject = new $this->sClass($this->iId);
|
||||||
|
|
||||||
@@ -307,6 +305,7 @@ class ObjectManager
|
|||||||
$sAction = "&sAction=$sAction";
|
$sAction = "&sAction=$sAction";
|
||||||
|
|
||||||
$sIsQueue = $this->bIsQueue ? "true" : "false";
|
$sIsQueue = $this->bIsQueue ? "true" : "false";
|
||||||
|
$sIsRejected = $this->bIsRejected ? "true" : "false";
|
||||||
|
|
||||||
if(!$sTitle)
|
if(!$sTitle)
|
||||||
$sTitle = $this->sTitle;
|
$sTitle = $this->sTitle;
|
||||||
@@ -314,7 +313,7 @@ class ObjectManager
|
|||||||
$sTitle = urlencode($sTitle);
|
$sTitle = urlencode($sTitle);
|
||||||
|
|
||||||
return APPDB_ROOT."objectManager.php?bIsQueue=$sIsQueue&sClass=$this->sClass".
|
return APPDB_ROOT."objectManager.php?bIsQueue=$sIsQueue&sClass=$this->sClass".
|
||||||
"&sTitle=$sTitle$sId$sAction";
|
"&sTitle=$sTitle$sId$sAction&bIsRejected=$sIsRejected";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get id from form data */
|
/* Get id from form data */
|
||||||
@@ -337,6 +336,20 @@ class ObjectManager
|
|||||||
|
|
||||||
echo html_tr($aCells, $sClass);
|
echo html_tr($aCells, $sClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getQueueString($bQueued, $bRejected)
|
||||||
|
{
|
||||||
|
if($bQueued)
|
||||||
|
{
|
||||||
|
if($bRejected)
|
||||||
|
$sQueueString = "rejected";
|
||||||
|
else
|
||||||
|
$sQueueString = "true";
|
||||||
|
} else
|
||||||
|
$sQueueString = "false";
|
||||||
|
|
||||||
|
return $sQueueString;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -513,9 +513,10 @@ class Screenshot {
|
|||||||
return $shImg;
|
return $shImg;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntries($bQueued, $iRows = 0, $iStart = 0)
|
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0)
|
||||||
{
|
{
|
||||||
return appData::objectGetEntries($bQueued, $iRows, $iStart, "screenshot");
|
return appData::objectGetEntries($bQueued, $bRejected, $iRows, $iStart,
|
||||||
|
"screenshot");
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetHeader()
|
function objectGetHeader()
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ function global_sidebar_menu()
|
|||||||
$g->add("Submit Application", BASE."appsubmit.php?sSub=view&sAppType=application");
|
$g->add("Submit Application", BASE."appsubmit.php?sSub=view&sAppType=application");
|
||||||
$g->add("Help & Documentation", BASE."help/");
|
$g->add("Help & Documentation", BASE."help/");
|
||||||
$g->add("AppDB Stats", BASE."appdbStats.php");
|
$g->add("AppDB Stats", BASE."appdbStats.php");
|
||||||
$g->add("View Distributions (".distribution::objectGetEntriesCount(false).")", BASE."objectManager.php?sClass=distribution&bIsQueue=false&sTitle=View%20Distributions");
|
$g->add("View Distributions (".distribution::objectGetEntriesCount(false, false).")", BASE."objectManager.php?sClass=distribution&bIsQueue=false&sTitle=View%20Distributions");
|
||||||
$g->add("View Vendors (".getNumberOfvendors().")", BASE."objectManager.php?sClass=vendor&bIsQueue=false&sTitle=View%20Vendors");
|
$g->add("View Vendors (".getNumberOfvendors().")", BASE."objectManager.php?sClass=vendor&bIsQueue=false&sTitle=View%20Vendors");
|
||||||
$g->add("Email your suggestions for improving the AppDB", "mailto:appdb@winehq.org");
|
$g->add("Email your suggestions for improving the AppDB", "mailto:appdb@winehq.org");
|
||||||
$g->done();
|
$g->done();
|
||||||
|
|||||||
@@ -20,20 +20,21 @@ function global_admin_menu() {
|
|||||||
$g->add("View Version Queue (".$_SESSION['current']->getQueuedVersionCount().")",
|
$g->add("View Version Queue (".$_SESSION['current']->getQueuedVersionCount().")",
|
||||||
BASE."admin/adminAppQueue.php");
|
BASE."admin/adminAppQueue.php");
|
||||||
$g->add("View Screenshot Queue (".appData::objectGetEntriesCount("true",
|
$g->add("View Screenshot Queue (".appData::objectGetEntriesCount("true",
|
||||||
"screenshot").")",
|
false, "screenshot").")",
|
||||||
BASE."objectManager.php?sClass=screenshot&bIsQueue=true&sTitle=".
|
BASE."objectManager.php?sClass=screenshot&bIsQueue=true&sTitle=".
|
||||||
"Screenshot%20Queue");
|
"Screenshot%20Queue");
|
||||||
$g->add("View Maintainer Queue (".Maintainer::objectGetEntriesCount(true).")",
|
$g->add("View Maintainer Queue (".Maintainer::objectGetEntriesCount(true, false).")",
|
||||||
BASE."objectManager.php?sClass=maintainer&bIsQueue=true&sTitle=".
|
BASE."objectManager.php?sClass=maintainer&bIsQueue=true&sTitle=".
|
||||||
"Maintainer%20Queue");
|
"Maintainer%20Queue");
|
||||||
$g->add("View Maintainer Entries (".Maintainer::getMaintainerCount().")",
|
$g->add("View Maintainer Entries (".Maintainer::getMaintainerCount().")",
|
||||||
BASE."admin/adminMaintainers.php");
|
BASE."admin/adminMaintainers.php");
|
||||||
$g->add("View Bug Links (".getNumberOfQueuedBugLinks()."/".getNumberOfBugLinks().")",
|
$g->add("View Bug Links (".getNumberOfQueuedBugLinks()."/".getNumberOfBugLinks().")",
|
||||||
BASE."admin/adminBugs.php");
|
BASE."admin/adminBugs.php");
|
||||||
$g->add("View Test Results Queue (".testData::objectGetEntriesCount(true).")",
|
$g->add("View Test Results Queue (".testData::objectGetEntriesCount(true, false).")",
|
||||||
BASE."objectManager.php?sClass=testData&bIsQueue=true&sTitle=".
|
BASE."objectManager.php?sClass=testData&bIsQueue=true&sTitle=".
|
||||||
"Test%20Results%20Queue");
|
"Test%20Results%20Queue");
|
||||||
$g->add("View Distribution Queue (".distribution::objectGetEntriesCount(true).")",
|
$g->add("View Distribution Queue (".distribution::objectGetEntriesCount(true,
|
||||||
|
false).")",
|
||||||
BASE."objectManager.php?sClass=distribution&bIsQueue=true&sTitle=".
|
BASE."objectManager.php?sClass=distribution&bIsQueue=true&sTitle=".
|
||||||
"Distribution%20Queue");
|
"Distribution%20Queue");
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ function global_maintainer_admin_menu() {
|
|||||||
$g->add("View Version Queue (".$_SESSION['current']->getQueuedVersionCount().")",
|
$g->add("View Version Queue (".$_SESSION['current']->getQueuedVersionCount().")",
|
||||||
BASE."admin/adminAppQueue.php");
|
BASE."admin/adminAppQueue.php");
|
||||||
$g->add("View Screenshot Queue (".appData::objectGetEntriesCount("true",
|
$g->add("View Screenshot Queue (".appData::objectGetEntriesCount("true",
|
||||||
"screenshot").")",
|
false, "screenshot").")",
|
||||||
BASE."objectManager.php?sClass=screenshot&bIsQueue=true&sTitle=".
|
BASE."objectManager.php?sClass=screenshot&bIsQueue=true&sTitle=".
|
||||||
"Screenshot%20Queue");
|
"Screenshot%20Queue");
|
||||||
$g->add("View Test Results Queue (".testData::objectGetEntriesCount(true).")",
|
$g->add("View Test Results Queue (".testData::objectGetEntriesCount(true, false).")",
|
||||||
BASE."objectManager.php?sClass=testData&bIsQueue=true&sTitle=".
|
BASE."objectManager.php?sClass=testData&bIsQueue=true&sTitle=".
|
||||||
"Test%20Results%20Queue");
|
"Test%20Results%20Queue");
|
||||||
$g->done();
|
$g->done();
|
||||||
|
|||||||
@@ -754,9 +754,10 @@ class testData{
|
|||||||
return $sReturn;
|
return $sReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntriesCount($bQueued)
|
function objectGetEntriesCount($bQueued, $bRejected)
|
||||||
{
|
{
|
||||||
$oTest = new testData();
|
$oTest = new testData();
|
||||||
|
$sQueued = objectManager::getQueueString($bQueued, $bRejected);
|
||||||
if($bQueued && !$oTest->canEdit())
|
if($bQueued && !$oTest->canEdit())
|
||||||
{
|
{
|
||||||
if($oTest->canEditSome())
|
if($oTest->canEditSome())
|
||||||
@@ -777,7 +778,7 @@ class testData{
|
|||||||
AND
|
AND
|
||||||
testResults.queued = '?'";
|
testResults.queued = '?'";
|
||||||
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
|
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
|
||||||
$bQueued ? "true": "false");
|
$sQueued);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
@@ -788,7 +789,7 @@ class testData{
|
|||||||
appVersion.queued = 'false'
|
appVersion.queued = 'false'
|
||||||
AND
|
AND
|
||||||
testResults.queued = '?'";
|
testResults.queued = '?'";
|
||||||
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false");
|
$hResult = query_parameters($sQuery, $sQueued);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
@@ -800,9 +801,10 @@ class testData{
|
|||||||
return $oRow->count;
|
return $oRow->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntries($bQueued)
|
function objectGetEntries($bQueued, $bRejected)
|
||||||
{
|
{
|
||||||
$oTest = new testData();
|
$oTest = new testData();
|
||||||
|
$sQueued = objectManager::getQueueString($bQueued, $bRejected);
|
||||||
if($bQueued && !$oTest->canEdit())
|
if($bQueued && !$oTest->canEdit())
|
||||||
{
|
{
|
||||||
if($oTest->canEditSome())
|
if($oTest->canEditSome())
|
||||||
@@ -823,7 +825,7 @@ class testData{
|
|||||||
AND
|
AND
|
||||||
testResults.queued = '?'";
|
testResults.queued = '?'";
|
||||||
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
|
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
|
||||||
$bQueued ? "true": "false");
|
$sQueued);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
@@ -833,7 +835,7 @@ class testData{
|
|||||||
appVersion.queued = 'false'
|
appVersion.queued = 'false'
|
||||||
AND
|
AND
|
||||||
testResults.queued = '?' ORDER by testingId";
|
testResults.queued = '?' ORDER by testingId";
|
||||||
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false");
|
$hResult = query_parameters($sQuery, $sQueued);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
|
|||||||
@@ -148,11 +148,15 @@ class Vendor {
|
|||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntries($bQueued, $iRows = 0, $iStart = 0)
|
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0)
|
||||||
{
|
{
|
||||||
/* Vendor queueing is not implemented yet */
|
/* Vendor queueing is not implemented yet */
|
||||||
if($bQueued)
|
if($bQueued)
|
||||||
return NULL;
|
return FALSE;
|
||||||
|
|
||||||
|
/* Not implemented */
|
||||||
|
if($bRejected)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if(!$iRows)
|
if(!$iRows)
|
||||||
$iRows = getNumberOfVendors();
|
$iRows = getNumberOfVendors();
|
||||||
|
|||||||
@@ -25,9 +25,18 @@ if(!class_exists($aClean['sClass']))
|
|||||||
|
|
||||||
$oObject = new objectManager($aClean['sClass'], $aClean['sTitle'], $aClean['iId']);
|
$oObject = new objectManager($aClean['sClass'], $aClean['sTitle'], $aClean['iId']);
|
||||||
|
|
||||||
if($aClean['bIsQueue'] == 'true') $oObject->bIsQueue = true;
|
if($aClean['bIsQueue'] == 'true')
|
||||||
else $oObject->bIsQueue = false;
|
$oObject->bIsQueue = true;
|
||||||
|
else
|
||||||
|
$oObject->bIsQueue = false;
|
||||||
|
|
||||||
|
/* If it is rejected it is defined as queued */
|
||||||
|
if($aClean['bIsRejected'] == 'true')
|
||||||
|
{
|
||||||
|
$oObject->bIsRejected = true;
|
||||||
|
$oObject->bIsQueue = true;
|
||||||
|
} else
|
||||||
|
$oObject->bIsRejected = false;
|
||||||
|
|
||||||
$oOtherObject = new $oObject->sClass($oObject->iId);
|
$oOtherObject = new $oObject->sClass($oObject->iId);
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ function test_class($sClassName, $aTestMethods)
|
|||||||
|
|
||||||
/* Should return 1 or more, since there may be entries present already */
|
/* Should return 1 or more, since there may be entries present already */
|
||||||
$iExpected = 1;
|
$iExpected = 1;
|
||||||
$hResult = $oTestObject->objectGetEntries(false);
|
$hResult = $oTestObject->objectGetEntries(false, false);
|
||||||
$iReceived = mysql_num_rows($hResult);
|
$iReceived = mysql_num_rows($hResult);
|
||||||
$oTestObject->delete();
|
$oTestObject->delete();
|
||||||
if($iExpected > $iReceived)
|
if($iExpected > $iReceived)
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ if($aClean['iPage'])
|
|||||||
$currentPage = $aClean['iPage'];
|
$currentPage = $aClean['iPage'];
|
||||||
|
|
||||||
$ItemsPerPage = min($ItemsPerPage,100);
|
$ItemsPerPage = min($ItemsPerPage,100);
|
||||||
$totalPages = ceil(appData::objectGetEntriesCount("false", "screenshot")/$ItemsPerPage);
|
$totalPages = ceil(appData::objectGetEntriesCount("false", false,
|
||||||
|
"screenshot")/$ItemsPerPage);
|
||||||
$currentPage = min($currentPage,$totalPages);
|
$currentPage = min($currentPage,$totalPages);
|
||||||
$offset = (($currentPage-1) * $ItemsPerPage);
|
$offset = (($currentPage-1) * $ItemsPerPage);
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ echo "</form>";
|
|||||||
echo "</center>";
|
echo "</center>";
|
||||||
|
|
||||||
/* query for all of the Screenshots in assending order */
|
/* query for all of the Screenshots in assending order */
|
||||||
$Ids = appData::objectGetEntries(false, $ItemsPerPage, $offset, "screenshot");
|
$Ids = appData::objectGetEntries(false, false, $ItemsPerPage, $offset, "screenshot");
|
||||||
$c = 1;
|
$c = 1;
|
||||||
echo "<div align=center><table><tr>\n";
|
echo "<div align=center><table><tr>\n";
|
||||||
while ($oRow = mysql_fetch_object($Ids))
|
while ($oRow = mysql_fetch_object($Ids))
|
||||||
|
|||||||
Reference in New Issue
Block a user