[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. 932e60368b1db4b5f37506802c33bcd6f73c2002
Stefan Hornburg
racke at rt.icdevgroup.org
Thu Mar 26 16:58:26 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 932e60368b1db4b5f37506802c33bcd6f73c2002 (commit)
via 7285a4ef19aa58f77fe35708e989bab58390725e (commit)
via f0c39028e7fa82d5c60dd967751067aeb1f71036 (commit)
via be937d7e3534c8f9b750855256d54ddb0f4034f5 (commit)
via 1393e7fcfb652c2a64a779252c1c29f04c13d415 (commit)
from 1b647536e596d1c6f2b621b4897b94521eeb8e9a (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 932e60368b1db4b5f37506802c33bcd6f73c2002
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Thu Mar 26 17:57:49 2009 +0100
link to product page
commit 7285a4ef19aa58f77fe35708e989bab58390725e
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Thu Mar 26 17:57:17 2009 +0100
fixed definition of key for users table
commit f0c39028e7fa82d5c60dd967751067aeb1f71036
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Thu Mar 26 17:56:49 2009 +0100
form submit theming function added
commit be937d7e3534c8f9b750855256d54ddb0f4034f5
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Thu Mar 26 17:55:31 2009 +0100
long description of products and users added to migration
commit 1393e7fcfb652c2a64a779252c1c29f04c13d415
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Thu Mar 26 17:54:40 2009 +0100
theming for form submit button added, short piece of documentation for form theming
-----------------------------------------------------------------------
Summary of changes and diff:
README | 17 +++++++++++++++++
catalog.cfg | 3 ++-
code/form.tag | 2 +-
code/theme_form_submit.code | 7 +++++++
components/product_list | 2 +-
jobs/migrate/standard | 23 ++++++++++++++++++++---
6 files changed, 48 insertions(+), 6 deletions(-)
create mode 100644 code/theme_form_submit.code
diff --git a/README b/README
index 465ade0..bcb5a1f 100755
--- a/README
+++ b/README
@@ -105,6 +105,23 @@ wellwell=> select * from form_attributes where component = 'content_edit';
30 | uri | content_edit | width | 200
31 | body | content_edit | height | 400
+Theming
+-------
+
+Most aspects of a form can be 'themed':
+
+* title
+* elements (complete, label and field)
+* submit button
+
+Currently, you can modify one of the existing theme functions:
+
+theme_form_title
+theme_form_element
+theme_form_element_label
+theme_form_element_field
+theme_form_submit
+
Plugins
*******
diff --git a/catalog.cfg b/catalog.cfg
index 523dec4..c77931a 100644
--- a/catalog.cfg
+++ b/catalog.cfg
@@ -39,7 +39,8 @@ NoImportExternal Yes
Database images AUTO_SEQUENCE 1
Database product_images COMPOSITE_KEY sku,image
-Database users KEY username
+Database users KEY uid
+Database users AUTO_SEQUENCE users_uid_seq
# Plugins
include plugins/{__PLUGINS__}/plugin.cfg
diff --git a/code/form.tag b/code/form.tag
index d71c753..bff6f3c 100644
--- a/code/form.tag
+++ b/code/form.tag
@@ -247,7 +247,7 @@ EOT
$fhash{body} .= join("\n", @out);
- $fhash{submit} = q{<input type="submit" name="submit" value="OK">};
+ $fhash{submit} = theme('form_submit', $opt->{series}, $form_name);
$fhash{bottom} = q{</form>};
$fhash{required} = $required_fields;
diff --git a/code/theme_form_submit.code b/code/theme_form_submit.code
new file mode 100644
index 0000000..8775bf3
--- /dev/null
+++ b/code/theme_form_submit.code
@@ -0,0 +1,7 @@
+Sub theme_form_submit <<EOS
+sub {
+ my ($series, $part) = @_;
+
+ return q{<input type="submit" name="submit" value="OK">};
+}
+EOS
diff --git a/components/product_list b/components/product_list
index 342bdba..7972fae 100644
--- a/components/product_list
+++ b/components/product_list
@@ -22,7 +22,7 @@
[/image-list]
</p>
-<h3>[product-field manufacturer] [product-field name]</h3>
+<h3><a href="[product-code]">[product-field manufacturer] [product-field name]</a></h3>
<p class="description">
[product-field description]
</p>
diff --git a/jobs/migrate/standard b/jobs/migrate/standard
index a0cadf8..a5a34d2 100644
--- a/jobs/migrate/standard
+++ b/jobs/migrate/standard
@@ -4,8 +4,10 @@
[/comment]
[anydata table="standard_products" format="TAB" name="database/standard/products.txt" hide=1]
[query table="standard_products" sql="select * from standard_products" hashref="products"/]
-[perl tables="products categories product_categories" short_errors="1"]
-my ($sku, %count, $group, %prod_groups, $cat, %categories, $code);
+[anydata table="standard_users" format="TAB" name="database/standard/userdb.txt" hide=1]
+[query table="standard_users" sql="select * from standard_users" hashref="users"/]
+[perl tables="products categories product_categories users" short_errors="1"]
+my (@out, $sku, %count, $group, %prod_groups, $cat, %categories, $code);
for my $productref (@{$Tmp->{products}}) {
$sku = delete $productref->{sku};
@@ -13,6 +15,7 @@ for my $productref (@{$Tmp->{products}}) {
$Db{products}->set_slice($sku,
name => $productref->{title},
description => $productref->{description},
+ long_description => $productref->{comment},
price => $productref->{price},
inactive => $productref->{inactive});
$count{products}++;
@@ -43,5 +46,19 @@ for my $productref (@{$Tmp->{products}}) {
}
}
-return "$count{products} products migrated.";
+push (@out, "$count{products} products migrated.");
+my ($userref);
+
+for my $userref (@{$Tmp->{users}}) {
+ my $uid;
+
+ $uid = $Db{users}->set_slice(undef, {username => $userref->{username},
+ password => $userref->{password},
+ email => $userref->{email}});
+
+ $count{users}++;
+}
+
+push (@out, "$count{users} users migrated.");
+return join("\n", @out);
[/perl]
hooks/post-receive
--
Interchange wellwell catalog
More information about the wellwell-devel
mailing list