Changeset 9141


Ignore:
Timestamp:
1 Sep 2012, 07:15:42 (12 years ago)
Author:
Henrik Bettermann
Message:

Adjust student base data section on slips. Display certificate code and full name.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r9078 r9141  
    545545    grok.name('base')
    546546    form_fields = grok.AutoFields(IApplicant).select(
    547         'applicant_id', 'firstname', 'lastname','email', 'course1')
     547        'applicant_id','email', 'course1')
    548548
    549549class CreateStudentPage(UtilityView, grok.View):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r9140 r9141  
    316316        return _('unset')
    317317
     318class StudentBasePDFFormPage(KofaDisplayFormPage):
     319    """ Page to display student base data in pdf files.
     320    """
     321    form_fields = grok.AutoFields(IStudentBase).omit(
     322        'password', 'suspended', 'phone', 'adm_code', 'sex')
     323
    318324class ContactStudentForm(ContactAdminForm):
    319325    grok.context(IStudent)
     
    525531
    526532    def render(self):
    527         studentview = StudentBaseDisplayFormPage(self.context.student,
     533        studentview = StudentBasePDFFormPage(self.context.student,
    528534            self.request)
    529535        students_utils = getUtility(IStudentsUtils)
     
    913919        Mand = translate(_('Mand.'), 'waeup.kofa', target_language=portal_language)
    914920        Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language)
    915         studentview = StudentBaseDisplayFormPage(self.context.student,
     921        studentview = StudentBasePDFFormPage(self.context.student,
    916922            self.request)
    917923        students_utils = getUtility(IStudentsUtils)
     
    13041310        #    self.redirect(self.url(self.context))
    13051311        #    return
    1306         studentview = StudentBaseDisplayFormPage(self.context.student,
     1312        studentview = StudentBasePDFFormPage(self.context.student,
    13071313            self.request)
    13081314        students_utils = getUtility(IStudentsUtils)
     
    15241530
    15251531    def render(self):
    1526         studentview = StudentBaseDisplayFormPage(self.context.student,
     1532        studentview = StudentBasePDFFormPage(self.context.student,
    15271533            self.request)
    15281534        students_utils = getUtility(IStudentsUtils)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r9069 r9141  
    117117    #data.append([Spacer(1, 12)])
    118118    portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
     119
     120    f_label = formatted_label(size=12) % _('Name')
     121    f_label = Paragraph(f_label, style["Normal"])
     122    f_text = formatted_text(studentview.context.display_fullname, size=12)
     123    f_text = Paragraph(f_text, style["Normal"])
     124    data_right.append([f_label,f_text])
     125
    119126    for widget in studentview.widgets:
    120         if widget.name == 'form.adm_code':
     127        if 'name' in widget.name:
    121128            continue
    122129        f_label = formatted_label(size=12) % translate(
     
    127134        f_text = Paragraph(f_text, style["Normal"])
    128135        data_right.append([f_label,f_text])
     136
     137    if hasattr(studentview.context, 'certcode'):
     138        f_label = formatted_label(size=12) % _('Study Course')
     139        f_label = Paragraph(f_label, style["Normal"])
     140        f_text = formatted_text(studentview.context.certcode, size=12)
     141        f_text = Paragraph(f_text, style["Normal"])
     142        data_right.append([f_label,f_text])
     143
    129144    table_left = Table(data_left,style=SLIP_STYLE)
    130145    table_right = Table(data_right,style=SLIP_STYLE, colWidths=[5*cm, 6*cm])
Note: See TracChangeset for help on using the changeset viewer.