Index: openacs-4/packages/dotlrn-ecommerce/tcl/course-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/course-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn-ecommerce/tcl/course-procs.tcl 13 Sep 2005 15:00:05 -0000 1.12 +++ openacs-4/packages/dotlrn-ecommerce/tcl/course-procs.tcl 21 Sep 2005 01:24:24 -0000 1.13 @@ -99,6 +99,7 @@ "prereq approval" dotlrn-ecommerce.Application_prereq_approved \ "waitinglist approved" dotlrn-ecommerce.lt_A_space_has_opened_up \ "prereq reject" dotlrn-ecommerce.Application_prereq_rejected \ + "application reject" dotlrn-ecommerce.Application_rejected \ "needs approval" dotlrn-ecommerce.lt_Added_to_waiting_list \ "request approval" dotlrn-ecommerce.lt_Requested_waiver_of_prereq] \ $type] @@ -113,6 +114,7 @@ "waitinglist approved" dotlrn-ecommerce.lt_A_space_has_opened_up_1 \ "prereq approval" dotlrn-ecommercel.lt_Your_prereq_approved \ "prereq reject" dotlrn-ecommerce.lt_Your_prereq_rejected \ + "application reject" dotlrn-ecommerce.lt_Your_application_to_j_1 \ "needs approval" dotlrn-ecommerce.lt_Added_to_waiting_list_1 \ "request approval" dotlrn-ecommerce.lt_Requested_waiver_of_prereq_1] \ $type] @@ -136,7 +138,8 @@ "on join" "Welcome message" \ "waitinglist approved" "Grant spot from waiting list" \ "prereq approval" "Approve waiver of prerequisites" \ - "prereq reject" "Reject waiver of prerequitsites" \ + "prereq reject" "Reject waiver of prerequitsites" + "application reject" "Reject application" \ "needs approval" "Added to waiting list / Application Submitted" \ "request approval" "Application for waiver of prerequisites submitted"] $type] -} \ No newline at end of file +} 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.26 -r1.27 --- openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl 6 Sep 2005 18:03:44 -0000 1.26 +++ openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl 21 Sep 2005 01:24:24 -0000 1.27 @@ -337,7 +337,7 @@ # check if this is a dotlrn-ecommerce community, if not, bail if {![db_string is_section "select 1 from dotlrn_ecommerce_section where community_id=:community_id" -default 0]} { # this return code tells the caller to ignore the results of this callback implementation - ns_log notice "DAVEB: email_var_list Skipping default email for dotlrn-ecommerce, not in a section community" + ns_log debug "DAVEB: email_var_list Skipping default email for dotlrn-ecommerce, not in a section community" return -code continue } #FIXME depend on email type?? @@ -394,15 +394,50 @@ } set var_list(instructor_names) $instructor_names } -ns_log notice "DAVEB email var list '[array get var_list]'" + # get categories mapped to section + + +set course_id [db_string get_course_id "select course_id from dotlrn_ecommerce_section where community_id=:community_id" -default ""] +set package_id [db_string get_package_id "select package_id from acs_objects where object_id=:course_id" -default ""] +ns_log notice "DAVEB package_id='${package_id}'" +if {![string equal "" $package_id]} { + set trees [category_tree::get_mapped_trees $package_id] + ns_log notice "DAVEB \n trees='${trees}'" + foreach tree $trees { + foreach {tree_id tree_name subtree_cat_id assign_single_p require_category_p} $tree break + set mapped_cats [category::get_mapped_categories -tree_id $tree_id $community_id] + set mapped_cat_names [category::get_names $mapped_cats] + set tree_var_name [util_text_to_url -text ${tree_name}] + set var_list($tree_var_name) $mapped_cat_names + ns_log notice "DAVEB \n trees='${trees}' tree_id='${tree_id}' \n community_id='${community_id}'\nmapped_cats='${mapped_cats}'\n tree_name='${tree_name}'\n mapped_cat_names '${mapped_cat_names}'" + } +} + +ns_log notice "DAVEB email var list '[array get var_list]'" return [array get var_list] } ad_proc -callback dotlrn::member_email_available_vars -impl dotlrn-ecommerce {} { List variables avaiable for this template } { #FIXME depend on email type?? - return [list "%first_name%" "Participant's First Name" "%last_name%" "Participant's Last Name" "%full_name%" "Participant's Full Name" "%sessions%" "Dates and times of sessions" "%community_name%" "Name of section" "%community_url%" "URL of the section page in the form http://example.com/" "%community_link%" "HTML link to section, ie: <a href=\"http://example.com\">%community_name%</a>" "%instructor_names%" "List of instructors names"] + # get categories mapped to section? + + set available_vars [list "%first_name%" "Participant's First Name" "%last_name%" "Participant's Last Name" "%full_name%" "Participant's Full Name" "%sessions%" "Dates and times of sessions" "%community_name%" "Name of section" "%community_url%" "URL of the section page in the form http://example.com/" "%community_link%" "HTML link to section, ie: <a href=\"http://example.com\">%community_name%</a>" "%instructor_names%" "List of instructors names"] + if {[exists_and_not_null community_id]} { + set course_id [db_string get_course_id "select course_id from dotlrn_ecommerce_section where community_id=:community_id" -default ""] + set package_id [db_string get_package_id "select package_id from acs_objects where object_id=:course_id" -default ""] + if {![string equal "" $package_id]} { + set trees [category_tree::get_mapped_trees $package_id] + + foreach tree $trees { + foreach {tree_id tree_name subtree_cat_id assign_single_p require_category_p} $tree break + lappend available_vars "%[util_text_to_url -text ${tree_name}]%" $tree_name + } + } + + } + return $available_vars }