appdb/ include/vendor.php tables/appdb_tables.sql

WineHQ wineowner at wine.codeweavers.com
Sat Apr 21 19:57:41 CDT 2007


ChangeSet ID:	31083
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/04/21 19:57:41

Modified files:
	include        : vendor.php 
	tables         : appdb_tables.sql 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Support vendor queuing

Patch: http://cvs.winehq.org/patch.py?id=31083

Old revision  New revision  Changes     Path
 1.22          1.23          +21 -6      appdb/include/vendor.php
 1.31          1.32          +5 -4       appdb/tables/appdb_tables.sql

Index: appdb/include/vendor.php
diff -u -p appdb/include/vendor.php:1.22 appdb/include/vendor.php:1.23
--- appdb/include/vendor.php:1.22	22 Apr 2007  0:57:41 -0000
+++ appdb/include/vendor.php	22 Apr 2007  0:57:41 -0000
@@ -61,12 +61,10 @@ class Vendor {
      */
     function create()
     {
-        if(!$this->canEdit())
-            return FALSE;
-
-        $hResult = query_parameters("INSERT INTO vendor (vendorName, vendorURL) ".
-                                    "VALUES ('?', '?')",
-                                        $this->sName, $this->sWebpage);
+        $hResult = query_parameters("INSERT INTO vendor (vendorName, vendorURL, queued) ".
+                                    "VALUES ('?', '?', '?')",
+                                        $this->sName, $this->sWebpage,
+                                        $this->mustBeQueued() ? "true" : "false");
         if($hResult)
         {
             $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.
Index: appdb/tables/appdb_tables.sql
diff -u -p appdb/tables/appdb_tables.sql:1.31 appdb/tables/appdb_tables.sql:1.32
--- appdb/tables/appdb_tables.sql:1.31	22 Apr 2007  0:57:41 -0000
+++ appdb/tables/appdb_tables.sql	22 Apr 2007  0:57:41 -0000
@@ -20,9 +20,10 @@ drop table if exists sessionMessages;
  * vendor information
  */
 create table vendor (
-       vendorId   int not null auto_increment,
-       vendorName	varchar(100) not null,
-       vendorURL  varchar(200),
+       vendorId         int not null auto_increment,
+       vendorName       varchar(100) not null,
+       vendorURL        varchar(200),
+       queued           enum('true','false') NOT NULL default 'false',
        key(vendorId)
 );
 
@@ -31,7 +32,7 @@ create table vendor (
  * application
  */
 create table appFamily (
-	appId	        int not null auto_increment,
+	appId	      int not null auto_increment,
 	appName       varchar(100) not null,
 	vendorId      int not null,
 	keywords      text,



More information about the wine-cvs mailing list