Index: openacs-4/packages/ecommerce/www/admin/products/recommendation-add-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation-add-2.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation-add-2.adp 16 Aug 2008 12:29:41 -0000 1.1 @@ -0,0 +1,30 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +
+@export_form_vars_html;noquote@ + + + + + + + + + + + + + + + + + +
Product:@product_name;noquote@
Recommended For:@recommended_for_html;noquote@
Display Recommendation In:@display_in_html;noquote@
Accompanying Text
(HTML format):
+ +
+ +
+
Index: openacs-4/packages/ecommerce/www/admin/products/recommendation-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation-add-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/products/recommendation-add-2.tcl 9 Mar 2004 00:59:51 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation-add-2.tcl 16 Aug 2008 12:29:41 -0000 1.4 @@ -14,41 +14,9 @@ set product_name [ec_product_name $product_id] -doc_body_append "[ad_admin_header "Add a Product Recommendation"] +set title "Add a Product Recommendation" +set context [list [list index Products] $title] -

Add a Product Recommendation

- -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "recommendations.tcl" "Recommendations"] "Add One"] - -
- -
-[export_form_vars product_id] - - - - - - - - - - - - - - - - - - -
Product:$product_name
Recommended For:[ec_user_class_widget]
Display Recommendation In:[ec_category_widget "f" "" "t"]
Accompanying Text
(HTML format):
- -
- -
- -
- -[ad_admin_footer] -" +set export_form_vars_html [export_form_vars product_id] +set recommended_for_html [ec_user_class_widget] +set display_in_html [ec_category_widget "f" "" "t"] Index: openacs-4/packages/ecommerce/www/admin/products/recommendation-add-3.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation-add-3.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation-add-3.adp 16 Aug 2008 12:29:41 -0000 1.1 @@ -0,0 +1,34 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +

Please confirm your product recommendation:

+ +
+ + + + + + + + + + + + + + + + + +
Product:@product_name;noquote@
Recommended For:@user_class_html@
Display Recommendation In:@categorization_html;noquote@
Accompanying Text
(HTML format):
@recommendation_text@
+
+ +
+@export_form_vars_html;noquote@ +
+ +
+
Index: openacs-4/packages/ecommerce/www/admin/products/recommendation-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation-add-3.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/products/recommendation-add-3.tcl 9 Mar 2004 00:59:51 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation-add-3.tcl 16 Aug 2008 12:29:41 -0000 1.5 @@ -23,73 +23,32 @@ set subsubcategory_list [list] for { set counter 0 } { $counter < [llength $categorization] } {incr counter} { if { $counter == 0 } { - lappend category_list [lindex $categorization 0] + lappend category_list [lindex $categorization 0] } if { $counter == 1 } { - lappend subcategory_list [lindex $categorization 1] + lappend subcategory_list [lindex $categorization 1] } if { $counter == 2 } { - lappend subsubcategory_list [lindex $categorization 2] + lappend subsubcategory_list [lindex $categorization 2] } } - set recommendation_id [db_nextval ec_recommendation_id_sequence] -doc_body_append "[ad_admin_header "Confirm Product Recommendation"] +set title "Confirm Product Recommendation" +set context [list [list index Products] $title] -

Confirm Product Recommendation

- -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "recommendations.tcl" "Recommendations"] "Add One"] - -
- -Please confirm your product recommendation: - -
- - - - - - - - -" if { ![empty_string_p $user_class_id] } { - doc_body_append " - " + set user_class_html "[db_string user_class_select "select user_class_name from ec_user_classes where user_class_id=:user_class_id"]" } else { - doc_body_append " - " + set user_class_html "All Users" } -doc_body_append " - - -" + if { [empty_string_p $categorization] } { - doc_body_append "" + set categorization_html "Top Level" } else { - doc_body_append "" + set categorization_html "[ec_category_subcategory_and_subsubcategory_display $category_list $subcategory_list $subsubcategory_list]" } -doc_body_append " - - - - -
Product:$product_name
Recommended For:[db_string user_class_select "select user_class_name from ec_user_classes where user_class_id=:user_class_id"]All Users
Display Recommendation In:Top Level[ec_category_subcategory_and_subsubcategory_display $category_list $subcategory_list $subsubcategory_list]
Accompanying Text
(HTML format):
$recommendation_text
+set export_form_vars_html [export_form_vars product_id product_name user_class_id recommendation_text recommendation_id categorization] -
- -
-[export_form_vars product_id product_name user_class_id recommendation_text recommendation_id categorization] - -
- -
- -
- -[ad_admin_footer] -" Index: openacs-4/packages/ecommerce/www/admin/products/recommendation-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation-add.adp 16 Aug 2008 12:29:41 -0000 1.1 @@ -0,0 +1,14 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +

