Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 3 Oct 2002 17:31:35 -0000 1.19 +++ openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 28 Aug 2003 09:41:53 -0000 1.20 @@ -367,46 +367,25 @@ } } -# returns a link for the user to add him/herself to the mailing list for whatever category/ -# subcategory/subsubcategory a product is in. -# If the product is multiply categorized, this will just use the first categorization that -# Oracle finds for this product. ad_proc ec_mailing_list_link_for_a_product { product_id } { -returns a link for the user to add him/herself to the mailing list for whatever category/subcategory/subsubcategory a product is in. -If the product is multiply categorized, this will just use the first categorization that Oracle finds for this product. + + Returns a link for the user to add him/herself to the mailing + list for whatever category/subcategory/subsubcategory a product + is in. If the product is multiply categorized, this will just + use the first categorization that the DB finds for this product. + } { set category_id "" set subcategory_id "" set subsubcategory_id "" - db_foreach category_id_select { - select category_id from ec_category_product_map where product_id = :product_id - } { - - db_foreach subcategory_id_select { - select s.subcategory_id - from ec_subcategory_product_map m, - ec_subcategories s - where m.subcategory_id = s.subcategory_id - and s.category_id = :category_id - and m.product_id = :product_id - } { - - db_foreach subsubcategory_id_select { - select ss.subsubcategory_id - from ec_subsubcategory_product_map m, - ec_subsubcategories ss - where m.subsubcategory_id = ss.subsubcategory_id - and ss.subcategory_id = :subcategory_id - and m.product_id = :product_id - } { } - } - } + set common_sql [db_map mailing_categories_common] + db_0or1row mailing_categories {} if { ![empty_string_p $category_id] || ![empty_string_p $subcategory_id] || ![empty_string_p $subsubcategory_id] } { - return "Add yourself to the [ec_full_categorization_display $category_id $subcategory_id $subsubcategory_id] mailing list!" + return "Add yourself to the [ec_full_categorization_display $category_id $subcategory_id $subsubcategory_id] mailing list!" } else { - return "" + return "" } } @@ -563,7 +542,8 @@ $end_of_comment_query " { - append comments_to_print "$email rated this product [ec_display_rating $rating] on $last_modified_pretty and wrote:
+ array set person [person::get -person_id $user_id] + append comments_to_print "$person(first_names) $person(last_name) rated this product [ec_display_rating $rating] on $last_modified_pretty and wrote:
$one_line_summary
$user_comment