Changeset 14481 for main


Ignore:
Timestamp:
31 Jan 2017, 13:04:51 (8 years ago)
Author:
Henrik Bettermann
Message:

Show correct level on level reports and session results presentations.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r14443 r14481  
    441.4.2.dev0 (unreleased)
    55=======================
     6
     7* Show correct level on level reports and session results presentations.
    68
    79* Get set of selected students also from list of matric numbers.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py

    r14473 r14481  
    194194        self.portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    195195        self.session = academic_sessions_vocab.getTerm(session).title
    196         self.level = translate(self.studylevelsource.getTitle(None, int(level)),
    197             'waeup.kofa', target_language=self.portal_language)
    198196        self.levelcode = level
    199197        self.sessioncode = session
     
    207205                _('All Certificates'), 'waeup.kofa',
    208206                target_language=self.portal_language)
     207            self.level = translate(
     208                self.studylevelsource.getTitle(None, int(level)),
     209                'waeup.kofa', target_language=self.portal_language)
    209210        else:
    210             self.certtitle = site['faculties'][faccode][
    211                 depcode].certificates[certcode].longtitle
     211            certificate = site[
     212                'faculties'][faccode][depcode].certificates[certcode]
     213            self.certtitle = certificate.longtitle
     214            self.level = translate(
     215                self.studylevelsource.getTitle(certificate, int(level)),
     216                'waeup.kofa', target_language=self.portal_language)
    212217        self.author = author
    213218        self.creation_dt_string = self.creation_dt.astimezone(
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/session_results_presentation.py

    r14467 r14481  
    138138        self.portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    139139        self.session = academic_sessions_vocab.getTerm(session).title
    140         if level == 0:
    141             self.level = translate(_('all levels'))
    142         else:
    143             self.level = translate(self.studylevelsource.getTitle(None, int(level)),
    144                 'waeup.kofa', target_language=self.portal_language)
    145140        self.levelcode = level
    146141        self.sessioncode = session
     
    155150                target_language=self.portal_language)
    156151        else:
    157             self.certtitle = site['faculties'][faccode][
    158                 depcode].certificates[certcode].longtitle
     152            certificate = site[
     153                'faculties'][faccode][depcode].certificates[certcode]
     154            self.certtitle = certificate.longtitle
     155        if level == 0:
     156            self.level = translate(_('all levels'))
     157        else:
     158            if self.certcode == 'all':
     159                self.level = translate(
     160                    self.studylevelsource.getTitle(None, int(level)),
     161                    'waeup.kofa', target_language=self.portal_language)
     162            else:
     163                self.level = translate(
     164                    self.studylevelsource.getTitle(certificate, int(level)),
     165                    'waeup.kofa', target_language=self.portal_language)
    159166        self.author = author
    160167        self.creation_dt_string = self.creation_dt.astimezone(
Note: See TracChangeset for help on using the changeset viewer.