Please choose the product you wish to recommend.

+ + +
    + @product_search_select_html;noquote@ +
+
+

No matching products were found.

+
Index: openacs-4/packages/ecommerce/www/admin/products/recommendation-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation-add.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/products/recommendation-add.tcl 9 Mar 2004 00:59:51 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation-add.tcl 16 Aug 2008 12:29:41 -0000 1.4 @@ -12,36 +12,15 @@ ad_require_permission [ad_conn package_id] admin -set header_to_print "Please choose the product you wish to recommend. -
    -" -doc_body_append "[ad_admin_header "Add a Product Recommendation"] +set title "Add a Product Recommendation" +set context [list [list index Products] $title] -

    Add a Product Recommendation

    - -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "recommendations.tcl" "Recommendations"] "Add One"] - -
    -" - -set header_written_p 0 -db_foreach product_search_select " -select product_name, product_id -from ec_products -where upper(product_name) like '%' || upper(:product_name_query) || '%' -" { - if { $header_written_p == 0 } { - doc_body_append $header_to_print - incr header_written_p - } - doc_body_append "
  • $product_name \[view | recommend\] ($product_id)\n" +set product_count 0 +set product_search_select_html "" +db_foreach product_search_select "select product_name, product_id + from ec_products + where upper(product_name) like '%' || upper(:product_name_query) || '%'" { + append product_search_select_html "
  • $product_name \[view | recommend\] ($product_id)
  • \n" + incr product_count } -if { $header_written_p } { - doc_body_append "
" -} else { - doc_body_append "No matching products were found." -} - -doc_body_append "[ad_admin_footer] -" Index: openacs-4/packages/ecommerce/www/admin/products/recommendation-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation-delete.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation-delete.adp 16 Aug 2008 12:29:41 -0000 1.1 @@ -0,0 +1,15 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +

Are you sure that you want to delete this recommendation of +@product_name;noquote@ (to @user_class_description@)?

+ +
+@export_form_vars_html;noquote@ +
+ +
+
+ Index: openacs-4/packages/ecommerce/www/admin/products/recommendation-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation-delete.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/products/recommendation-delete.tcl 9 Mar 2004 00:59:51 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation-delete.tcl 16 Aug 2008 12:29:41 -0000 1.4 @@ -12,35 +12,19 @@ ad_require_permission [ad_conn package_id] admin +set title "Really Delete Product Recommendation?" +set context [list [list index Products] $title] + db_1row recommendation_select "select r.*, p.product_name from ec_product_recommendations r, ec_products p where recommendation_id=:recommendation_id and r.product_id=p.product_id" if { ![empty_string_p $user_class_id] } { - set user_class_description "to [db_string user_class_name_select "select user_class_name from ec_user_classes where user_class_id=:user_class_id"]" + set user_class_description "[db_string user_class_name_select "select user_class_name from ec_user_classes where user_class_id=:user_class_id"]" } else { - set user_class_description "to all users" + set user_class_description "all users" } +set export_form_vars_html [export_form_vars recommendation_id] -doc_return 200 text/html "[ad_admin_header "Really Delete Product Recommendation?"] - -

Confirm

- -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "recommendations.tcl" "Recommendations"] [list "recommendation.tcl?[export_url_vars recommendation_id]" "One"] "Confirm Deletion"] - -
- -Are you sure that you want to delete this recommendation of -$product_name ($user_class_description)? - -
-
-[export_form_vars recommendation_id] - -
-
- -[ad_admin_footer] -" Index: openacs-4/packages/ecommerce/www/admin/products/recommendation-text-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation-text-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation-text-edit.adp 16 Aug 2008 12:29:41 -0000 1.1 @@ -0,0 +1,19 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +

