Changeset 2454 for WAeUP_SRP/base/skins
- Timestamp:
- 27 Oct 2007, 21:53:04 (17 years ago)
- Location:
- WAeUP_SRP/base/skins
- Files:
-
- 2 added
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/cps_custom/config_form.pt
r2288 r2454 71 71 <tr> 72 72 <th> 73 <label> 74 Current Session 75 </label> 76 </th> 77 <td> 78 <input name="session" id="portal_session" value="" 79 tal:attributes="value pprops/session" /> 80 </td> 81 </tr> 82 <tr> 83 <th> 73 84 <label for="portal_description" 74 85 i18n:translate="label_portal_description"> -
WAeUP_SRP/base/skins/waeup_accommodation/allocate_reserved_bed.py
r1566 r2454 64 64 students = context.portal_url.getPortalObject().campus.students 65 65 student_obj = getattr(students,sid) 66 acco_id = "accommodation_%s" % context.getSessionId() 66 acco_id = "accommodation_%s" % context.getSessionId()[0] 67 67 while True: 68 68 if not res: -
WAeUP_SRP/base/skins/waeup_accommodation/change_bed.py
r2000 r2454 60 60 return redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id'])) 61 61 student_obj = getattr(students,student_id) 62 acco_id = "accommodation_%s" % context.getSessionId() 62 acco_id = "accommodation_%s" % context.getSessionId()[0] 63 63 if acco_id in student_obj.objectIds(): 64 64 acco_doc = getattr(student_obj, acco_id).getContent() -
WAeUP_SRP/base/skins/waeup_accommodation/getAccommodationInfo.py
r2427 r2454 80 80 booking_allowed = info['verdict'] in ("A", 81 81 "B",) 82 82 83 83 booking_allowed = False # booking temporarily disabled 84 84 # the algorithm must be adapted to new course_results catalog 85 85 # and/or FCEOkene modalities 86 87 88 89 90 91 92 93 94 86 87 95 88 info['booking_allowed'] = booking_allowed 96 89 if not booking_allowed: 97 90 info['acco'] = None 98 91 return info 99 acco_id = 'accommodation_2006' 92 info['session'] = session = context.getSessionId() 93 acco_id = 'accommodation_' + session[0] 100 94 acco = getattr(student,acco_id,None) 101 95 info['acco'] = acco -
WAeUP_SRP/base/skins/waeup_accommodation/reserve_accommodation.py
r2000 r2454 27 27 student = info['student'] 28 28 acco_id = info['acco_id'] 29 session = acco_id[-4:] 29 session = info['session'][1] 30 #session = acco_id[-4:] 30 31 validate = REQUEST.has_key("cpsdocument_create_button") 31 32 if info.has_key('acco') and info['acco']: -
WAeUP_SRP/base/skins/waeup_default/getSessionId.py
r2133 r2454 15 15 # must be changed in 2007/2008; should return only the last two digits 16 16 17 import DateTime 18 now = DateTime.DateTime() 19 if now.month() > 11: 20 s = "%s" % now.year() 21 else: 22 s = "%s" % (now.year() - 1) 23 return s 17 #import DateTime 18 #now = DateTime.DateTime() 19 #if now.month() > 11: 20 # s = "%s" % now.year() 21 #else: 22 # s = "%s" % (now.year() - 1) 23 #return s 24 25 session_id = context.portal_properties.session[2:4] 26 session_str = context.portal_properties.session 27 28 return [session_id, session_str] -
WAeUP_SRP/base/skins/waeup_epayment/getPaymentsFolderInfo.py
r2249 r2454 71 71 info['prod_id'] = '61' 72 72 session = s_brain.session 73 info['next_session'], info['next_session_str'] = context.getNextSessionId(session) 73 next_info = context.getNextInfo(s_brain) 74 info['next_session'] = next_info['next_session_id'] 75 info['next_session_str'] = next_info['next_session_str'] 74 76 75 77 info['student_name'] = s_brain.name -
WAeUP_SRP/base/skins/waeup_epayment/interswitch_cb.py
r2135 r2454 52 52 pd[pdk] = request.get(rc,'') 53 53 54 # for testing purposes54 ## for testing purposes 55 55 #pd['resp_desc'] = 'Simulated Callback' 56 56 #pd['resp_pay_reference'] = 'XXXX' … … 74 74 s_brain = context.students_catalog(id=student_id)[0] 75 75 session = s_brain.session 76 next_session, next_session_str = context.getNextSessionId(session) 76 #next_session, next_session_str = context.getNextSessionId(session) 77 78 next_info = context.getNextInfo(s_brain) 79 next_session_id = next_info['next_session_id'] 80 next_session_str = next_info['next_session_str'] 81 next_level_id = next_info['next_level_id'] 82 next_transition = next_info['next_transition'] 77 83 78 84 if resp == '00': … … 80 86 logger.info('%s paid school_fee in state school_fee_paid' % (student_id)) 81 87 else: 82 if next_session == context.getSessionId()[-2:]: 83 wftool.doActionFor(student,'pay_school_fee') 84 else: 85 study_course = getattr(student,'study_course') 86 try: 87 wftool.doActionFor(study_course,'open') 88 except: 89 pass 90 study_course_doc = study_course.getContent() 91 next_level = "%s" % (int(s_brain.level) + 100) 92 study_course_doc.edit(mapping= {'current_level': next_level, 93 'current_session': next_session,}) 88 study_course = getattr(student,'study_course') 89 try: 90 wftool.doActionFor(study_course,'open') 91 except: 92 pass 93 study_course.getContent().edit(mapping= {'current_level': next_level_id, 94 'current_session': next_session_id,}) 95 if next_transition: 96 wftool.doActionFor(student,next_transition) 97 94 98 logger.info('%s received valid callback' % student_id) 95 99 referer = request.get('HTTP_REFERER','none') -
WAeUP_SRP/base/skins/waeup_epayment/pay_by_sc.py
r2451 r2454 24 24 if context.portal_membership.isAnonymousUser(): 25 25 return None 26 26 wftool = context.portal_workflow 27 27 lt = context.portal_layouts 28 28 request = context.REQUEST … … 34 34 student = getattr(students,student_id) 35 35 s_brain = context.students_catalog(id=student_id)[0] 36 next_info = context.getNextInfo(s_brain)37 next_session_id = next_info['next_session_id']38 next_session_str = next_info['next_session_str']39 next_level_id = next_info['next_level_id']40 next_transition = next_info['next_transition']41 study_course = getattr(student,'study_course')42 study_course.getContent().edit(mapping= {'current_level': next_level_id,43 'current_session': next_session_id,})44 if next_transition:45 wftool.doActionFor(student,next_transition)46 36 47 37 # session = s_brain.session 48 38 # next_session, next_session_str = context.getNextSessionId(session) 49 # validate = request.has_key("cpsdocument_create_button") 39 40 next_info = context.getNextInfo(s_brain) 41 next_session_id = next_info['next_session_id'] 42 next_session_str = next_info['next_session_str'] 43 next_level_id = next_info['next_level_id'] 44 next_transition = next_info['next_transition'] 45 46 validate = request.has_key("cpsdocument_create_button") 50 47 res,psm,ds = lt.renderLayout(layout_id= 'student_schoolfee', 51 48 schema_id= 'payment', … … 113 110 payment.getContent().edit(mapping=info) 114 111 wftool.doActionFor(payment,'close') 115 if next_session == context.getSessionId()[-2:]: 116 wftool.doActionFor(student,'pay_school_fee') 117 else: 118 study_course = getattr(student,'study_course') 119 #wftool.doActionFor(study_course,'open') 120 study_course_doc = study_course.getContent() 121 next_level = "%s" % (int(s_brain.level) + 100) 122 study_course_doc.edit(mapping= {'current_level': next_level, 123 'current_session': next_session,}) 112 113 study_course = getattr(student,'study_course') 114 study_course.getContent().edit(mapping= {'current_level': next_level_id, 115 'current_session': next_session_id,}) 116 if next_transition: 117 wftool.doActionFor(student,next_transition) 118 119 #if next_session == context.getSessionId()[-2:]: 120 # wftool.doActionFor(student,'pay_school_fee') 121 #else: 122 # study_course = getattr(student,'study_course') 123 # #wftool.doActionFor(study_course,'open') 124 # study_course_doc = study_course.getContent() 125 # next_level = "%s" % (int(s_brain.level) + 100) 126 # study_course_doc.edit(mapping= {'current_level': next_level, 127 # 'current_session': next_session,}) 128 124 129 logger.info('%s paid school fee by scratch card' % student_id) 125 130 else: -
WAeUP_SRP/base/skins/waeup_student/create_level.py
r2448 r2454 72 72 results = context.results_import(matric_no = student.matric_no) 73 73 records = [] 74 if results: 75 l = [] 74 l = [] 75 if student.session in ('6', '06') and results: 76 76 carry_overs = results 77 77 for co in carry_overs: … … 154 154 logger.info('%s finished to create level %s' % (student.id,current_level)) 155 155 156 if current_session == '05':157 next_session = '06'158 next_level = "%s" % (int(current_level) + 100)159 study_course = getattr(student,'study_course')160 context.portal_workflow.doActionFor(study_course,'open')161 study_course_doc = study_course.getContent()162 study_course_doc.edit(mapping= {'current_level': next_level,163 'current_session': next_session,})164 context.portal_workflow.doActionFor(study_course,'close_for_edit')156 #if current_session == '05': 157 # next_session = '06' 158 # next_level = "%s" % (int(current_level) + 100) 159 # study_course = getattr(student,'study_course') 160 # context.portal_workflow.doActionFor(study_course,'open') 161 # study_course_doc = study_course.getContent() 162 # study_course_doc.edit(mapping= {'current_level': next_level, 163 # 'current_session': next_session,}) 164 # context.portal_workflow.doActionFor(study_course,'close_for_edit') 165 165 166 166 return response.redirect("%s/%s" % (context.absolute_url(),current_level)) -
WAeUP_SRP/base/skins/waeup_student/getNextInfo.py
r2451 r2454 1 ## Script (Python) "get SessionId"1 ## Script (Python) "getNextInfo" 2 2 ##bind container=container 3 3 ##bind context=context … … 12 12 return the students next info 13 13 """ 14 14 15 info = {} 16 17 session_id = student_brain.session 18 level_id = student_brain.level 19 review_state = student_brain.review_state 20 verdict = student_brain.verdict 15 21 info['next_transition'] = None 16 session_id = student_brain.session 17 if int(session_id) > int(context.getSessionId()[3:4]) -2: 22 info['next_session_id'] = next_session_id = session_id 23 info['next_level_id'] = next_level_id = level_id 24 25 if review_state == 'cleared_and_validated': 18 26 info['next_transition'] = "pay_school_fee" 27 elif review_state == 'returning': 28 info['next_level_id'] = "%s" % (int(level_id) + 100) 29 info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1) 30 if int(session_id) > int(context.getSessionId()[0]) -2: 31 info['next_transition'] = "pay_school_fee" 32 if verdict not in ('A','B',): 33 info['next_level_id'] = level_id 19 34 20 if student_brain.review_state == "returning": 21 session_id info['next_session_id'] = "%02d" % int(session_id) + 1 22 info['next_session_str'] = context.session_voc(session_id) 23 next_level_id = student_brain.level 24 if student_brain.review_state not in ('cleared_and_validated',) 25 next_level_id = "%s" % (int(next_level_id) + 100) 26 info['next_level_id'] = next_level_id 27 35 info['next_session_str'] = context.sessions_voc(next_session_id) 28 36 29 37 return info -
WAeUP_SRP/base/skins/waeup_student/getStudyLevelInfo.py
r2451 r2454 97 97 info['credits_exceeded'] = credits_total > 51 98 98 current_session = student.session 99 info['submission_allowed']= not info['credits_exceeded'] and current_session == context.getSessionId()[ -2:]99 info['submission_allowed']= not info['credits_exceeded'] and current_session == context.getSessionId()[0] 100 100 # carry_overs.sort(cmp_semester_id) 101 101 info['carry_overs'] = carry_overs -
WAeUP_SRP/base/skins/waeup_utilities/fixReservedBeds.py
r1567 r2454 17 17 students = context.portal_url.getPortalObject().campus.students 18 18 hostels = context.portal_url.getPortalObject().campus.accommodation.objectItems() 19 acco_id = "accommodation_%s" % context.getSessionId() 19 acco_id = "accommodation_%s" % context.getSessionId()[0] 20 20 logger.info('%s starts fixReservedBeds' % (member)) 21 21 #from Products.zdb import set_trace;set_trace() -
WAeUP_SRP/base/skins/waeup_utilities/fixReturningSession.py
r2453 r2454 36 36 brains = aq_students(query) 37 37 total = len(brains) 38 logger.info('editet %d students with session 06 and returning' % total)38 logger.info('editet %d students with session 06 and state returning' % total) 39 39 count = 0 40 40 commit_after = 100 … … 55 55 except: 56 56 rwrite('>>>> not found %s study_course' % (brain.id)) 57 57
Note: See TracChangeset for help on using the changeset viewer.