vendor: Rename 'queued' to 'state'
This commit is contained in:
committed by
Chris Morgan
parent
5d0269506b
commit
49d334d1d1
@@ -94,7 +94,7 @@ class application_queue
|
|||||||
{
|
{
|
||||||
/* The vendor is not necessarily queued, as it could have existed on
|
/* The vendor is not necessarily queued, as it could have existed on
|
||||||
beforehand */
|
beforehand */
|
||||||
if($this->oVendor->sQueued != "false")
|
if($this->oVendor->objectGetState() != 'accepted')
|
||||||
$this->oVendor->unQueue();
|
$this->oVendor->unQueue();
|
||||||
|
|
||||||
$this->oApp->unQueue();
|
$this->oApp->unQueue();
|
||||||
@@ -188,7 +188,7 @@ class application_queue
|
|||||||
|
|
||||||
/* Display the new vendor form for new applications or if we
|
/* Display the new vendor form for new applications or if we
|
||||||
are processing an application and the vendor is queued */
|
are processing an application and the vendor is queued */
|
||||||
if(!$this->oApp->iAppId || $this->oVendor->sQueued != "false")
|
if(!$this->oApp->iAppId || $this->oVendor->objectGetState() != 'accepted')
|
||||||
{
|
{
|
||||||
echo html_frame_start("New Vendor", "90%");
|
echo html_frame_start("New Vendor", "90%");
|
||||||
$this->oVendor->outputEditor();
|
$this->oVendor->outputEditor();
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Vendor {
|
|||||||
var $iVendorId;
|
var $iVendorId;
|
||||||
var $sName;
|
var $sName;
|
||||||
var $sWebpage;
|
var $sWebpage;
|
||||||
var $sQueued;
|
private $sState;
|
||||||
var $aApplicationsIds; // an array that contains the appId of every application linked to this vendor
|
var $aApplicationsIds; // an array that contains the appId of every application linked to this vendor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,7 +39,7 @@ class Vendor {
|
|||||||
$this->iVendorId = $oRow->vendorId;
|
$this->iVendorId = $oRow->vendorId;
|
||||||
$this->sName = $oRow->vendorName;
|
$this->sName = $oRow->vendorName;
|
||||||
$this->sWebpage = $oRow->vendorURL;
|
$this->sWebpage = $oRow->vendorURL;
|
||||||
$this->sQueued = $oRow->queued;
|
$this->sState = $oRow->state;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -57,7 +57,6 @@ class Vendor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new vendor.
|
* Creates a new vendor.
|
||||||
*
|
*
|
||||||
@@ -83,10 +82,10 @@ class Vendor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$hResult = query_parameters("INSERT INTO vendor (vendorName, vendorURL, queued) ".
|
$hResult = query_parameters("INSERT INTO vendor (vendorName, vendorURL, state) ".
|
||||||
"VALUES ('?', '?', '?')",
|
"VALUES ('?', '?', '?')",
|
||||||
$this->sName, $this->sWebpage,
|
$this->sName, $this->sWebpage,
|
||||||
$this->mustBeQueued() ? "true" : "false");
|
$this->mustBeQueued() ? 'queued' : 'accepted');
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iVendorId = query_appdb_insert_id();
|
$this->iVendorId = query_appdb_insert_id();
|
||||||
@@ -109,8 +108,8 @@ class Vendor {
|
|||||||
if(!$this->canEdit())
|
if(!$this->canEdit())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
$hResult = query_parameters("UPDATE vendor SET queued = '?' WHERE vendorId = '?'",
|
$hResult = query_parameters("UPDATE vendor SET state = '?' WHERE vendorId = '?'",
|
||||||
'false', $this->iVendorId);
|
'accepted', $this->iVendorId);
|
||||||
|
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -282,6 +281,11 @@ class Vendor {
|
|||||||
return $oOMTableRow;
|
return $oOMTableRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function objectGetState()
|
||||||
|
{
|
||||||
|
return $this->sState;
|
||||||
|
}
|
||||||
|
|
||||||
function canEdit()
|
function canEdit()
|
||||||
{
|
{
|
||||||
if($_SESSION['current']->hasPriv("admin"))
|
if($_SESSION['current']->hasPriv("admin"))
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ create table vendor (
|
|||||||
vendorId int not null auto_increment,
|
vendorId int not null auto_increment,
|
||||||
vendorName varchar(100) not null,
|
vendorName varchar(100) not null,
|
||||||
vendorURL varchar(200),
|
vendorURL varchar(200),
|
||||||
queued enum('true','false') NOT NULL default 'false',
|
state enum('accepted','queued') NOT NULL default 'accepted',
|
||||||
key(vendorId)
|
key(vendorId)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user