Changeset 10439 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 30 Jul 2013, 06:22:45 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r10438 r10439 1269 1269 + ' %s' % level_title 1270 1270 1271 @property 1272 def tabletitle(self): 1273 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1274 tabletitle = [] 1275 tabletitle.append(translate(_('1st Semester Courses'), 'waeup.kofa', 1276 target_language=portal_language)) 1277 tabletitle.append(translate(_('2nd Semester Courses'), 'waeup.kofa', 1278 target_language=portal_language)) 1279 tabletitle.append(translate(_('Level Courses'), 'waeup.kofa', 1280 target_language=portal_language)) 1281 return tabletitle 1282 1271 1283 def render(self): 1272 1284 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE … … 1287 1299 tableheader = [] 1288 1300 contenttitle = [] 1289 for i in range( 6):1301 for i in range(1,7): 1290 1302 tabledata.append(sorted( 1291 1303 [value for value in self.context.values() if value.semester == i], … … 1300 1312 #('Auto', 'automatic', 1.5) 1301 1313 ]) 1302 contenttitle.append(None)1303 1304 contenttitle[1] = translate(_('1st Semester Courses'), 'waeup.kofa',1305 target_language=portal_language)1306 contenttitle[2] = translate(_('2nd Semester Courses'), 'waeup.kofa',1307 target_language=portal_language)1308 contenttitle[3] = translate(_('Level Courses'), 'waeup.kofa',1309 target_language=portal_language)1310 1311 1314 return students_utils.renderPDF( 1312 1315 self, 'course_registration_slip.pdf', … … 1314 1317 tableheader=tableheader, 1315 1318 tabledata=tabledata, 1316 contenttitle=contenttitle,1317 1319 omit_fields=self.omit_fields 1318 1320 ) -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r10438 r10439 578 578 def renderPDF(self, view, filename='slip.pdf', student=None, 579 579 studentview=None, 580 tableheader=[], tabledata=[], contenttitle=[],580 tableheader=[], tabledata=[], 581 581 note=None, signatures=None, sigs_in_footer=(), 582 582 show_scans=True, topMargin=1.5, … … 629 629 630 630 # Insert content tables (optionally on second page) 631 for i in range(len(tabledata)): 632 if tabledata[i] and tableheader[i]: 633 #data.append(PageBreak()) 634 #data.append(Spacer(1, 20)) 635 data.append(Paragraph(contenttitle[i], HEADING_STYLE)) 636 data.append(Spacer(1, 8)) 637 contenttable = render_table_data(tableheader[i],tabledata[i]) 638 data.append(contenttable) 631 if hasattr(view, 'tabletitle'): 632 for i in range(len(view.tabletitle)): 633 if tabledata[i] and tableheader[i]: 634 #data.append(PageBreak()) 635 #data.append(Spacer(1, 20)) 636 data.append(Paragraph(view.tabletitle[i], HEADING_STYLE)) 637 data.append(Spacer(1, 8)) 638 contenttable = render_table_data(tableheader[i],tabledata[i]) 639 data.append(contenttable) 639 640 640 641 # Insert signatures
Note: See TracChangeset for help on using the changeset viewer.