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).

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

Legend:

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

    r11254 r11535  
    503503    prefix = 'form'
    504504
    505     omit_fields = ('date_of_birth',)
     505    omit_fields = ('date_of_birth', 'current_level')
    506506
    507507    form_fields = grok.AutoFields(IStudentBase).select('student_id', 'reg_number')
     
    677677        'suspended', 'phone',
    678678        'adm_code', 'suspended_comment',
    679         'date_of_birth')
     679        'date_of_birth', 'current_level')
    680680
    681681    @property
     
    12161216        'department', 'faculty', 'current_mode', 'entry_session', 'certificate',
    12171217        'password', 'suspended', 'phone', 'email',
    1218         'adm_code', 'suspended_comment')
     1218        'adm_code', 'suspended_comment', 'current_level')
    12191219
    12201220    def update(self):
     
    13661366    omit_fields = (
    13671367        'password', 'suspended', 'phone', 'date_of_birth',
    1368         'adm_code', 'sex', 'suspended_comment')
     1368        'adm_code', 'sex', 'suspended_comment', 'current_level')
    13691369
    13701370    @property
     
    18951895    omit_fields = (
    18961896        'password', 'suspended', 'phone', 'date_of_birth',
    1897         'adm_code', 'sex', 'suspended_comment')
     1897        'adm_code', 'sex', 'suspended_comment', 'current_level')
    18981898
    18991899    @property
     
    21422142    omit_fields = (
    21432143        'password', 'suspended', 'phone', 'adm_code',
    2144         'suspended_comment', 'date_of_birth')
     2144        'suspended_comment', 'date_of_birth', 'current_level')
    21452145
    21462146    @property
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r11451 r11535  
    34413441            'automatic,carry_over,code,credits,dcode,fcode,level,'
    34423442            'level_session,mandatory,passmark,score,semester,title,'
    3443             'student_id,certcode\r\n1,0,COURSE1,10,dep1,fac1,100,2004,1,40,,1,'
    3444             'Unnamed Course,K1000000,CERT1\r\n')
     3443            'student_id,certcode,display_fullname\r\n1,0,COURSE1,10,'
     3444            'dep1,fac1,100,2004,1,40,,1,'
     3445            'Unnamed Course,K1000000,CERT1,Anna Tester\r\n')
    34453446
    34463447        self.assertEqual(len(self.app['datacenter'].running_exports), 1)
  • 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.