Ignore:
Timestamp:
25 Mar 2014, 06:50:08 (11 years ago)
Author:
Henrik Bettermann
Message:

Allow adding current_level to base data section on all student slips (requested by Uniben).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r11452 r11535  
    3535from waeup.kofa.students.interfaces import IStudentsUtils
    3636from waeup.kofa.students.workflow import ADMITTED
     37from waeup.kofa.students.vocabularies import StudyLevelSource
    3738from waeup.kofa.browser.pdf import (
    3839    ENTRY1_STYLE, format_html, NOTE_STYLE, HEADING_STYLE,
     
    166167        if not 'current_mode' in omit_fields:
    167168            studymodes_dict = getUtility(IKofaUtils).STUDY_MODES_DICT
    168             sm = studymodes_dict[studentview.context[
    169                 'studycourse'].certificate.study_mode]
     169            sm = studymodes_dict[studentview.context.current_mode]
    170170            f_label = trans(_('Study Mode:'), lang)
    171171            f_label = Paragraph(f_label, ENTRY1_STYLE)
     
    176176            f_label = trans(_('Entry Session:'), lang)
    177177            f_label = Paragraph(f_label, ENTRY1_STYLE)
    178             entry_session = studentview.context['studycourse'].entry_session
     178            entry_session = studentview.context.entry_session
    179179            entry_session = academic_sessions_vocab.getTerm(entry_session).title
    180180            f_text = formatted_text(entry_session)
     181            f_text = Paragraph(f_text, ENTRY1_STYLE)
     182            data_right.append([f_label,f_text])
     183        # Requested by Uniben, does not really make sense
     184        if not 'current_level' in omit_fields:
     185            f_label = trans(_('Current Level:'), lang)
     186            f_label = Paragraph(f_label, ENTRY1_STYLE)
     187            current_level = studentview.context['studycourse'].current_level
     188            studylevelsource = StudyLevelSource().factory
     189            current_level = studylevelsource.getTitle(
     190                studentview.context, current_level)
     191            f_text = formatted_text(current_level)
    181192            f_text = Paragraph(f_text, ENTRY1_STYLE)
    182193            data_right.append([f_label,f_text])
Note: See TracChangeset for help on using the changeset viewer.