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.3 -r1.4 --- openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl 9 Jun 2005 05:54:38 -0000 1.3 +++ openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl 19 Jun 2005 06:05:06 -0000 1.4 @@ -215,8 +215,8 @@ # } set filters [linsert $filters 0 view { - label "[_ dotlrn-ecommerce.View]" - values { {"" ""} {Calendar "calendar"} } + label "[_ dotlrn-ecommerce.View]" + values { {Calendar "calendar"} } }] set cc_package_id [apm_package_id_from_key "dotlrn-catalog"] @@ -246,7 +246,7 @@ label "[_ dotlrn-catalog.course_key]" display_template {
- @course_list.course_key@ + @course_list.course_key@
} hide_p 1 @@ -255,27 +255,38 @@ label "[_ dotlrn-catalog.course_name]" display_template {
- @course_list.course_name@ + @course_list.course_name@
} hide_p 1 } + spacing { + label "" + display_template { + } + html { width 10% bgcolor=white } + } section_name { label "" + display_template { - + - Section @course_list.section_name@ + Section: @course_list.section_name@ Section @course_list.section_name@ + (@course_list.section_grades@)
@course_list.sessions;noquote@

@course_list.instructors;noquote@

@course_list.prices;noquote@
+
@course_list.attendees;noquote@ participants + ,
@course_list.available_slots;noquote@ available
+ } - html { width 50% } + html { width 40% } } category { label "[_ dotlrn-catalog.category]" @@ -294,6 +305,7 @@ actions { label "" display_template { + [_ dotlrn-ecommerce.add_to_cart] @@ -303,7 +315,7 @@
} - html { width 50% nowrap } + html { width 40% nowrap } } } -orderby { course_name { @@ -315,21 +327,19 @@ values { { { [_ dotlrn-ecommerce.info] [_ dotlrn-ecommerce.edit] [_ dotlrn-ecommerce.add_section]
@course_list.course_grades@ -
+

@course_list.course_info;noquote@ -

} +

+ + } { {groupby course_name} {orderby course_name} } } } } -set grade_tree_id [db_string grade_tree { - select tree_id - from category_tree_translations - where name = 'Grade' -} -default 0] +set grade_tree_id [parameter::get -package_id [ad_conn package_id] -parameter GradeCategoryTree -default 0] -db_multirow -extend { category_name community_url course_edit_url section_add_url section_edit_url course_grades section_grades sections_url member_p sessions instructors prices shopping_cart_add_url } course_list get_courses { } { +db_multirow -extend { category_name community_url course_edit_url section_add_url section_edit_url course_grades section_grades sections_url member_p sessions instructors prices shopping_cart_add_url attendees available_slots } course_list get_courses { } { # set mapped [category::get_mapped_categories $course_id] # foreach element $mapped { @@ -402,6 +412,18 @@ if { ! [empty_string_p $instructors] && $member_p } { append instructors " [_ dotlrn-ecommerce.view_bios]" } + + db_1row attendees { + select count(*) as attendees + from dotlrn_member_rels_approved + where community_id = :community_id + and (rel_type = 'dotlrn_member_rel' + or rel_type = 'dotlrn_club_student_rel') + } + + if { ! [empty_string_p $maxparticipants] } { + set available_slots [expr $maxparticipants - $attendees] + } } if { ! [empty_string_p $product_id] } {