Index: openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl 16 Jul 2005 12:51:06 -0000 1.2 +++ openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl 19 Jul 2005 18:15:09 -0000 1.3 @@ -29,6 +29,9 @@ prereq { set member_state "request approval" } + payment { + set member_state "awaiting payment" + } } if {[catch {set rel_id [relation_add \ @@ -79,14 +82,35 @@ } } -set section_id [db_string section { - select section_id +db_1row section { + select section_id, product_id from dotlrn_ecommerce_section where community_id = :community_id -}] +} dotlrn_ecommerce::section::flush_cache $section_id +if { [db_0or1row get_assessment { + select c.assessment_id + + from dotlrn_ecommerce_section s, + dotlrn_catalogi c, + cr_items i + + where s.course_id = c.item_id + and c.item_id = i.item_id + and i.live_revision = c.course_id + and s.product_id = :product_id + + limit 1 +}] } { + if { ! [empty_string_p $assessment_id] && $assessment_id != -1 } { + ad_returnredirect [export_vars -base "[apm_package_url_from_id [parameter::get -parameter AssessmentPackage]]assessment" { assessment_id { return_url $next_url } }] + ad_script_abort + + } +} + # Redirect to application assessment if exists set assessment_id [parameter::get -parameter ApplicationAssessment -default ""]