[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. 562091f45b110851abe8bcc254479d65038da95a

Stefan Hornburg racke at rt.icdevgroup.org
Thu Apr 9 14:53:00 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange wellwell catalog".

The branch, master has been updated
       via  562091f45b110851abe8bcc254479d65038da95a (commit)
      from  10b73c48dfbf6e274bafba1aae15673dba71a6bf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 562091f45b110851abe8bcc254479d65038da95a
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Thu Apr 9 16:52:46 2009 +0200

    type field added to carts table

-----------------------------------------------------------------------

Summary of changes and diff:
 plugins/wishlists/code/wishlist.tag        |   12 +++++++-----
 plugins/wishlists/database/pgsql/carts.sql |    3 ++-
 plugins/wishlists/plugin.cfg               |    1 +
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/plugins/wishlists/code/wishlist.tag b/plugins/wishlists/code/wishlist.tag
index 7469038..76d8547 100644
--- a/plugins/wishlists/code/wishlist.tag
+++ b/plugins/wishlists/code/wishlist.tag
@@ -1,13 +1,14 @@
-UserTag wishlist Order function sku name
+UserTag wishlist Order function sku name type
 UserTag wishlist AddAttr
 UserTag wishlist HasEndTag
 UserTag wishlist Routine <<EOR
 sub {
-	my ($function, $sku, $name, $opt, $body) = @_;
+	my ($function, $sku, $name, $type, $opt, $body) = @_;
 	my ($wishlist_code, $set);
 
 	$function ||= 'list';
 	$name ||= $Variable->{WISHLISTS_DEFAULT_NAME};
+	$type ||= $Variable->{WISHLISTS_DEFAULT_TYPE};
 
 	unless ($Session->{logged_in}) {
 		return;
@@ -18,7 +19,7 @@ sub {
 	if ($function eq 'carts') {
 		my @carts;
 
-		$set = $Db{carts}->query(qq{select code from carts where uid = $Session->{username} order by name}); 
+		$set = $Db{carts}->query(qq{select code from carts where uid = $Session->{username} and type = '%s' order by name}, $type); 
 		@carts = map {$_->[0]} @$set;
 
 		return wantarray ? @carts : join(',', @carts);
@@ -60,8 +61,9 @@ sub {
 		unless ($wishlist_code) {
 			$wishlist_code = $Db{carts}->autosequence();
 			$Db{carts}->set_slice($wishlist_code, uid => $Session->{username},
-								created => $Tag->time({format => '%s'}),
-								name => $name);
+								  created => $Tag->time({format => '%s'}),
+								  type => $type,
+								  name => $name);
 		}
 
 		# check whether product is within wishlist
diff --git a/plugins/wishlists/database/pgsql/carts.sql b/plugins/wishlists/database/pgsql/carts.sql
index da444cb..65f6a49 100644
--- a/plugins/wishlists/database/pgsql/carts.sql
+++ b/plugins/wishlists/database/pgsql/carts.sql
@@ -1,6 +1,7 @@
 CREATE TABLE carts (
   code serial PRIMARY KEY,
-  name varchar(255) NOT NULL,
+  name varchar(255) NOT NULL default '',
+  type varchar(32) NOT NULL default '',
   uid integer NOT NULL,
   created integer NOT NULL,
   last_modified integer NOT NULL default 0
diff --git a/plugins/wishlists/plugin.cfg b/plugins/wishlists/plugin.cfg
index 9aa9998..adb9715 100644
--- a/plugins/wishlists/plugin.cfg
+++ b/plugins/wishlists/plugin.cfg
@@ -7,6 +7,7 @@ Database carts AUTO_SEQUENCE carts_code_seq
 Database cart_products COMPOSITE_KEY cart,sku
 
 Variable WISHLISTS_DEFAULT_NAME wishlist
+Variable WISHLISTS_DEFAULT_TYPE wishlist
 
 # additional fields for cart_products table
 Variable WISHLISTS_PRODUCTS_FIELDS quantity


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list