Edit text for the recommendation of $product_name:

+ +
+@export_form_vars_html;noquote@ + +
+
+ +
+
+ + Index: openacs-4/packages/ecommerce/www/admin/products/recommendation-text-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation-text-edit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/products/recommendation-text-edit.tcl 9 Mar 2004 00:59:51 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation-text-edit.tcl 16 Aug 2008 12:29:41 -0000 1.4 @@ -12,35 +12,13 @@ ad_require_permission [ad_conn package_id] admin +set title "Edit Product Recommendation Text" +set context [list [list index Products] $title] + db_1row recommendation_select "select r.*, p.product_name from ec_product_recommendations r, ec_products p where recommendation_id=$recommendation_id - and r.product_id=p.product_id" - -doc_return 200 text/html "[ad_admin_header "Edit Product Recommendation Text"] +set export_form_vars_html [export_form_vars recommendation_id] -

Edit Recommendation Text

- -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "recommendations.tcl" "Recommendations"] [list "recommendation.tcl?[export_url_vars recommendation_id]" "One"] "Edit Recommendation"] - -
- -Edit text for the recommendation of $product_name: - -
-
-[export_form_vars recommendation_id] - -

-

- - -
-
- -[ad_admin_footer] -" Index: openacs-4/packages/ecommerce/www/admin/products/recommendation.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation.adp 16 Aug 2008 12:29:41 -0000 1.1 @@ -0,0 +1,32 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ + + + + + + + + + + + + + + + + + +
Product:@product_name;noquote@
Recommended For:@user_class_name_select_html;noquote@
Display Recommendation In:@category_level_html;noquote@
Accompanying Text
(HTML format):
@recommendation_text@ +
+(edit) +
+ + + Index: openacs-4/packages/ecommerce/www/admin/products/recommendation.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/products/recommendation.tcl 9 Mar 2004 00:59:51 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation.tcl 16 Aug 2008 12:29:41 -0000 1.4 @@ -17,54 +17,24 @@ where recommendation_id=:recommendation_id and r.product_id=p.product_id" -doc_body_append "[ad_admin_header "Product Recommendation"] +set title "Product Recommendation" +set context [list [list index Products] $title] -

Product Recommendation

-[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "recommendations.tcl" "Recommendations"] "One"] - -
- -
- - - - - - - - -" if { ![empty_string_p $user_class_id] } { - doc_body_append " - " + set user_class_name_select_html "[db_string user_class_name_select "select user_class_name from ec_user_classes where user_class_id=:user_class_id"]" } else { - doc_body_append " - " + set user_class_name_select_html "All Users" } -doc_body_append " - - -" + if { [empty_string_p $the_category_id] && [empty_string_p $the_subcategory_id] && [empty_string_p $the_subsubcategory_id] } { - doc_body_append "" + set category_level_html "Top Level" } else { - doc_body_append "" + set category_level_html "[ec_category_subcategory_and_subsubcategory_display $the_category_id $the_subcategory_id $the_subsubcategory_id]" } -doc_body_append " - - - - -
Product:$product_name
Recommended For:[db_string user_class_name_select "select user_class_name from ec_user_classes where user_class_id=:user_class_id"]All Users
Display Recommendation In:Top Level[ec_category_subcategory_and_subsubcategory_display $the_category_id $the_subcategory_id $the_subsubcategory_id]
Accompanying Text
(HTML format):
$recommendation_text -

-(edit) -

+set export_url_rec_html [export_url_vars recommendation_id] -
-" - # Set audit variables # audit_name, audit_id, audit_id_column, return_url, audit_tables, main_tables set audit_name Recommendation @@ -74,15 +44,5 @@ set audit_tables [list ec_product_recommend_audit] set main_tables [list ec_product_recommendations] -doc_body_append " -
    -
  • Audit Trail +set audit_url_html "[ec_url_concat [ec_url] /admin]/audit?[export_url_vars audit_name audit_id audit_id_column return_url audit_tables main_tables]" -

    - -

  • Delete - -
- -[ad_admin_footer] -" Index: openacs-4/packages/ecommerce/www/admin/products/recommendations.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendations.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/recommendations.adp 16 Aug 2008 12:29:41 -0000 1.1 @@ -0,0 +1,30 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +

