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;
|
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)
|
function update($bSilent = FALSE)
|
||||||
{
|
{
|
||||||
if(!$this->canEdit())
|
if(!$this->canEdit())
|
||||||
@@ -122,7 +150,7 @@ class appData
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get appData for a given version/application, optionally filter by type */
|
/* 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;
|
$iAppId = 0;
|
||||||
$iVersionId = 0;
|
$iVersionId = 0;
|
||||||
@@ -132,9 +160,11 @@ class appData
|
|||||||
else
|
else
|
||||||
$iAppId = $iId;
|
$iAppId = $iId;
|
||||||
|
|
||||||
|
$sQueued = objectManager::getQueueString($bQueued, $bRejected);
|
||||||
|
|
||||||
$hResult = query_parameters("SELECT * FROM appData WHERE appId = '?' AND
|
$hResult = query_parameters("SELECT * FROM appData WHERE appId = '?' AND
|
||||||
versionId = '?' AND TYPE = '?' AND queued = '?'",
|
versionId = '?' AND TYPE = '?' AND queued = '?'",
|
||||||
$iAppId, $iVersionId, $sType, $bQueued ? "true" : "false");
|
$iAppId, $iVersionId, $sType, $sQueued);
|
||||||
|
|
||||||
if(!$hResult || !mysql_num_rows($hResult))
|
if(!$hResult || !mysql_num_rows($hResult))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
@@ -244,8 +244,13 @@ class downloadurl
|
|||||||
$sDownloadUrlDescription = $aValues["sDownloadUrlDescription"];
|
$sDownloadUrlDescription = $aValues["sDownloadUrlDescription"];
|
||||||
} else if($iVersionId)
|
} else if($iVersionId)
|
||||||
{
|
{
|
||||||
if($hResult = appData::getData($iVersionId, "downloadurl",
|
/* This illustrates the importance of converting downloadurl completely
|
||||||
TRUE, TRUE))
|
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);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
$sDownloadUrlUrl = $oRow->url;
|
$sDownloadUrlUrl = $oRow->url;
|
||||||
@@ -370,6 +375,20 @@ class downloadurl
|
|||||||
return TRUE;
|
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)
|
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0)
|
||||||
{
|
{
|
||||||
return appData::objectGetEntries($bQueued, $bRejected, $iRows, $iStart,
|
return appData::objectGetEntries($bQueued, $bRejected, $iRows, $iStart,
|
||||||
|
|||||||
@@ -16,7 +16,13 @@ class version_queue
|
|||||||
{
|
{
|
||||||
$iTestingId = testData::getNewestTestIdFromVersionId($iVersionId,
|
$iTestingId = testData::getNewestTestIdFromVersionId($iVersionId,
|
||||||
$this->oVersion->sQueued);
|
$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))
|
if($oRow = mysql_fetch_object($hResult))
|
||||||
$iDownloadUrlId = $oRow->id;
|
$iDownloadUrlId = $oRow->id;
|
||||||
@@ -46,6 +52,7 @@ class version_queue
|
|||||||
{
|
{
|
||||||
$this->oVersion->reQueue();
|
$this->oVersion->reQueue();
|
||||||
$this->oTestDataQueue->reQueue();
|
$this->oTestDataQueue->reQueue();
|
||||||
|
$this->oDownloadUrl->reQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
function reject()
|
function reject()
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ create table appData (
|
|||||||
url varchar(255) default NULL,
|
url varchar(255) default NULL,
|
||||||
submitTime timestamp(14) NOT NULL,
|
submitTime timestamp(14) NOT NULL,
|
||||||
submitterId int(11) NOT NULL default '0',
|
submitterId int(11) NOT NULL default '0',
|
||||||
queued enum('true','false') NOT NULL default 'false',
|
queued enum('true','false','rejected') NOT NULL default 'false',
|
||||||
KEY id (id),
|
KEY id (id),
|
||||||
KEY versionId (versionId)
|
KEY versionId (versionId)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user