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.51 -r1.52
--- openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl 3 Sep 2005 08:26:26 -0000 1.51
+++ openacs-4/packages/dotlrn-ecommerce/lib/tree-chunk.tcl 6 Sep 2005 01:12:10 -0000 1.52
@@ -402,30 +402,31 @@
[_ dotlrn-ecommerce.edit]
- [_ dotlrn-ecommerce.application_pending]
+ [_ dotlrn-ecommerce.application_pending]
- [_ dotlrn-ecommerce.lt_You_are_number_course]
+ [_ dotlrn-ecommerce.lt_You_are_number_course]
[_ dotlrn-ecommerce.review_application]
- [_ dotlrn-ecommerce.awaiting_approval]
+ [_ dotlrn-ecommerce.awaiting_approval]
- [_ dotlrn-ecommerce.view_applications]
+ [_ dotlrn-ecommerce.view_applications]
+
-
- [_ dotlrn-ecommerce.lt_Your_application_was_]
-
-
- A place is now available.
-
+
+ [_ dotlrn-ecommerce.lt_Your_application_was_]
+
+
+ A place is now available.
+
@@ -442,6 +443,10 @@
+
+
+ @course_list.patron_message;noquote@
+
}
html { width 40% valign middle nowrap }
}
@@ -473,7 +478,7 @@
set discount_clause ""
}
-db_multirow -extend {member_state 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 assessment_id } course_list get_courses { } {
+db_multirow -extend {patron_message member_state 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 assessment_id } course_list get_courses { } {
# Since dotlrn-ecommerce is based on dotlrn-catalog,
# it's possible to have a dotlrn_catalog object without an
@@ -518,7 +523,7 @@
}
}
- set registration_approved_url [export_vars -base ecommerce/shopping-cart-add { user_id product_id }]
+ set registration_approved_url [export_vars -base ecommerce/shopping-cart-add { user_id product_id}]
set member_p [dotlrn_community::member_p $community_id $user_id]
@@ -684,6 +689,47 @@
}
}
+ # The above was the users waiting list and applications
+ # Get the patron information
+
+ set patron_message ""
+ # get waiting list requests
+ db_multirow -extend {waiting_list_number} waiting_lists waiting_lists {
+ select r.user_id as participant_id,
+ acs_object__name(r.user_id) as name, r.member_state
+ from
+ dotlrn_member_rels_full r,
+ acs_objects o
+ where o.object_id = r.rel_id
+ and r.community_id = :community_id
+ and r.member_state in ('request approval', 'request approved', 'needs approval', 'waitinglist approved')
+ and o.creation_user=:user_id
+ and r.user_id <> o.creation_user
+ } {
+
+ set waiting_list_number [util_memoize [list dotlrn_ecommerce::section::waiting_list_number $participant_id $community_id] $memoize_max_age]
+
+ set registration_approved_url [export_vars -base ecommerce/shopping-cart-add { user_id product_id participant_id}]
+
+ switch $member_state {
+ "request approval" {
+ append patron_message "$name has a prerequisite application pending."
+ }
+ "request approved" {
+ append patron_message "$name has been accepted.
+ [_ dotlrn-ecommerce.lt_Continue_Registration]"
+
+ }
+ "needs approval" {
+ append patron_message "$name is number $waiting_list_number on waiting list"
+ }
+ "waitinglist approved" {
+ append patron_message "There is a place for $name.
[_ dotlrn-ecommerce.lt_Continue_Registration]"
+ }
+ }
+ }
+
+
# HAM : if we don't have an instructor id
set instructor_p -1
if { [exists_and_not_null instructor_ids] } {