Currently Recommended Products

+

+These products show up when the customer is browsing the site, either on the +home page (if a product is recommended at the top level), or when the +customer is browsing categories, subcategories, or subsubcategories. +

+You can also associate product recommendations with a user class if you +only want people in that user class to see a given recommendation. +

+
    +@moby_string;noquote@ +
+ +

Add a Recommendation

+ +
+

Search for a product to recommend:

+ + +
+ +

Options

+ Index: openacs-4/packages/ecommerce/www/admin/products/recommendations.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendations.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/products/recommendations.tcl 9 Mar 2004 00:59:51 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/products/recommendations.tcl 16 Aug 2008 12:29:41 -0000 1.4 @@ -11,44 +11,18 @@ ad_require_permission [ad_conn package_id] admin -doc_body_append "[ad_admin_header "Product Recommendations"] +set title "Product Recommendations" +set context [list [list index Products] $title] -

Product Recommendations

- -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] "Recommendations"] - -
- -

Currently Recommended Products

- -These products show up when the customer is browsing the site, either on the -home page (if a product is recommended at the top level), or when the -customer is browsing categories, subcategories, or subsubcategories. - -

- -You can also associate product recommendations with a user classs if you -only want people in that user class to see a given recommendation. - -

    - -" - # For Audit tables set table_names_and_id_column [list ec_product_recommendations ec_product_recommend_audit product_id] - - -set last_category "" -set last_subcategory "" -set last_subsubcategory "" -set subcat_ul_open_p 0 -set subsubcat_ul_open_p 0 - +set the_category_name "" +set the_subcategory_name "" +set the_subsubcategory_name "" set moby_string "" -db_foreach recommendations_select " -select +db_foreach recommendations_select "select r.recommendation_id, r.the_category_name, r.the_subcategory_name, r.the_subsubcategory_name, p.product_name, c.user_class_name @@ -57,68 +31,21 @@ and r.user_class_id = c.user_class_id(+) and r.product_id = p.product_id order by decode(the_category_name,NULL,0,1), upper(the_category_name), upper(the_subcategory_name), upper(the_subsubcategory_name)" { - if { $the_category_name != $last_category } { - append moby_string "

    $the_category_name

    \n" - set last_category $the_category_name - set last_subcategory "" - set last_subsubcategory "" + if { [string length $the_category_name] > 0 } { + append the_category_name " > " } - if { $the_subcategory_name != $last_subcategory } { - if $subsubcat_ul_open_p { - append moby_string "
" - set subsubcat_ul_open_p 0 - } - if $subcat_ul_open_p { - append moby_string "" - set subcat_ul_open_p 0 - } - append moby_string "
    $the_subcategory_name
    \n" - set last_subcategory $the_subcategory_name - set last_subsubcategory "" - set subcat_ul_open_p 1 + if { [string length $the_subcategory_name] > 0 } { + append the_subcategory_name " > " } - if { $the_subsubcategory_name != $last_subsubcategory } { - if $subsubcat_ul_open_p { - append moby_string "
" - set subsubcat_ul_open_p 0 - } - append moby_string "
    $the_subsubcategory_name
    " - set last_subsubcategory $ - set subsubcat_ul_open_p 1 + if { [string length $the_subsubcategory_name] > 0 } { + append the_subsubcategory_name " > " } - append moby_string "
  • $product_name [ec_decode $user_class_name "" "" "($user_class_name)"]\n" -} -if $subsubcat_ul_open_p { - append moby_string "
" - set subsubcat_ul_open_p 0 + append moby_string "
  • $the_category_name $the_subcategory_name $the_subsubcategory_name $product_name [ec_decode $user_class_name "" "" "($user_class_name)"]
  • \n" + set the_category_name "" + set the_subcategory_name "" + set the_subsubcategory_name "" } -if $subcat_ul_open_p { - append moby_string "" - set subcat_ul_open_p 0 -} -doc_body_append " +set audit_url_html "[ec_url_concat [ec_url] /admin]/audit-tables?[export_url_vars table_names_and_id_column]" -$moby_string - - - -

    Add a Recommendation

    - -
    - -
    -Search for a product to recommend: - - -
    - -

    Options

    - -[ad_admin_footer] -"