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 -N -r1.14 -r1.15 --- openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl 23 Jul 2005 15:07:37 -0000 1.14 +++ openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl 25 Jul 2005 13:23:56 -0000 1.15 @@ -525,3 +525,36 @@ }]]] } + +ad_proc -public dotlrn_ecommerce::section::waiting_list_number { + user_id + community_id +} { + Return number in waiting list + + @author Roel Canicula (roelmc@pldtdsl.net) + @creation-date 2005-07-25 + + @param user_id + + @param community_id + + @return + + @error +} { + return [db_string waitin_list_number { + select count(*) + from (select * + from dotlrn_member_rels_full rr, + acs_objects o + where rr.rel_id = o.object_id + and rr.rel_id <= (select rel_id + from dotlrn_member_rels_full + where community_id = :community_id + and user_id = :user_id) + and rr.community_id = :community_id + and rr.member_state = 'needs approval' + order by o.creation_date) r + } -default ""] +}