Changeset 2876
- Timestamp:
- 7 Dec 2007, 13:55:43 (17 years ago)
- Location:
- WAeUP_SRP/base/skins/waeup_student
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_student/getStudyCourseInfo.py
r2855 r2876 12 12 return Info about the Students StudyCourse 13 13 """ 14 import DateTime 14 15 from Products.AdvancedQuery import Eq, Between, Le,In 15 16 … … 23 24 def set_trace(): 24 25 pass 26 import logging 27 logger = logging.getLogger('Skins.getStudyCourseInfo') 25 28 26 29 request = context.REQUEST … … 35 38 course = info['doc'] = context.getContent() 36 39 student_id = context.getStudentId() 37 res = context.students_catalog(id =student_id)38 if not res:40 student_record = context.students_catalog.getRecordByKey(student_id) 41 if not student_record: 39 42 return None 40 sbrain = res[0] 41 info['student'] = sbrain 42 cert_id = sbrain.course 43 res = context.portal_catalog_real.evalAdvancedQuery(Eq('id', cert_id) & 44 Eq('portal_type', "Certificate")) 43 info['student'] = student_record 44 cert_id = student_record.course 45 # logger.info("before search") 46 # starttime = DateTime.DateTime().timeTime() 47 # res = context.portal_catalog_real.evalAdvancedQuery(Eq('id', cert_id)) # & 48 # Eq('portal_type', "Certificate")) 49 # logger.info("searchtime %f" % (DateTime.DateTime().timeTime() - starttime)) 50 # if True: 51 # #info['cert_id'] = cert_id 52 # # brain = res[0] 53 # # ci['title'] = brain.Title 54 # # pl = brain.getPath().split('/') 55 # # ci['faculty'] = pl[-4] 56 # # ci['department'] = pl[-3] 57 # ci['study_course'] = student_record.course 58 # ci['faculty'] = student_record.faculty 59 # ci['department'] = student_record.department 60 # info['course_doc'] = ci 61 # else: 62 # info['cert_id'] = 'N/A' 63 # ci['study_course'] = 'N/A' 64 # ci['title'] = 'N/A' 65 # ci['faculty'] = 'N/A' 66 # ci['department'] = 'N/A' 67 # info['course_doc'] = ci 45 68 ci = {} 46 if res: 47 info['cert_id'] = cert_id 48 brain = res[0] 49 ci['study_course'] = brain.getId 50 ci['title'] = brain.Title 51 pl = brain.getPath().split('/') 52 ci['faculty'] = pl[-4] 53 ci['department'] = pl[-3] 54 info['course_doc'] = ci 55 else: 56 info['cert_id'] = 'N/A' 57 ci['study_course'] = 'N/A' 58 ci['title'] = 'N/A' 59 ci['faculty'] = 'N/A' 60 ci['department'] = 'N/A' 61 info['course_doc'] = ci 69 ci['study_course'] = student_record.course 70 ci['faculty'] = student_record.faculty 71 ci['department'] = student_record.department 72 info['course_doc'] = ci 62 73 63 74 items = [] … … 82 93 83 94 84 current_level = s brain.level95 current_level = student_record.level 85 96 levels = context.objectIds() 86 97 review_state = wftool.getInfoFor(context,'review_state',None) 87 student_review_state = s brain.review_state98 student_review_state = student_record.review_state 88 99 #if review_state != 'content_addable' and student_review_state == 'school_fee_paid': #and context.isStudent(): 89 100 # wftool.doActionFor(context,'close_for_edit') … … 95 106 (previous_verdict in ('A','B','C','F','J','L','M') or\ 96 107 current_level == '100' or\ 97 (s brain.mode.startswith('de') and current_level == '200'))108 (student_record.mode.startswith('de') and current_level == '200')) 98 109 99 110 missing_data = has_paid and\ 100 111 current_level not in levels and\ 101 not (previous_verdict or s brain.level) and\112 not (previous_verdict or student_record.level) and\ 102 113 not (current_level == '100' or\ 103 (s brain.mode.startswith('de') and current_level == '200'))114 (student_record.mode.startswith('de') and current_level == '200')) 104 115 105 116 info['missing_data'] = missing_data -
WAeUP_SRP/base/skins/waeup_student/study_course_view.pt
r2678 r2876 45 45 <td><span tal:content="info/previous_verdict" /></td> 46 46 </tr> 47 <span tal:define="f_id sc/faculty; 48 d_id sc/department; 49 c_id sc/study_course; 50 f_title context/academics/?f_id/Title|string:Faculty not yet in Prospectus; 51 d_title context/academics/?f_id/?d_id/Title|string:Department not yet in Prospectus; 52 c_title context/academics/?f_id/?d_id/certificates/?c_id/Title|string:Department not yet in Prospectus" 53 > 47 54 <tr> 48 55 <td width="220px">Certificate:</td> 49 <td ><span tal:content="sc/title" /></td>56 <td tal:content="c_title" /> 50 57 </tr> 51 58 <tr> 52 59 <td>Certificate Id:</td> 53 <td tal:content="sc/study_course" />60 <td><span tal:content="sc/study_course" /></td> 54 61 </tr> 55 <span tal:define="f_id sc/faculty;56 d_id sc/department;57 f_title context/academics/?f_id/Title|string:Faculty not yet in Prospectus;58 d_title context/academics/?f_id/?d_id/Title|string:Department not yet in Prospectus"59 >60 62 <tr> 61 63 <td>Faculty:</td>
Note: See TracChangeset for help on using the changeset viewer.