Index: openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl 23 Jun 2005 12:32:13 -0000 1.6
+++ openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl 1 Jul 2005 02:30:58 -0000 1.7
@@ -24,12 +24,13 @@
}
db_foreach items_in_order {
- select i.product_id, o.patron_id as saved_patron_id, o.participant_id, t.method
+ select i.product_id, o.patron_id as saved_patron_id, o.participant_id, t.method, v.maxparticipants
from dotlrn_ecommerce_orders o, ec_items i left join dotlrn_ecommerce_transactions t
- on (i.order_id = t.order_id)
+ on (i.order_id = t.order_id), ec_custom_product_field_values v
where i.item_id = o.item_id
+ and i.product_id = v.product_id
and i.order_id = :order_id
- group by i.product_id, o.patron_id, o.participant_id, t.method
+ group by i.product_id, o.patron_id, o.participant_id, t.method, v.maxparticipants
} {
if { [empty_string_p $participant_id] } {
if { [exists_and_not_null user_id] } {
@@ -73,7 +74,26 @@
if { [catch {
- if { [empty_string_p $method] || $method == "cc" } {
+ set waiting_list_p 0
+ if { ! [empty_string_p $maxparticipants] } {
+ 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 { $attendees >= $maxparticipants } {
+ set waiting_list_p 1
+ }
+ }
+
+ if { ! [empty_string_p $method] && $method != "cc" } {
+ set waiting_list_p 1
+ }
+
+ if { ! $waiting_list_p } {
dotlrn_community::add_user $community_id $user_id
} else {
dotlrn_community::add_user -member_state "needs approval" $community_id $user_id
@@ -111,4 +131,6 @@
}
}
}
+
+ ns_log notice "dotlrn-ecommerce callback: Run successfully"
}
\ No newline at end of file
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/application-reject.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/application-reject.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/application-reject.tcl 1 Jul 2005 02:30:58 -0000 1.1
@@ -0,0 +1,21 @@
+# packages/dotlrn-ecommerce/www/admin/application-reject.tcl
+
+ad_page_contract {
+
+
+
+ @author Roel Canicula (roelmc@pldtdsl.net)
+ @creation-date 2005-07-01
+ @arch-tag: 93f47ba6-c04e-419a-bcd6-60bb95553236
+ @cvs-id $Id: application-reject.tcl,v 1.1 2005/07/01 02:30:58 roelc Exp $
+} {
+ community_id:integer,notnull
+ user_id:integer,notnull
+} -properties {
+} -validate {
+} -errors {
+}
+
+dotlrn_community::membership_reject -community_id $community_id -user_id $user_id
+
+ad_returnredirect applications
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/applications.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/applications.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/dotlrn-ecommerce/www/admin/applications.tcl 23 Jun 2005 17:47:33 -0000 1.4
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/applications.tcl 1 Jul 2005 02:30:58 -0000 1.5
@@ -19,6 +19,7 @@
-name "applications" \
-multirow "applications" \
-no_data "No pending applications" \
+ -page_flush_p 1 \
-elements {
community_name {
label "Section"
@@ -45,18 +46,20 @@
label ""
display_template {
Approve
+ Reject
}
html { align center }
}
}
-db_multirow -extend { approve_url asm_url } applications applications {
+db_multirow -extend { approve_url reject_url asm_url } applications applications {
select pretty_name as community_name, person__name(user_id) as person_name, member_state, c.community_id, user_id
from dotlrn_member_rels_full r, dotlrn_communities_all c
where r.community_id = c.community_id
and member_state = 'needs approval'
} {
set approve_url [export_vars -base application-approve { community_id user_id }]
+ set reject_url [export_vars -base application-reject { community_id user_id }]
# Get associated assessment
if { [db_0or1row assessment {