Changeset 10438 for main/waeup.kofa
- Timestamp:
- 29 Jul 2013, 16:25:14 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/browser.txt
r10226 r10438 624 624 625 625 >>> ctrl.displayOptions 626 [' First Semester', 'Second Semester', 'Combined', 'N/A']626 ['1st Semester', '2nd Semester', 'Combined', 'N/A'] 627 627 628 628 >>> ctrl.value = ['1'] -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r10436 r10438 1260 1260 1261 1261 @property 1262 def content_title_1(self):1263 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE1264 return translate(_('1st Semester Courses'), 'waeup.kofa',1265 target_language=portal_language)1266 1267 @property1268 def content_title_2(self):1269 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE1270 return translate(_('2nd Semester Courses'), 'waeup.kofa',1271 target_language=portal_language)1272 1273 @property1274 def content_title_3(self):1275 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE1276 return translate(_('Level Courses'), 'waeup.kofa',1277 target_language=portal_language)1278 1279 @property1280 1262 def label(self): 1281 1263 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE … … 1301 1283 self.request, self.omit_fields) 1302 1284 students_utils = getUtility(IStudentsUtils) 1303 tabledata_1 = sorted( 1304 [value for value in self.context.values() if value.semester == 1], 1305 key=lambda value: str(value.semester) + value.code) 1306 tabledata_2 = sorted( 1307 [value for value in self.context.values() if value.semester == 2], 1308 key=lambda value: str(value.semester) + value.code) 1309 tabledata_3 = sorted( 1310 [value for value in self.context.values() if value.semester == 3], 1311 key=lambda value: str(value.semester) + value.code) 1312 tableheader = [(Code,'code', 2.5), 1313 (Title,'title', 5), 1314 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 1315 (Cred, 'credits', 1.5), 1316 #(Mand, 'mandatory', 1.5), 1317 (Score, 'score', 1.5), 1318 (Grade, 'grade', 1.5), 1319 #('Auto', 'automatic', 1.5) 1320 ] 1285 1286 tabledata = [] 1287 tableheader = [] 1288 contenttitle = [] 1289 for i in range(6): 1290 tabledata.append(sorted( 1291 [value for value in self.context.values() if value.semester == i], 1292 key=lambda value: str(value.semester) + value.code)) 1293 tableheader.append([(Code,'code', 2.5), 1294 (Title,'title', 5), 1295 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 1296 (Cred, 'credits', 1.5), 1297 #(Mand, 'mandatory', 1.5), 1298 (Score, 'score', 1.5), 1299 (Grade, 'grade', 1.5), 1300 #('Auto', 'automatic', 1.5) 1301 ]) 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 1321 1311 return students_utils.renderPDF( 1322 1312 self, 'course_registration_slip.pdf', 1323 1313 self.context.student, studentview, 1324 tableheader_1=tableheader, 1325 tabledata_1=tabledata_1, 1326 tableheader_2=tableheader, 1327 tabledata_2=tabledata_2, 1328 tableheader_3=tableheader, 1329 tabledata_3=tabledata_3, 1314 tableheader=tableheader, 1315 tabledata=tabledata, 1316 contenttitle=contenttitle, 1330 1317 omit_fields=self.omit_fields 1331 1318 ) -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r10437 r10438 578 578 def renderPDF(self, view, filename='slip.pdf', student=None, 579 579 studentview=None, 580 tableheader_1=None, tabledata_1=None, 581 tableheader_2=None, tabledata_2=None, 582 tableheader_3=None, tabledata_3=None, 583 tableheader_4=None, tabledata_4=None, 584 tableheader_5=None, tabledata_5=None, 585 tableheader_6=None, tabledata_6=None, 580 tableheader=[], tabledata=[], contenttitle=[], 586 581 note=None, signatures=None, sigs_in_footer=(), 587 582 show_scans=True, topMargin=1.5, … … 633 628 data.extend(creator.fromStringList(student.history.messages)) 634 629 635 # Insert 1st content table (optionally on second page) 636 if tabledata_1 and tableheader_1: 637 #data.append(PageBreak()) 638 #data.append(Spacer(1, 20)) 639 data.append(Paragraph(view.content_title_1, HEADING_STYLE)) 640 data.append(Spacer(1, 8)) 641 contenttable = render_table_data(tableheader_1,tabledata_1) 642 data.append(contenttable) 643 644 # Insert 2nd content table (optionally on second page) 645 if tabledata_2 and tableheader_2: 646 #data.append(PageBreak()) 647 #data.append(Spacer(1, 20)) 648 data.append(Paragraph(view.content_title_2, HEADING_STYLE)) 649 data.append(Spacer(1, 8)) 650 contenttable = render_table_data(tableheader_2,tabledata_2) 651 data.append(contenttable) 652 653 # Insert 3rd content table (optionally on second page) 654 if tabledata_3 and tableheader_3: 655 #data.append(PageBreak()) 656 #data.append(Spacer(1, 20)) 657 data.append(Paragraph(view.content_title_3, HEADING_STYLE)) 658 data.append(Spacer(1, 8)) 659 contenttable = render_table_data(tableheader_3,tabledata_3) 660 data.append(contenttable) 661 662 # Insert 4th content table (optionally on second page) 663 if tabledata_4 and tableheader_4: 664 #data.append(PageBreak()) 665 #data.append(Spacer(1, 20)) 666 data.append(Paragraph(view.content_title_4, HEADING_STYLE)) 667 data.append(Spacer(1, 8)) 668 contenttable = render_table_data(tableheader_4,tabledata_4) 669 data.append(contenttable) 670 671 # Insert 5th content table (optionally on second page) 672 if tabledata_5 and tableheader_5: 673 #data.append(PageBreak()) 674 #data.append(Spacer(1, 20)) 675 data.append(Paragraph(view.content_title_5, HEADING_STYLE)) 676 data.append(Spacer(1, 8)) 677 contenttable = render_table_data(tableheader_5,tabledata_5) 678 data.append(contenttable) 679 680 # Insert 6th content table (optionally on second page) 681 if tabledata_6 and tableheader_6: 682 #data.append(PageBreak()) 683 #data.append(Spacer(1, 20)) 684 data.append(Paragraph(view.content_title_6, HEADING_STYLE)) 685 data.append(Spacer(1, 8)) 686 contenttable = render_table_data(tableheader_6,tabledata_6) 687 data.append(contenttable) 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) 688 639 689 640 # Insert signatures
Note: See TracChangeset for help on using the changeset viewer.