Changeset 3429 for WAeUP_SRP/fceokene
- Timestamp:
- 8 Apr 2008, 08:26:18 (17 years ago)
- Location:
- WAeUP_SRP/fceokene
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/fceokene/profiles/default/layouts/acco_hall.xml
r2842 r3429 41 41 </property> 42 42 <property name="is_required">False</property> 43 <property name="label">Beds for FinalStudents</property>44 <property name="label_edit">Beds for FinalStudents</property>43 <property name="label">Beds for NCE-3 Students</property> 44 <property name="label_edit">Beds for NCE-3 Students</property> 45 45 <property name="help">Name the bedspaces for final year students. 46 46 Attention: The bed letters must not exceed the number of beds per room.</property> … … 55 55 </property> 56 56 <property name="is_required">False</property> 57 <property name="label">Beds for FreshStudents</property>58 <property name="label_edit">Beds for FreshStudents</property>57 <property name="label">Beds for NCE-1 Students</property> 58 <property name="label_edit">Beds for NCE-1 Students</property> 59 59 <property name="help">Name the beds for first year students. 60 60 Attention: The bed letters must not exceed the number of beds per room.</property> … … 203 203 <row> 204 204 <cell name="sort_id"/> 205 </row> 205 </row> 206 206 <row> 207 207 <cell name="maintenance_code"/> 208 208 </row> 209 209 <row> 210 <cell name="special_handling"/>211 </row>212 <row>213 210 <cell name="text"/> 214 211 </row> … … 231 228 <cell name="beds_per_room"/> 232 229 </row> 230 <row> 231 <cell name="beds_for_pre"/> 232 </row> 233 233 <row> 234 234 <cell name="beds_for_fresh"/> -
WAeUP_SRP/fceokene/waeup_custom/getAccommodationInfo.py
r3015 r3429 35 35 else: 36 36 student_id = member_id 37 res = context.students_catalog(id=student_id)38 if len(res) != 1:37 student_record = context.students_catalog.getRecordByKey(student_id) 38 if student_record is None: 39 39 logger.info('%s not found in students_catalog' % student_id) 40 40 return None 41 41 42 43 s_brain = res[0]44 42 info['error'] = None 45 info['matric_no']=s_brain.matric_no 46 info['jamb_reg_no']=s_brain.jamb_reg_no 47 info['name']=s_brain.name 48 info['email']=s_brain.email 49 info['level']=s_brain.level 50 info['end_level'] = s_brain.end_level 51 info['verdict']=getattr(s_brain,'verdict','') 52 review_state = info['review_state'] = s_brain.review_state 53 54 43 info['matric_no']=student_record.matric_no 44 info['jamb_reg_no']=student_record.jamb_reg_no 45 info['name']=student_record.name 46 info['email']=student_record.email 47 info['level']=student_record.level 48 info['verdict']=getattr(student_record,'verdict','') 49 review_state = info['review_state'] = student_record.review_state 55 50 info['session'] = session = context.getSessionId() 56 57 51 students_object = context.portal_url.getPortalObject().campus.students 58 52 student = getattr(students_object, student_id) … … 61 55 62 56 booking_allowed = False 63 if review_state in ('school_fee_paid','courses_registered', 'courses_validated',) and s_brain.session == session[0]:64 booking_allowed = True65 57 58 # customize from here 66 59 67 #booking_allowed = False 60 try: 61 level = int(student_record.level) 62 except: 63 logger.info('%s has invalid level %s' % (student_id,student_record.level)) 64 info['acco'] = None 65 info['booking_allowed'] = False 66 info['student_status'] = '' 67 return info 68 68 69 if review_state in ('school_fee_paid','courses_registered', 'courses_validated',) and student_record.session == session[0]: 70 info['booking_allowed'] = True 71 info['online_payment'] = True 72 else: 73 info['acco'] = None 74 info['booking_allowed'] = False 75 info['student_status'] = '' 76 return info 69 77 70 info['booking_allowed'] = booking_allowed71 info['online_payment'] = True # for Okene72 if not booking_allowed:73 info['acco'] = None74 return info75 78 acco_id = 'accommodation_' + session[0] 76 79 acco = getattr(student,acco_id,None) … … 78 81 info['acco_id'] = acco_id 79 82 80 bt = 're'81 83 info['maintenance_paid'] = False 82 84 if acco is not None: … … 85 87 info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid" 86 88 d = {} 87 if int(s_brain.level) == 100: 89 if level >= 300: 90 bt = 'fi' 91 if level == 100: 88 92 bt = 'fr' 89 elif int(s_brain.level) < 300: 93 elif level < 100: 94 bt = 'pr' 95 elif level < 300: 90 96 bt = 're' 91 elif int(s_brain.level) < 100: 92 bt = 'pr' 93 else: 94 res = context.portal_catalog(portal_type = "Certificate", id = s_brain.course) 95 if res: 96 c_brain = res[0] 97 certificate = c_brain.getObject().getContent() 98 try: 99 certlevel = int(certificate.end_level) 100 except: 101 info["error"] = '"no end_level for","%s"' % c_brain.getId 102 return info 103 try: 104 studentlevel = int(s_brain.level) 105 except: 106 info["error"] = '"no level for","%s"' % s_brain.getId 107 return info 108 if studentlevel >= certlevel: 109 bt = "fi" 97 110 98 d['sex'] = 'male' 111 if s _brain.sex:99 if student_record.sex: 112 100 d['sex'] = 'female' 113 101 114 102 115 103 info['sex']=d['sex'] 116 117 118 104 d['bt'] = bt 119 #from Products.zdb import set_trace120 #set_trace()121 105 student_status = "%(sex)s_%(bt)s" % d 122 106 info['student_status'] = student_status
Note: See TracChangeset for help on using the changeset viewer.