Changeset 17393 for main/kofacustom.edocons/trunk
- Timestamp:
- 27 Apr 2023, 06:31:51 (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/browser.py
r17388 r17393 47 47 NigeriaExportPDFPaymentSlip, 48 48 NigeriaBedTicketAddPage, 49 NigeriaExportPDFCourseRegistrationSlip, 49 50 ) 50 51 … … 161 162 return translated_values(self) 162 163 164 class CustomExportPDFCourseRegistrationSlip(NigeriaExportPDFCourseRegistrationSlip): 165 """Deliver a PDF slip of the context. 166 """ 167 omit_fields = ('password', 'suspended', 'suspended_comment', 168 'phone', 'adm_code', 'sex', 'email', 'date_of_birth', 'current_level', 169 'flash_notice') 163 170 171 def render(self): 172 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 173 Code = translate(_('Code'), 'waeup.kofa', target_language=portal_language) 174 Title = translate(_('Title'), 'waeup.kofa', target_language=portal_language) 175 Dept = translate(_('Dept.'), 'waeup.kofa', target_language=portal_language) 176 Faculty = translate(_('Faculty'), 'waeup.kofa', target_language=portal_language) 177 Cred = translate(_('Cred.'), 'waeup.kofa', target_language=portal_language) 178 #Mand = translate(_('Requ.'), 'waeup.kofa', target_language=portal_language) 179 Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language) 180 Grade = translate(_('Grade'), 'waeup.kofa', target_language=portal_language) 181 studentview = StudentBasePDFFormPage(self.context.student, 182 self.request, self.omit_fields) 183 students_utils = getUtility(IStudentsUtils) 184 185 tabledata = [] 186 tableheader = [] 187 for i in range(1,7): 188 tabledata.append(sorted( 189 [value for value in self.context.values() if value.semester == i], 190 key=lambda value: str(value.semester) + value.code)) 191 tableheader.append([(Code,'code', 2.5), 192 (Title,'title', 5), 193 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 194 (Cred, 'credits', 1.5), 195 #(Mand, 'mandatory', 1.5), 196 (Score, 'score', 1.5), 197 (Grade, 'grade', 1.5), 198 ('RST', 'carryover_score', 1.5), 199 #('Auto', 'automatic', 1.5) 200 ]) 201 return students_utils.renderPDF( 202 self, 'course_registration_slip.pdf', 203 self.context.student, studentview, 204 tableheader=tableheader, 205 tabledata=tabledata, 206 omit_fields=self.omit_fields, 207 signatures=self._signatures(), 208 sigs_in_footer=self._sigsInFooter(), 209 ) 210 164 211 class CustomCourseTicketDisplayFormPage(CourseTicketDisplayFormPage): 165 212 """ Page to display course tickets
Note: See TracChangeset for help on using the changeset viewer.