distribution: Change 'queued' to 'state'
This commit is contained in:
committed by
Chris Morgan
parent
18a3b97694
commit
7de7216724
@@ -13,7 +13,7 @@ class distribution {
|
|||||||
var $sUrl;
|
var $sUrl;
|
||||||
var $sSubmitTime;
|
var $sSubmitTime;
|
||||||
var $iSubmitterId;
|
var $iSubmitterId;
|
||||||
var $sQueued;
|
var $sState;
|
||||||
var $aTestingIds;
|
var $aTestingIds;
|
||||||
|
|
||||||
// constructor, fetches the data.
|
// constructor, fetches the data.
|
||||||
@@ -41,7 +41,7 @@ class distribution {
|
|||||||
$this->sUrl = $oRow->url;
|
$this->sUrl = $oRow->url;
|
||||||
$this->sSubmitTime = $oRow->submitTime;
|
$this->sSubmitTime = $oRow->submitTime;
|
||||||
$this->iSubmitterId = $oRow->submitterId;
|
$this->iSubmitterId = $oRow->submitterId;
|
||||||
$this->sQueued = $oRow->queued;
|
$this->sState = $oRow->state;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -101,12 +101,12 @@ class distribution {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$hResult = query_parameters("INSERT INTO distributions (name, url, submitTime, ".
|
$hResult = query_parameters("INSERT INTO distributions (name, url, submitTime, ".
|
||||||
"submitterId, queued) ".
|
"submitterId, state) ".
|
||||||
"VALUES ('?', '?', ?, '?', '?')",
|
"VALUES ('?', '?', ?, '?', '?')",
|
||||||
$this->sName, $this->sUrl,
|
$this->sName, $this->sUrl,
|
||||||
"NOW()",
|
"NOW()",
|
||||||
$_SESSION['current']->iUserId,
|
$_SESSION['current']->iUserId,
|
||||||
$this->mustBeQueued() ? "true" : "false");
|
$this->mustBeQueued() ? 'queued' : 'accepted');
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iDistributionId = query_appdb_insert_id();
|
$this->iDistributionId = query_appdb_insert_id();
|
||||||
@@ -149,7 +149,7 @@ class distribution {
|
|||||||
everyone to delete a queued, empty distribution, because it should be
|
everyone to delete a queued, empty distribution, because it should be
|
||||||
deleted along with the last testData associated with it */
|
deleted along with the last testData associated with it */
|
||||||
if(!($this->canEdit() || (!sizeof($this->aTestingIds) &&
|
if(!($this->canEdit() || (!sizeof($this->aTestingIds) &&
|
||||||
$this->sQueued != "false")))
|
$this->sState != 'accepted')))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// if the distribution has test results only enable an admin to delete
|
// if the distribution has test results only enable an admin to delete
|
||||||
@@ -184,13 +184,13 @@ class distribution {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// If we are not in the queue, we can't move the Distribution out of the queue.
|
// If we are not in the queue, we can't move the Distribution out of the queue.
|
||||||
if(!$this->sQueued == 'true')
|
if($this->sState != 'queued')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(query_parameters("UPDATE distributions SET queued = '?' WHERE distributionId = '?'",
|
if(query_parameters("UPDATE distributions SET state = '?' WHERE distributionId = '?'",
|
||||||
"false", $this->iDistributionId))
|
'accepted', $this->iDistributionId))
|
||||||
{
|
{
|
||||||
$this->sQueued = 'false';
|
$this->sState = 'accepted';
|
||||||
// we send an e-mail to interested people
|
// we send an e-mail to interested people
|
||||||
$this->mailSubmitter("add");
|
$this->mailSubmitter("add");
|
||||||
$this->SendNotificationMail();
|
$this->SendNotificationMail();
|
||||||
@@ -211,7 +211,7 @@ class distribution {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we are not in the queue, we can't move the Distribution out of the queue.
|
// If we are not in the queue, we can't move the Distribution out of the queue.
|
||||||
if(!$this->sQueued == 'true')
|
if($this->sState != 'queued')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return $this->delete();
|
return $this->delete();
|
||||||
@@ -254,10 +254,10 @@ class distribution {
|
|||||||
if(query_parameters("UPDATE testResults SET queued = '?' WHERE testingId = '?'",
|
if(query_parameters("UPDATE testResults SET queued = '?' WHERE testingId = '?'",
|
||||||
"true", $this->iTestingId))
|
"true", $this->iTestingId))
|
||||||
{
|
{
|
||||||
if(query_parameters("UPDATE distribution SET queued = '?' WHERE distributionId = '?'",
|
if(query_parameters("UPDATE distribution SET state = '?' WHERE distributionId = '?'",
|
||||||
"true", $this->iDistributionId))
|
'queued', $this->iDistributionId))
|
||||||
{
|
{
|
||||||
$this->sQueued = 'true';
|
$this->sState = 'queued';
|
||||||
// we send an e-mail to interested people
|
// we send an e-mail to interested people
|
||||||
$this->SendNotificationMail();
|
$this->SendNotificationMail();
|
||||||
|
|
||||||
@@ -351,7 +351,7 @@ class distribution {
|
|||||||
switch($sAction)
|
switch($sAction)
|
||||||
{
|
{
|
||||||
case "add":
|
case "add":
|
||||||
if($this->sQueued == "false")
|
if($this->sState == 'accepted')
|
||||||
{
|
{
|
||||||
$sSubject = "Distribution ".$this->sName." added by ".
|
$sSubject = "Distribution ".$this->sName." added by ".
|
||||||
$_SESSION['current']->sRealname;
|
$_SESSION['current']->sRealname;
|
||||||
@@ -458,8 +458,8 @@ class distribution {
|
|||||||
return FALSE;
|
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 state='?'",
|
||||||
$bQueued ? "true" : "false");
|
$bQueued ? 'queued' : 'accepted');
|
||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
@@ -473,7 +473,7 @@ class distribution {
|
|||||||
function make_distribution_list($varname, $cvalue)
|
function make_distribution_list($varname, $cvalue)
|
||||||
{
|
{
|
||||||
$sQuery = "SELECT name, distributionId FROM distributions
|
$sQuery = "SELECT name, distributionId FROM distributions
|
||||||
WHERE queued = 'false'
|
WHERE state = 'accepted'
|
||||||
ORDER BY name";
|
ORDER BY name";
|
||||||
$hResult = query_parameters($sQuery);
|
$hResult = query_parameters($sQuery);
|
||||||
if(!$hResult) return;
|
if(!$hResult) return;
|
||||||
@@ -528,9 +528,9 @@ class distribution {
|
|||||||
$iRows = distribution::objectGetEntriesCount($bQueued, $bRejected);
|
$iRows = distribution::objectGetEntriesCount($bQueued, $bRejected);
|
||||||
|
|
||||||
$sQuery = "SELECT * FROM distributions
|
$sQuery = "SELECT * FROM distributions
|
||||||
WHERE queued = '?' ORDER BY $sOrderBy $sOrder LIMIT ?,?";
|
WHERE state = '?' ORDER BY $sOrderBy $sOrder LIMIT ?,?";
|
||||||
|
|
||||||
return query_parameters($sQuery, $bQueued ? "true" : "false",
|
return query_parameters($sQuery, $bQueued ? 'queued' : 'accepted',
|
||||||
$iStart, $iRows);
|
$iStart, $iRows);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,7 +564,7 @@ class distribution {
|
|||||||
|
|
||||||
/* Maintainers are allowed to process queued test results and therefore also
|
/* Maintainers are allowed to process queued test results and therefore also
|
||||||
queued distributions */
|
queued distributions */
|
||||||
if(is_object($this) && $this->sQueued != "false" &&
|
if(is_object($this) && $this->sState != 'accepted' &&
|
||||||
maintainer::isUserMaintainer($_SESSION['current']))
|
maintainer::isUserMaintainer($_SESSION['current']))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ create table distributions (
|
|||||||
url varchar(255) default NULL,
|
url varchar(255) default NULL,
|
||||||
submitTime datetime NOT NULL,
|
submitTime datetime NOT NULL,
|
||||||
submitterId int(11) NOT NULL default '0',
|
submitterId int(11) NOT NULL default '0',
|
||||||
queued enum('true','false','rejected') NOT NULL default 'false',
|
state enum('accepted','queued') NOT NULL default 'accepted',
|
||||||
key(distributionId),
|
key(distributionId),
|
||||||
index(name)
|
index(name)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user