Ignore:
Timestamp:
5 Feb 2020, 22:34:10 (5 years ago)
Author:
Henrik Bettermann
Message:

Provide two ExportPDFExaminationClearanceSlip pages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/browser.py

    r15985 r15989  
    206206    form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit('level')
    207207
    208 class ExportPDFExaminationClearanceSlip(CustomExportPDFCourseRegistrationSlip):
    209     """Deliver a PDF slip of the context.
    210     """
    211 
    212     grok.name('examination_clearance_slip.pdf')
    213 
     208class ExportPDFExaminationClearanceSlip1(CustomExportPDFCourseRegistrationSlip):
     209    """Deliver a PDF slip of the context.
     210    """
     211    grok.name('examination_clearance_slip_1.pdf')
    214212    form_fields = None
    215 
    216213    omit_fields = (
    217214        'password', 'suspended', 'phone', 'date_of_birth',
     
    219216        'adm_code', 'sex', 'suspended_comment',
    220217        'flash_notice')
    221 
    222     @property
    223     def label(self):
    224         return '%s Examination Clearance' % self.context.level_session
     218    semester = 1
     219    tabletitle =  ['', '', '']
     220
     221    @property
     222    def label(self):
     223        return '%s First Semester Examination Clearance' % self.context.level_session
    225224
    226225    @property
     
    234233            self.redirect(self.url(self.context))
    235234
    236     @property
    237     def tabletitle(self):
    238         portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    239         tabletitle = []
    240         tabletitle.append(translate(_('1st Semester Courses'), 'waeup.kofa',
    241             target_language=portal_language))
    242         tabletitle.append('_PB_' + translate(_('2nd Semester Courses'), 'waeup.kofa',
    243             target_language=portal_language))
    244         tabletitle.append(translate(_('Level Courses'), 'waeup.kofa',
    245             target_language=portal_language))
    246         return tabletitle
    247 
    248235    def render(self):
    249236        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    250237        Code = translate('Code', 'waeup.kofa', target_language=portal_language)
    251         #Title = translate('Title', 'waeup.kofa', target_language=portal_language)
    252         #Dept = translate('Dept.', 'waeup.kofa', target_language=portal_language)
    253         #Faculty = translate('Faculty', 'waeup.kofa', target_language=portal_language)
    254         #Cred = translate(_('Credits'), 'waeup.uniben', target_language=portal_language)
    255         #Grade = translate('Grade', 'waeup.kofa', target_language=portal_language)
    256238        studentview = StudentBasePDFFormPage(self.context.student,
    257239            self.request, self.omit_fields)
     
    262244        for i in range(1,7):
    263245            tabledata.append(sorted(
    264                 [value for value in self.context.values() if value.semester == i],
    265                 key=lambda value: str(value.semester) + value.code))
     246                [value for value in self.context.values() if i == self.semester == value.semester],
     247                key=lambda value: value.code))
    266248            tableheader.append([(Code,'code', 2.5),
    267                              #(Title,'title', 5),
    268                              #(Dept,'dcode', 1.5), (Faculty,'fcode', 1.5),
    269                              #(Cred, 'credits', 1.5),
    270                              ('Signature','sig', 10),
     249                             ('Invigilator\'s Name','inv', 8),
     250                             ('Signature','sig', 7),
    271251                             ])
    272252        return students_utils.renderPDF(
    273             self, 'examination_clearance_slip.pdf',
     253            self, 'examination_clearance_slip_%s.pdf' % self.semester,
    274254            self.context.student, studentview,
    275255            tableheader=tableheader,
    276256            tabledata=tabledata,
    277257            omit_fields=self.omit_fields,
    278             topMargin=1.1
     258            topMargin=1.3
    279259            )
    280260
     261class ExportPDFExaminationClearanceSlip2(ExportPDFExaminationClearanceSlip1):
     262    """Deliver a PDF slip of the context.
     263    """
     264    grok.name('examination_clearance_slip_2.pdf')
     265    semester = 2
     266
     267    @property
     268    def label(self):
     269        return '%s Second Semester Examination Clearance' % self.context.level_session
    281270
    282271class CustomPaymentsManageFormPage(PaymentsManageFormPage):
Note: See TracChangeset for help on using the changeset viewer.