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 {
} hide_p 1 @@ -255,27 +255,38 @@ label "[_ dotlrn-catalog.course_name]" display_template {+} +@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] } {