Index: openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl,v
diff -u -r1.39 -r1.40
--- openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl 4 Aug 2005 03:10:04 -0000 1.39
+++ openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl 5 Aug 2005 12:03:50 -0000 1.40
@@ -307,6 +307,7 @@
(@course_list.section_grades@)
@course_list.sessions;noquote@
+
@course_list.section_zones;noquote@
@course_list.instructor_names;noquote@
@course_list.prices;noquote@
@@ -405,7 +406,7 @@
set grade_tree_id [parameter::get -package_id [ad_conn package_id] -parameter GradeCategoryTree -default 0]
-db_multirow -extend { fs_chunk section_folder_id section_pages_url category_name community_url course_edit_url section_add_url section_edit_url course_grades section_grades sections_url member_p sessions instructor_names prices shopping_cart_add_url attendees available_slots pending_p waiting_p approved_p instructor_p registration_approved_url button waiting_list_number asm_url } course_list get_courses { } {
+db_multirow -extend { fs_chunk section_folder_id section_pages_url category_name community_url course_edit_url section_add_url section_edit_url course_grades section_grades section_zones sections_url member_p sessions instructor_names prices shopping_cart_add_url attendees available_slots pending_p waiting_p approved_p instructor_p registration_approved_url button waiting_list_number asm_url } course_list get_courses { } {
# Since dotlrn-ecommerce is based on dotlrn-catalog,
# it's possible to have a dotlrn_catalog object without an
@@ -528,6 +529,16 @@
set button "[_ dotlrn-ecommerce.join_waiting_list]"
}
}
+
+ set section_zones [util_memoize [list dotlrn_ecommerce::section::section_zones $community_id]]
+
+ if { [llength $section_zones] == 1 } {
+ set section_zones "[_ dotlrn-ecommerce.Zone]: [join $section_zones]"
+ } elseif { [llength $section_zones] > 1 } {
+ set section_zones "[_ dotlrn-ecommerce.Zones]: [join $section_zones ,]"
+ } else {
+ set section_zones ""
+ }
}
if { ! [empty_string_p $product_id] } {
Index: openacs-4/packages/dotlrn-ecommerce/tcl/section-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/section-procs-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/dotlrn-ecommerce/tcl/section-procs-postgresql.xql 16 Jul 2005 12:51:06 -0000 1.2
+++ openacs-4/packages/dotlrn-ecommerce/tcl/section-procs-postgresql.xql 5 Aug 2005 12:03:50 -0000 1.3
@@ -60,4 +60,14 @@
+
+
+ select t.name
+ from category_object_map_tree m, category_translations t
+ where t.category_id = m.category_id
+ and t.locale = coalesce(:locale, 'en_US')
+ and m.object_id = :community_id
+ and m.tree_id = :zone_tree_id
+
+
Index: openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl,v
diff -u -r1.17 -r1.18
--- openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl 26 Jul 2005 23:11:22 -0000 1.17
+++ openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl 5 Aug 2005 12:03:50 -0000 1.18
@@ -177,6 +177,7 @@
util_memoize_flush [list dotlrn_ecommerce::section::price $section_id]
util_memoize_flush [list dotlrn_ecommerce::section::member_price $section_id]
util_memoize_flush [list dotlrn_ecommerce::section::application_assessment $section_id]
+ util_memoize_flush [list dotlrn_ecommerce::section::section_zones $community_id]
if { [exists_and_not_null user_id] } {
util_memoize_flush [list dotlrn_ecommerce::section::member_state $user_id $community_id]
@@ -583,3 +584,32 @@
order by o.creation_date) r
} -default ""]
}
+
+ad_proc -public dotlrn_ecommerce::section::section_zones {
+ community_id
+} {
+ Return zones
+
+ @author Roel Canicula (roelmc@pldtdsl.net)
+ @creation-date 2005-08-05
+
+ @param section_id
+
+ @return
+
+ @error
+} {
+ set locale [ad_conn locale]
+
+ if { [db_0or1row zone {
+ select tree_id as zone_tree_id
+ from category_tree_translations
+ where name = 'Zone'
+ and locale = :locale
+ limit 1
+ }] } {
+ return [db_list section_zones { }]
+ }
+
+ return [list]
+}