Index: openacs-4/packages/ecommerce/www/admin/products/upload-utilities.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/upload-utilities.adp,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/ecommerce/www/admin/products/upload-utilities.adp 16 Aug 2008 12:52:02 -0000 1.5
+++ openacs-4/packages/ecommerce/www/admin/products/upload-utilities.adp 18 Oct 2008 10:15:32 -0000 1.6
@@ -42,9 +42,11 @@
Upload Vendor Imports imports
-products from a vendor website according to previously defined procedures: ecds_vendor_procs.
+products from a vendor website according to previously defined procedures: ecds_vendor_procs using references in a file.
-
+
+Vendor Imports Add/Update adds or imports products from a vendor website via a form.
+
Note:
Index: openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update-2.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update-2.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update-2.adp 18 Oct 2008 10:15:32 -0000 1.1
@@ -0,0 +1,13 @@
+
+ @title;noquote@
+ @context;noquote@
+@title@
+
+
+ @doc_body;noquote@
+ Successfully imported @success_count@ @product_string@ out of @line_count@.
+ See server log for details.
+
+
+ @doc_body;noquote@
+
Index: openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update-2.tcl 18 Oct 2008 10:15:32 -0000 1.1
@@ -0,0 +1,56 @@
+# www/[ec_url_concat [ec_url] /admin]/products/upload-vendor-imports-2.tcl
+ad_page_contract {
+
+ @author
+ @creation-date
+ @cvs-id $Id: vendor-imports-add-update-2.tcl,v 1.1 2008/10/18 10:15:32 torbenb Exp $
+ @author ported by Jerry Asher (jerry@theashergroup.com)
+} {
+ vendor_sku_string
+ abbrev
+}
+
+set doc_body ""
+# We need them to be logged in
+ad_require_permission [ad_conn package_id] admin
+set user_id [ad_get_user_id]
+set peeraddr [ns_conn peeraddr]
+set serious_errors 0
+# Grab package_id as context_id
+set context_id [ad_conn package_id]
+
+set title "Import / Add Vendors Products"
+set context [list [list index Products] $title]
+
+# Check that vendor abbrev length is > 0
+if { [string length $abbrev] == 0 } {
+ append doc_body "Vendor abbreviation does not exist."
+ set serious_errors 1
+}
+
+# Start reading.
+
+set count 0
+set errors $serious_errors
+set success_count 0
+
+regsub -all -- {[^a-zA-Z0-9\-_\(\)\[\]\.] } $vendor_sku_string { } vendor_sku_string
+set vendor_sku_list [split $vendor_sku_string]
+foreach vendor_sku $vendor_sku_list {
+ set vendor_code [string trim $vendor_sku]
+ set product_id [ecds_import_product_from_vendor_site $abbrev vendor $vendor_code]
+ incr count
+ if { $product_id == -1 } {
+ ns_log Warning "vendor-imports-add-update-2.tcl: Unable to import \"${vendor_code}\"."
+ } else {
+ incr success_count
+ }
+}
+
+if { $success_count == 1 } {
+ set product_string "product"
+} else {
+ set product_string "products"
+}
+
+set line_count [ec_decode $count "0" "0" [expr $count -1]]
Index: openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update.adp 18 Oct 2008 10:15:32 -0000 1.1
@@ -0,0 +1,18 @@
+
+ @title;noquote@
+ @context;noquote@
+@title@
+Enter vendor product references into this form to add to the product catalog.
+The system will attempt to import referenced products from vendor's website based
+on custom code built around ecds_import_product_from_vendor_site.
+
+
+
Index: openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ecommerce/www/admin/products/vendor-imports-add-update.tcl 18 Oct 2008 10:15:32 -0000 1.1
@@ -0,0 +1,15 @@
+# www/[ec_url_concat [ec_url] /admin]/products/upload.tcl
+ad_page_contract {
+ This page uploads a data file containing store-specific products into
+ the catalog. The file format should be:
+
+ one product reference per line
+} {
+}
+
+ad_require_permission [ad_conn package_id] admin
+
+set title "Import / Add Vendors Products"
+set context [list [list index Products] $title]
+
+set vendor_choose_widget_html [ecds_vendor_choose_widget]