Changeset 1178
- Timestamp:
- 2 Jan 2007, 17:44:11 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_student
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/getAccommodationInfo.py
r1161 r1178 35 35 else: 36 36 student_id = member_id 37 38 37 res = context.students_catalog(id=student_id) 39 38 if len(res) != 1: 40 39 logger.info('"%s","not found in students_catalog"') 41 40 return None 41 42 42 ekehuan_certificates = ('BARTAPG', 43 43 'BARTAPM', … … 59 59 s_brain = res[0] 60 60 students_object = context.portal_url.getPortalObject().campus.students 61 res = context.results_import(matric_no = s_brain.matric_no) 61 62 student = getattr(students_object, student_id) 62 63 info['id'] = student_id 63 64 info['student'] = student 64 info['review_state'] = wf.getInfoFor(student,'review_state',None) 65 review_state = info['review_state'] = wf.getInfoFor(student,'review_state',None) 66 booking_allowed = False 67 if not review_state not in ('cleared_and_validated',): 68 res = context.results_import(matric_no = s_brain.matric_no) 69 if res: 70 booking_allowed = res[0].Verdict in ("SUCCESSFUL STUDENT", 71 "STUDENT WITH CARRYOVER COURSES",) 72 else: 73 booking_allowed = True 74 info['booking_allowed'] = booking_allowed 75 if not booking_allowed: 76 return info 65 77 acco_id = 'accommodation_2006' 66 78 acco = getattr(student,acco_id,None) 67 79 info['acco'] = acco 68 80 info['acco_id'] = acco_id 81 bt = 're' 69 82 if acco is not None: 70 83 info['acco_doc'] = acco.getContent() 71 84 info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None) 72 85 d = {} 73 bt = 'fr' 86 if review_state == "cleared_and_validated": 87 bt = 'fr' 88 elif int(s_brain.level) < 600: 89 bt = 're' 90 else: 91 res = context.portal_catalog(portal_type = "Certificate", id = s_brain.course) 92 if res: 93 c_brain = res[0] 94 certificate = s_brain.getObject().getContent() 95 if int(s_brain.level) +100 == int(certificate.end_level): 96 bt = "fi" 74 97 d['sex'] = 'male' 75 98 if s_brain.sex: … … 79 102 elif s_brain.course in pti_certificates: 80 103 bt += "_pti" 104 elif s_brain.faculty in ('MED') and int(s_brain.level) >= 400: 105 bt += "_med" 81 106 82 107 d['bt'] = bt -
WAeUP_SRP/trunk/skins/waeup_student/reserve_accommodation.py
r1171 r1178 26 26 session = acco_id[-4:] 27 27 mode = 'create' 28 if not info[' review_state'] in ('cleared_and_validated',):28 if not info['booking_allowed']: 29 29 return context.REQUEST.RESPONSE.redirect("%s/no_booking_allowed" % info['student'].absolute_url()) 30 30 validate = REQUEST.has_key("cpsdocument_create_button") … … 75 75 if code < 0: 76 76 return context.accommodation_pin_edit_form(rendered = res, 77 psm = bed,77 psm = "%s bed type=%s" % (bed,info['student_status']), 78 78 mode = mode, 79 79 ds = ds, -
WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py
r1177 r1178 1 ##parameters=REQUEST,matric_no2 # $Id$3 """4 process the Application Form5 return html renderer + psm6 """7 import DateTime,logging8 current = DateTime.DateTime()9 pr = context.portal_registration10 logger = logging.getLogger('Returning')11 validate = REQUEST.has_key("cpsdocument_edit_button")12 13 lt = context.portal_layouts14 #pr = context.portal_registration15 default = {'matric_no':matric_no}16 st_res = context.students_catalog(matric_no = matric_no)17 if st_res:18 sid = st_res[0].id19 else:20 logger.info('"%s","Studentobject does not exist"' % matric_no)21 res,psm,ds = lt.renderLayout(layout_id= 'student_session_results_search',22 schema_id= 'student_returning',23 context=context,24 mapping=validate and REQUEST,25 ob=default,26 layout_mode='edit',27 formaction = "set_access_data",28 button = "Search",29 matric_no = matric_no,30 commit = False,31 )32 if psm == '':33 return context.set_access_data_form(rendered = res,34 psm = None,35 firstlayout = True,36 lastlayout = True,37 ds = ds,38 name = "%(name)s" % REQUEST.form39 )40 elif psm == 'invalid':41 psm = "Please correct your input!"42 elif psm == 'valid' and not REQUEST.form.has_key('acknowledge'):43 psm = "You did not check the ackkowledge box !"44 else:45 psm = ''46 if psm != '':47 return context.set_access_data_form(rendered = res,48 #psm = "%s, %s" % (psm,ds),49 psm = psm,50 firstlayout = True,51 lastlayout = True,52 ds = ds,53 name = "%(name)s" % REQUEST.form54 )55 password = REQUEST.get('widget__password')56 email = ds.get('email')57 context.waeup_tool.makeStudentMember(sid,password=password)58 args = {}59 args['__ac_name'] = sid60 args['__ac_password'] = password61 args['returning'] = '1'62 args['email'] = email63 args['phone_nr'] = ds.get('phone_nr')64 from urllib import urlencode65 url = "%s/logged_in?%s" % (context.absolute_url(),urlencode(args))66 return REQUEST.RESPONSE.redirect(url)
Note: See TracChangeset for help on using the changeset viewer.