Fix app/version rejection. Version queue requeue wasn't requeueing its downloadurl, downloadurl
class was missing objectManager functionality. Rejected appData wasn't being accounted for.
This commit is contained in:
committed by
WineHQ
parent
be5361f751
commit
095d228296
@@ -52,6 +52,34 @@ class appData
|
||||
return $hResult;
|
||||
}
|
||||
|
||||
function reQueue()
|
||||
{
|
||||
if(!$this->canEdit())
|
||||
return FALSE;
|
||||
|
||||
$sQuery = "UPDATE appData SET queued = '?' WHERE id = '?'";
|
||||
$hResult = query_parameters($sQuery, "true", $this->iId);
|
||||
|
||||
if(!$hResult)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function reject()
|
||||
{
|
||||
if(!$this->canEdit())
|
||||
return FALSE;
|
||||
|
||||
$sQuery = "UPDATE appData SET queued = '?' WHERE id = '?'";
|
||||
$hResult = query_parameters($sQuery, "rejected", $this->iId);
|
||||
|
||||
if(!$hResult)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function update($bSilent = FALSE)
|
||||
{
|
||||
if(!$this->canEdit())
|
||||
@@ -122,7 +150,7 @@ class appData
|
||||
}
|
||||
|
||||
/* Get appData for a given version/application, optionally filter by type */
|
||||
function getData($iId, $sType, $bIsVersion = TRUE, $bQueued = FALSE)
|
||||
function getData($iId, $sType, $bIsVersion = TRUE, $bQueued = FALSE, $bRejected = FALSE)
|
||||
{
|
||||
$iAppId = 0;
|
||||
$iVersionId = 0;
|
||||
@@ -132,9 +160,11 @@ class appData
|
||||
else
|
||||
$iAppId = $iId;
|
||||
|
||||
$sQueued = objectManager::getQueueString($bQueued, $bRejected);
|
||||
|
||||
$hResult = query_parameters("SELECT * FROM appData WHERE appId = '?' AND
|
||||
versionId = '?' AND TYPE = '?' AND queued = '?'",
|
||||
$iAppId, $iVersionId, $sType, $bQueued ? "true" : "false");
|
||||
$iAppId, $iVersionId, $sType, $sQueued);
|
||||
|
||||
if(!$hResult || !mysql_num_rows($hResult))
|
||||
return FALSE;
|
||||
|
||||
@@ -244,8 +244,13 @@ class downloadurl
|
||||
$sDownloadUrlDescription = $aValues["sDownloadUrlDescription"];
|
||||
} else if($iVersionId)
|
||||
{
|
||||
if($hResult = appData::getData($iVersionId, "downloadurl",
|
||||
TRUE, TRUE))
|
||||
/* This illustrates the importance of converting downloadurl completely
|
||||
to the objectManager model. If we don't get a match searching for
|
||||
a queued entry, try finding a rejected one. */
|
||||
if(($hResult = appData::getData($iVersionId, "downloadurl",
|
||||
TRUE, TRUE, FALSE)) ||
|
||||
$hResult = appData::getData($iVersionId, "downloadurl",
|
||||
TRUE, TRUE, TRUE))
|
||||
{
|
||||
$oRow = mysql_fetch_object($hResult);
|
||||
$sDownloadUrlUrl = $oRow->url;
|
||||
@@ -370,6 +375,20 @@ class downloadurl
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function reQueue()
|
||||
{
|
||||
$oAppData = new AppData($this->iId);
|
||||
|
||||
return $oAppData->reQueue();
|
||||
}
|
||||
|
||||
function reject()
|
||||
{
|
||||
$oAppData = new AppData($this->iId);
|
||||
|
||||
return $oAppData->reject();
|
||||
}
|
||||
|
||||
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0)
|
||||
{
|
||||
return appData::objectGetEntries($bQueued, $bRejected, $iRows, $iStart,
|
||||
|
||||
@@ -16,7 +16,13 @@ class version_queue
|
||||
{
|
||||
$iTestingId = testData::getNewestTestIdFromVersionId($iVersionId,
|
||||
$this->oVersion->sQueued);
|
||||
if($hResult = appData::getData($iVersionId, "downloadurl", TRUE, TRUE))
|
||||
/* This illustrates the importance of converting downloadurl completely
|
||||
to the objectManager model. If we don't get a match searching for
|
||||
a queued entry, try finding a rejected one. */
|
||||
if(($hResult = appData::getData($iVersionId, "downloadurl",
|
||||
TRUE, TRUE, FALSE)) ||
|
||||
$hResult = appData::getData($iVersionId, "downloadurl",
|
||||
TRUE, TRUE, TRUE))
|
||||
{
|
||||
if($oRow = mysql_fetch_object($hResult))
|
||||
$iDownloadUrlId = $oRow->id;
|
||||
@@ -46,6 +52,7 @@ class version_queue
|
||||
{
|
||||
$this->oVersion->reQueue();
|
||||
$this->oTestDataQueue->reQueue();
|
||||
$this->oDownloadUrl->reQueue();
|
||||
}
|
||||
|
||||
function reject()
|
||||
|
||||
Reference in New Issue
Block a user