Changeset 2159 for WAeUP_SRP/trunk
- Timestamp:
- 24 Aug 2007, 07:07:00 (17 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_student
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/apply_pume.py
r2146 r2159 22 22 logger = logging.getLogger('Skins.apply_pume') 23 23 24 mtool = context.portal_membership 25 member = mtool.getAuthenticatedMember() 26 24 27 current = DateTime.DateTime() 25 28 pr = context.portal_registration … … 33 36 edit = "edit" in request.keys() 34 37 slip = "slip" in request.keys() 38 manage = "manage" in request.keys() 35 39 submitted = False 36 40 mode = request.get('mode','') 37 41 if not mode: 38 if apply_pume or edit :42 if apply_pume or edit or manage: 39 43 mode = "edit" 40 44 else: 41 45 mode = "create" 42 validate = create or edit or apply_pume 46 validate = create or edit or apply_pume or manage 43 47 44 48 lt = context.portal_layouts … … 57 61 if object['status'] == "submitted": 58 62 submitted = True 59 if not create and pin != object['pin']:60 logger.info('%s entered wrong pin %s' % (reg_no,pin))63 if not create and (pin != object['pin'] and not context.isSectionOfficer()): 64 logger.info('%s/%s entered wrong pin %s' % (member,reg_no,pin)) 61 65 return request.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url()) 62 66 if slip: 63 67 mode = "view_slip" 64 logger.info('%s views application slip' % (reg_no))68 logger.info('%s/%s views application slip' % (member,reg_no)) 65 69 res,psm,ds = lt.renderLayout(layout_id= 'application', 66 70 schema_id= 'application', … … 105 109 mode = "view" 106 110 psm = "The form has already been submitted and you are not allowed to resubmit the data!" 107 logger.info('%s tried to resubmit application record' % (reg_no))111 logger.info('%s/%s tried to resubmit application record' % (member,reg_no)) 108 112 res,psm_dummy,ds_dummy = lt.renderLayout(layout_id= 'application', 109 113 schema_id= 'application', … … 114 118 commit = False, 115 119 ) 116 # elif not dm.get('passport'):117 # mode = "edit"118 # psm = "Please upload Passport Photograph!"119 # logger.info('%s tried to submit without uploading a passport foto' % (reg_no))120 120 elif not request.has_key('confirm'): 121 121 mode = "edit" 122 122 psm = "Please confirm Passport Photograph!" 123 logger.info('%s tried to submit without ticking confirmation check box' % (reg_no))123 logger.info('%s/%s tried to submit without ticking confirmation check box' % (member,reg_no)) 124 124 else: 125 125 mode = "view" … … 128 128 data['status'] = "submitted" 129 129 context.applicants_catalog.modifyRecord(**data) 130 logger.info('%s modified and submitted application record' % (reg_no))130 logger.info('%s/%s modified and submitted application record' % (member,reg_no)) 131 131 res,psm_dummy,ds = lt.renderLayout(layout_id= 'application', 132 132 schema_id= 'application', … … 140 140 if submitted: 141 141 mode = "view" 142 logger.info('%s views application record' % (reg_no))143 else: 144 mode = "edit" 145 logger.info('%s edits application record' % (reg_no))142 logger.info('%s/%s views application record' % (member,reg_no)) 143 else: 144 mode = "edit" 145 logger.info('%s/%s edits application record' % (member,reg_no)) 146 146 psm = "" 147 147 #set_trace() … … 159 159 mode = "view" 160 160 psm = "The form has already been submitted and you are not allowed to modify the data!" 161 logger.info('%s tried to edit submitted application record' % (reg_no))161 logger.info('%s/%s tried to edit submitted application record' % (member,reg_no)) 162 162 res,psm_dummy,ds_dummy = lt.renderLayout(layout_id= 'application', 163 163 schema_id= 'application', … … 173 173 data['status'] = "edited" 174 174 context.applicants_catalog.modifyRecord(**data) 175 logger.info('%s modified application record' % (reg_no)) 176 175 logger.info('%s/%s modified application record' % (member,reg_no)) 176 177 elif manage: 178 if submitted: 179 mode = "view" 180 psm = "You are now assuming the applicant's role!" 181 logger.info('%s/%s entered application record' % (member,reg_no)) 182 res,psm_dummy,ds_dummy = lt.renderLayout(layout_id= 'application', 183 schema_id= 'application', 184 layout_mode = mode, 185 context=context, 186 mapping={}, 187 ob=object, 188 commit = False, 189 ) 190 else: 191 mode = "edit" 192 psm = "You are now assuming the applicant's role!" 193 logger.info('%s/%s entered application record' % (member,reg_no)) 194 195 177 196 178 197 return context.apply_pume_form(rendered = res, -
WAeUP_SRP/trunk/skins/waeup_student/apply_pume_manage_form.pt
r2157 r2159 7 7 <metal:block define-macro="edit_form"> 8 8 <metal:block use-macro="here/main_template/macros/master"> 9 <metal:block fill-slot="main" 10 tal:define="info_applicants context/getApplicantsStatistics"> 9 <metal:block fill-slot="main"> 11 10 12 11 <form action="" id="editForm" method="post" … … 19 18 <br /> 20 19 21 <table >20 <table tal:define="info_applicants context/getApplicantsStatistics"> 22 21 <tr> 23 22 <td>Number of records viewed:</td> … … 55 54 /> 56 55 <br /><br /> 57 56 58 57 59 58 <div class="label">Registration No:</div> … … 66 65 </span> 67 66 </form> 67 68 <br/> 69 70 <form action="" id="editForm" method="post" 71 enctype="multipart/form-data" class="workflow" 72 tal:attributes="action string:${context/absolute_url}/apply_pume" 73 > 74 <input type="hidden" name="reg_no" 75 tal:attributes="value ds/reg_no|nothing" 76 tal:condition="ds/reg_no|nothing"/> 77 <input type="submit" 78 class="standalone" 79 name="manage" 80 value="Assume the Applicant's Role" 81 /> 82 </form> 83 68 84 </metal:block> 69 85 </metal:block>
Note: See TracChangeset for help on using the changeset viewer.