Changeset 2168 for WAeUP_SRP/trunk/skins/waeup_student
- Timestamp:
- 29 Aug 2007, 06:24:39 (17 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_student
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/apply_pume.py
r2162 r2168 97 97 elif psm == '' and not manage: 98 98 return context.apply_pume_form(rendered = res, 99 psm = None,99 psm = psm, 100 100 ds = ds, 101 101 mode = mode, … … 132 132 mode = "view" 133 133 psm = "You successfully applied for PUME!" 134 data['application_date'] = current135 134 if object['status'] == 'edited': 136 135 data['status'] = "submitted" 136 data['application_date'] = current 137 137 logger.info('%s/%s modified and submitted application record' % (member,reg_no)) 138 138 elif object['status'] == 'reset': … … 183 183 else: 184 184 mode = "edit" 185 psm = "Content changed "185 psm = "Content changed!" 186 186 data['status'] = "edited" 187 187 context.applicants_catalog.modifyRecord(**data) -
WAeUP_SRP/trunk/skins/waeup_student/apply_pume_manage.py
r2161 r2168 37 37 #REQUEST.set('type_name',type_name) 38 38 reset = "reset" in request.keys() 39 edit = "edit" in request.keys() 39 40 lt = context.portal_layouts 40 41 … … 42 43 new_reg_no = request.get('new_reg_no','').upper() 43 44 44 if reset :45 if reset or edit: 45 46 reg_no = reg_no 46 47 elif new_reg_no: … … 50 51 psm = '' 51 52 object = {} 53 ds = [] 54 55 if reg_no: 56 brains = context.applicants_catalog(reg_no = reg_no) 57 if len(brains) == 1: 58 for field in context.applicants_catalog.schema(): 59 object[field] = getattr(brains[0],field,None) 60 61 res,psm,ds = lt.renderLayout(layout_id= 'application_manage', 62 schema_id= 'application', 63 layout_mode = "edit", 64 context=context, 65 mapping=REQUEST, 66 ob=object, 67 commit = False, 68 ) 69 if psm == 'invalid': 70 return context.apply_pume_manage_form(rendered = res, 71 psm = "Please correct your input!", 72 #psm = "%s, %s" % (psm,ds), 73 ds = ds, 74 ) 75 elif psm == '': 76 psm = 'Registration Number not found!' 77 return context.apply_pume_manage_form(rendered = res, 78 psm = psm, 79 ds = ds, 80 ) 81 elif psm == 'valid': 82 psm = '' 83 pass 84 52 85 data = {} 86 dm = ds.getDataModel() 87 for field in context.applicants_catalog.schema(): 88 if dm.has_key("%s" % field): 89 data[field] = dm.get(field) 90 91 53 92 if reset and reg_no: 54 data['reg_no'] = reg_no93 #data['reg_no'] = reg_no 55 94 psm = "You successfully reset the record! The applicant will be able to edit and resubmit the data." 56 95 data['status'] = "reset" … … 58 97 logger.info('%s reset application record of %s' % (member,reg_no)) 59 98 99 if edit and reg_no: 100 #data['reg_no'] = reg_no 101 psm = "Content changed!" 102 context.applicants_catalog.modifyRecord(**data) 103 logger.info('%s edited application record of %s' % (member,reg_no)) 104 60 105 #set_trace() 61 106 62 ds = [] 107 63 108 if reg_no: 64 109 brains = context.applicants_catalog(reg_no = reg_no) … … 66 111 for field in context.applicants_catalog.schema(): 67 112 object[field] = getattr(brains[0],field,None) 68 res,psm_dummy,ds = lt.renderLayout(layout_id= 'application ',113 res,psm_dummy,ds = lt.renderLayout(layout_id= 'application_manage', 69 114 schema_id= 'application', 70 layout_mode = " view_slip",115 layout_mode = "edit", 71 116 context=context, 72 117 ob=object, -
WAeUP_SRP/trunk/skins/waeup_student/apply_pume_manage_form.pt
r2161 r2168 53 53 tal:condition="python: 'submitted' in ds['status']" 54 54 /> 55 56 57 58 59 60 <input type="submit" class="standalone" 61 name="edit" 62 value="Save" 63 /> 64 65 66 67 68 55 69 <br /><br /> 56 70
Note: See TracChangeset for help on using the changeset viewer.