Index: main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 10437)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 10438)
@@ -1260,22 +1260,4 @@
 
     @property
-    def content_title_1(self):
-        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
-        return translate(_('1st Semester Courses'), 'waeup.kofa',
-            target_language=portal_language)
-
-    @property
-    def content_title_2(self):
-        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
-        return translate(_('2nd Semester Courses'), 'waeup.kofa',
-            target_language=portal_language)
-
-    @property
-    def content_title_3(self):
-        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
-        return translate(_('Level Courses'), 'waeup.kofa',
-            target_language=portal_language)
-
-    @property
     def label(self):
         portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
@@ -1301,31 +1283,36 @@
             self.request, self.omit_fields)
         students_utils = getUtility(IStudentsUtils)
-        tabledata_1 = sorted(
-            [value for value in self.context.values() if value.semester == 1],
-            key=lambda value: str(value.semester) + value.code)
-        tabledata_2 = sorted(
-            [value for value in self.context.values() if value.semester == 2],
-            key=lambda value: str(value.semester) + value.code)
-        tabledata_3 = sorted(
-            [value for value in self.context.values() if value.semester == 3],
-            key=lambda value: str(value.semester) + value.code)
-        tableheader = [(Code,'code', 2.5),
-                         (Title,'title', 5),
-                         (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5),
-                         (Cred, 'credits', 1.5),
-                         #(Mand, 'mandatory', 1.5),
-                         (Score, 'score', 1.5),
-                         (Grade, 'grade', 1.5),
-                         #('Auto', 'automatic', 1.5)
-                         ]
+
+        tabledata = []
+        tableheader = []
+        contenttitle = []
+        for i in range(6):
+            tabledata.append(sorted(
+                [value for value in self.context.values() if value.semester == i],
+                key=lambda value: str(value.semester) + value.code))
+            tableheader.append([(Code,'code', 2.5),
+                             (Title,'title', 5),
+                             (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5),
+                             (Cred, 'credits', 1.5),
+                             #(Mand, 'mandatory', 1.5),
+                             (Score, 'score', 1.5),
+                             (Grade, 'grade', 1.5),
+                             #('Auto', 'automatic', 1.5)
+                             ])
+            contenttitle.append(None)
+
+        contenttitle[1] = translate(_('1st Semester Courses'), 'waeup.kofa',
+            target_language=portal_language)
+        contenttitle[2] = translate(_('2nd Semester Courses'), 'waeup.kofa',
+            target_language=portal_language)
+        contenttitle[3] = translate(_('Level Courses'), 'waeup.kofa',
+            target_language=portal_language)
+
         return students_utils.renderPDF(
             self, 'course_registration_slip.pdf',
             self.context.student, studentview,
-            tableheader_1=tableheader,
-            tabledata_1=tabledata_1,
-            tableheader_2=tableheader,
-            tabledata_2=tabledata_2,
-            tableheader_3=tableheader,
-            tabledata_3=tabledata_3,
+            tableheader=tableheader,
+            tabledata=tabledata,
+            contenttitle=contenttitle,
             omit_fields=self.omit_fields
             )
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 10437)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 10438)
@@ -578,10 +578,5 @@
     def renderPDF(self, view, filename='slip.pdf', student=None,
                   studentview=None,
-                  tableheader_1=None, tabledata_1=None,
-                  tableheader_2=None, tabledata_2=None,
-                  tableheader_3=None, tabledata_3=None,
-                  tableheader_4=None, tabledata_4=None,
-                  tableheader_5=None, tabledata_5=None,
-                  tableheader_6=None, tabledata_6=None,
+                  tableheader=[], tabledata=[], contenttitle=[],
                   note=None, signatures=None, sigs_in_footer=(),
                   show_scans=True, topMargin=1.5,
@@ -633,57 +628,13 @@
             data.extend(creator.fromStringList(student.history.messages))
 
-       # Insert 1st content table (optionally on second page)
-        if tabledata_1 and tableheader_1:
-            #data.append(PageBreak())
-            #data.append(Spacer(1, 20))
-            data.append(Paragraph(view.content_title_1, HEADING_STYLE))
-            data.append(Spacer(1, 8))
-            contenttable = render_table_data(tableheader_1,tabledata_1)
-            data.append(contenttable)
-
-       # Insert 2nd content table (optionally on second page)
-        if tabledata_2 and tableheader_2:
-            #data.append(PageBreak())
-            #data.append(Spacer(1, 20))
-            data.append(Paragraph(view.content_title_2, HEADING_STYLE))
-            data.append(Spacer(1, 8))
-            contenttable = render_table_data(tableheader_2,tabledata_2)
-            data.append(contenttable)
-
-       # Insert 3rd content table (optionally on second page)
-        if tabledata_3 and tableheader_3:
-            #data.append(PageBreak())
-            #data.append(Spacer(1, 20))
-            data.append(Paragraph(view.content_title_3, HEADING_STYLE))
-            data.append(Spacer(1, 8))
-            contenttable = render_table_data(tableheader_3,tabledata_3)
-            data.append(contenttable)
-
-       # Insert 4th content table (optionally on second page)
-        if tabledata_4 and tableheader_4:
-            #data.append(PageBreak())
-            #data.append(Spacer(1, 20))
-            data.append(Paragraph(view.content_title_4, HEADING_STYLE))
-            data.append(Spacer(1, 8))
-            contenttable = render_table_data(tableheader_4,tabledata_4)
-            data.append(contenttable)
-
-       # Insert 5th content table (optionally on second page)
-        if tabledata_5 and tableheader_5:
-            #data.append(PageBreak())
-            #data.append(Spacer(1, 20))
-            data.append(Paragraph(view.content_title_5, HEADING_STYLE))
-            data.append(Spacer(1, 8))
-            contenttable = render_table_data(tableheader_5,tabledata_5)
-            data.append(contenttable)
-
-       # Insert 6th content table (optionally on second page)
-        if tabledata_6 and tableheader_6:
-            #data.append(PageBreak())
-            #data.append(Spacer(1, 20))
-            data.append(Paragraph(view.content_title_6, HEADING_STYLE))
-            data.append(Spacer(1, 8))
-            contenttable = render_table_data(tableheader_6,tabledata_6)
-            data.append(contenttable)
+        # Insert content tables (optionally on second page)
+        for i in range(len(tabledata)):
+            if tabledata[i] and tableheader[i]:
+                #data.append(PageBreak())
+                #data.append(Spacer(1, 20))
+                data.append(Paragraph(contenttitle[i], HEADING_STYLE))
+                data.append(Spacer(1, 8))
+                contenttable = render_table_data(tableheader[i],tabledata[i])
+                data.append(contenttable)
 
         # Insert signatures
