Changeset 16234 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 11 Sep 2020, 11:47:23 (4 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/browser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r16081 r16234 78 78 79 79 from waeup.kofa.applicants.interfaces import IApplicantsUtils 80 from waeup.kofa.applicants.workflow import SUBMITTED 80 81 81 82 from waeup.kofa.students.catalog import StudentQueryResultItem … … 1083 1084 label =_('My ToDoList') 1084 1085 1086 def update(self): 1087 self.local_roles = get_user_account(self.request).getLocalRoles() 1088 return 1089 1085 1090 @property 1086 1091 def getStudents(self): 1087 1092 students = ([],[]) 1088 1093 cat = queryUtility(ICatalog, name='students_catalog') 1089 local_roles = get_user_account(self.request).getLocalRoles() 1090 for item in local_roles.get('waeup.local.TranscriptOfficer', []): 1094 for item in self.local_roles.get('waeup.local.TranscriptOfficer', []): 1091 1095 if isinstance(item, Faculty): 1092 1096 faccode = item.code … … 1101 1105 return students 1102 1106 1107 @property 1108 def getApplicants(self): 1109 applicants = [] 1110 cat = getUtility(ICatalog, name='applicants_catalog') 1111 results = cat.searchResults( 1112 container_code=('tsca0', 'tscz9'), 1113 state=(SUBMITTED, SUBMITTED)) 1114 local_roles = self.local_roles.get('waeup.local.TranscriptOfficer', []) 1115 if not local_roles: 1116 return results 1117 for item in local_roles: 1118 if isinstance(item, Faculty): 1119 faccode = item.code 1120 else: 1121 continue 1122 for applicant in results: 1123 course = getattr(applicant, 'course_studied', None) 1124 if not course: 1125 continue 1126 try: 1127 if course.__parent__.__parent__.__parent__.code == faccode: 1128 applicants.append(applicant) 1129 except AttributeError: 1130 continue 1131 return applicants 1132 1103 1133 class TranscriptSigneeLandingPage(KofaPage): 1104 1134 """Display students with validated transcript requests, when … … 1110 1140 grok.template('mytranscriptrequests') 1111 1141 label =_('My ToDoList') 1142 1112 1143 1113 1144 @property … … 1124 1155 students[1].append(StudentQueryResultItem(result, self)) 1125 1156 return students 1157 1158 @property 1159 def getApplicants(self): 1160 return None 1126 1161 1127 1162 # -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/mytranscriptrequests.pt
r15163 r16234 1 <h3 i18n:domain="waeup.kofa" i18n:translate="" tal:condition="view/getApplicants"> 2 Open Transcript Applications 3 </h3> 4 5 <table class="kofa-data-table dataTable" tal:condition="view/getApplicants"> 6 <thead> 7 <tr> 8 <th i18n:translate="">Applicant Id</th> 9 <th i18n:translate="">Full Name</th> 10 </tr> 11 </thead> 12 <tbody> 13 <tr tal:repeat="item view/getApplicants"> 14 <td> <a tal:attributes="href python:view.url(item)"> 15 <span tal:content="item/applicant_id">XXXX_1234</span></a> 16 </td> 17 <td tal:content="item/display_fullname">Bob</td> 18 </tr> 19 </tbody> 20 </table> 21 1 22 <h3 i18n:domain="waeup.kofa" i18n:translate="" tal:condition="python:view.getStudents[0]"> 2 23 Transcripts to be validated
Note: See TracChangeset for help on using the changeset viewer.