Changeset 788 for WAeUP_SRP/trunk/skins/waeup_student/application_edit.py
- Timestamp:
- 8 Nov 2006, 08:32:36 (18 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/application_edit.py
r784 r788 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters=REQUEST, cluster=None, cpsdocument_edit_and_view_button=None, action=None7 ##parameters=REQUEST,proceed=None, cpsdocument_edit_button=None, action=None 8 8 ##title= 9 9 # $Id$ … … 17 17 18 18 # Until ajax posts directly to its own script... 19 if 'ajax_edit' in REQUEST.form:20 return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster)19 ##if 'ajax_edit' in REQUEST.form: 20 ## return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster) 21 21 22 22 # Check flexible controls … … 33 33 clear_doc = info['clear_doc'] 34 34 state = context.getStudentInfo()['review_state'] 35 36 if context.portal_type == "Student": 37 if app_doc.passport is None: 38 is_valid, ds = app_doc.validate(request=REQUEST, 39 proxy=app_doc, 40 layout_id = "student_application_fe", 41 layout_mode = 'edit', 42 use_session=True) 43 action = "/application_edit" 44 if is_valid: 45 if app_doc.passport is not None: 46 psm = 'You successfully uploaded your passport image.' 47 args = {'apply_button': 'Apply',} 48 else: 49 psm = "You didn't upload a passport image." 50 args = {} 51 else: 52 psm = 'psm_content_error' 53 args = getFormUidUrlArg(REQUEST) 54 elif 'apply_admission' not in REQUEST.form: 55 is_valid, ds = app_doc.validate(request=REQUEST, 56 proxy=app_doc, 57 layout_id = "student_application_fe", 58 layout_mode = 'edit', 59 use_session=True) 60 action = "/application_edit" 61 if is_valid: 62 args = {} 63 if 'apply_admission' not in REQUEST.form: 64 args = {'apply_button': 'Apply',} 65 psm = 'You successfully uploaded your passport image.' 66 else: 67 psm = 'You applied for admission.' 68 else: 69 args = getFormUidUrlArg(REQUEST) 70 psm = 'psm_content_error' 71 else: 72 psm = '' 73 args = {} 74 if info['review_state'] == "student_created": 75 student.content_status_modify(workflow_action="apply_for_admission") 76 wftool.doActionFor(app,'close',dest_container= app) 77 psm = 'You applied for admission.' 78 action = "/application_view" 79 elif info['review_state'] == "admitted": 80 student.content_status_modify(workflow_action="enter_clearance_pin") 81 #wftool.doActionFor(info['clear'],'open',dest_container=info['clear']) 82 app_doc = info['app_doc'] 83 dc = {} 84 dc['email'] = app_doc.app_email 85 info['clear_doc'].edit(mapping = dc) 86 wftool.doActionFor(app,'close',dest_container= app) 87 psm = 'You successfully started the clearance process.' 88 action = "/clearance_edit" 89 else: 90 action = "/clearance_view" 91 92 else: 93 is_valid, ds = app_doc.validate(request=REQUEST, proxy=context, cluster=cluster, 35 is_valid, ds = app_doc.validate(request=REQUEST, 36 schema_id = 'student_application', 37 layout_id = 'student_application_fe', 38 proxy=app, 94 39 use_session=True) 95 40 96 if action is None: 97 ti = app.getTypeInfo() 98 action = ti.queryMethodID('edit', 'cpsdocument_edit_form') 99 action = '/' + action 100 41 psm = "" 42 args = {} 43 action = "/application_edit_view" 44 if cpsdocument_edit_button: 101 45 if is_valid: 102 comments = REQUEST.get('comments') 103 context.cpsdocument_notify_modification(comments=comments) 104 if cpsdocument_edit_and_view_button is not None: 105 action = '' 106 psm = 'psm_content_changed' 107 args = {} 46 if app_doc.passport is not None: 47 args['proceed'] = 'Continue to Clearance' 48 psm = 'You successfully uploaded your passport image.' 49 else: 50 psm = "You didn't upload a passport image." 51 elif proceed: 52 if is_valid: 53 action = "/request_clearance" 108 54 else: 109 55 psm = 'psm_content_error' 110 args = getFormUidUrlArg(REQUEST)111 112 56 args['portal_status_message'] = psm 113 url = context.absolute_url() + action + '?' + urlencode(args)57 url = app.absolute_url() + action + '?' + urlencode(args) 114 58 REQUEST.RESPONSE.redirect(url)
Note: See TracChangeset for help on using the changeset viewer.