Support vendor queuing
This commit is contained in:
committed by
WineHQ
parent
8cf53f1679
commit
2a7d8e8c3f
@@ -61,12 +61,10 @@ class Vendor {
|
|||||||
*/
|
*/
|
||||||
function create()
|
function create()
|
||||||
{
|
{
|
||||||
if(!$this->canEdit())
|
$hResult = query_parameters("INSERT INTO vendor (vendorName, vendorURL, queued) ".
|
||||||
return FALSE;
|
"VALUES ('?', '?', '?')",
|
||||||
|
$this->sName, $this->sWebpage,
|
||||||
$hResult = query_parameters("INSERT INTO vendor (vendorName, vendorURL) ".
|
$this->mustBeQueued() ? "true" : "false");
|
||||||
"VALUES ('?', '?')",
|
|
||||||
$this->sName, $this->sWebpage);
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iVendorId = mysql_insert_id();
|
$this->iVendorId = mysql_insert_id();
|
||||||
@@ -80,6 +78,23 @@ class Vendor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Un-queue vendor
|
||||||
|
* Returns TRUE or FALSE
|
||||||
|
*/
|
||||||
|
function unQueue()
|
||||||
|
{
|
||||||
|
if(!$this->canEdit())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
$hResult = query_parameters("UPDATE vendor SET queued = '?' WHERE vendorId = '?'",
|
||||||
|
'false', $this->iVendorId);
|
||||||
|
|
||||||
|
if(!$hResult)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update vendor.
|
* Update vendor.
|
||||||
|
|||||||
@@ -23,6 +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',
|
||||||
key(vendorId)
|
key(vendorId)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user