[777] | 1 | ##parameters=REQUEST |
---|
[805] | 2 | # $Id: display_pume_result.py 892 2006-11-18 21:14:18Z henrik $ |
---|
[777] | 3 | """ |
---|
| 4 | process the Application Form |
---|
| 5 | return html renderer + psm |
---|
| 6 | """ |
---|
| 7 | import DateTime |
---|
| 8 | current = DateTime.DateTime() |
---|
| 9 | pr = context.portal_registration |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | type_name = 'StudentApplication' |
---|
| 13 | ti = context.portal_types[type_name] |
---|
| 14 | REQUEST.set('type_name',type_name) |
---|
| 15 | |
---|
| 16 | validate = REQUEST.has_key("cpsdocument_create_button") |
---|
| 17 | |
---|
| 18 | lt = context.portal_layouts |
---|
| 19 | pr = context.portal_registration |
---|
| 20 | |
---|
| 21 | res,psm,ds = lt.renderLayout(layout_id= 'student_application_search', |
---|
| 22 | schema_id= 'student_application', |
---|
| 23 | context=context, |
---|
| 24 | mapping=validate and REQUEST, |
---|
| 25 | ob={}, |
---|
| 26 | layout_mode='create', |
---|
[778] | 27 | formaction = "display_pume_result", |
---|
[781] | 28 | button = "Search", |
---|
[777] | 29 | ) |
---|
| 30 | if psm == 'invalid': |
---|
| 31 | return context.display_pume_result_form(rendered = res, |
---|
[892] | 32 | psm = "Please correct your input!", |
---|
[777] | 33 | #psm = "%s, %s" % (psm,ds), |
---|
| 34 | firstlayout = True, |
---|
| 35 | lastlayout = True, |
---|
| 36 | ds = ds, |
---|
| 37 | ) |
---|
| 38 | elif psm == '': |
---|
| 39 | return context.display_pume_result_form(rendered = res, |
---|
| 40 | psm = None, |
---|
| 41 | firstlayout = True, |
---|
| 42 | lastlayout = True, |
---|
| 43 | ds = ds, |
---|
| 44 | ) |
---|
| 45 | elif psm == 'valid': |
---|
[779] | 46 | url = "%s/campus/students/%s/pume/pume_anon_view" % (context.portal_url(),ds['s_id']) |
---|
[777] | 47 | return REQUEST.RESPONSE.redirect(url) |
---|
| 48 | |
---|
[779] | 49 | |
---|
[777] | 50 | return |
---|
| 51 | |
---|
| 52 | |
---|