Changeset 13617 for main


Ignore:
Timestamp:
15 Jan 2016, 15:34:03 (9 years ago)
Author:
Henrik Bettermann
Message:

Add DegreeSource? and degree field to Certificate. Plugins must be updated!

Location:
main/waeup.kofa/trunk
Files:
1 added
8 edited

Legend:

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

    r13613 r13617  
    55=======================
    66
    7 * (No changes yet)
     7* Add DegreeSource and degree field to Certificate. Plugins must be updated!
    88
    99
  • main/waeup.kofa/trunk/src/waeup/kofa/app.py

    r13214 r13617  
    8181        """Lookup all plugins and call their `update()` method.
    8282        """
    83         # XXX: TBD: Remove update() in all plugins but documents and users
    8483        getUtility(IKofaPluggable, name='documents').update(
    8584            self, 'documents', self.logger)
     
    8887        getUtility(IKofaPluggable, name='applicants').update(
    8988            self, 'applicants', self.logger)
     89        getUtility(IKofaPluggable, name='certificates').update(
     90            self, 'certificates', self.logger)
    9091        return
    9192attrs_to_fields(University)
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r13608 r13617  
    580580    def _set_inst_types(self):
    581581        study_modes = getUtility(IKofaUtils).INST_TYPES_DICT
    582         self.inst_types = study_modes.items()
     582        self.inst_types = sorted(study_modes.items())
    583583        return
    584584
     
    603603    def _set_study_modes(self):
    604604        study_modes = getUtility(IKofaUtils).STUDY_MODES_DICT
    605         self.study_modes = study_modes.items()
     605        self.study_modes = sorted(study_modes.items())
     606        return
     607
     608    def _set_degrees(self):
     609        degrees = getUtility(IKofaUtils).DEGREES_DICT
     610        self.degrees = sorted(degrees.items())
    606611        return
    607612
     
    613618    def _set_verdicts(self):
    614619        verdicts = getUtility(IKofaUtils).VERDICTS_DICT
    615         self.verdicts = verdicts.items()
     620        self.verdicts = sorted(verdicts.items())
    616621        return
    617622
     
    660665        self._set_study_levels()
    661666        self._set_study_modes()
     667        self._set_degrees()
    662668        self._set_student_states()
    663669        self._set_verdicts()
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py

    r13434 r13617  
    925925    title = _('Study Modes')
    926926
     927class DegreeSource(InstTypesSource):
     928    """Available study modes for the sources overview page.
     929    """
     930    grok.order(6)
     931    name = 'Degrees'
     932    source_name = 'degrees'
     933    title = _('Degrees')
     934
    927935class PaymentCatsSource(InstTypesSource):
    928936    """Available payment categories for the sources overview page.
    929937    """
    930     grok.order(6)
     938    grok.order(7)
    931939    name = 'PaymentCats'
    932940    source_name = 'payment_cats'
     
    936944    """Available application types for the sources overview page.
    937945    """
    938     grok.order(7)
     946    grok.order(8)
    939947    name = 'AppTypes'
    940948    source_name = 'app_types'
     
    944952    """Available application categories for the sources overview page.
    945953    """
    946     grok.order(8)
     954    grok.order(9)
    947955    name = 'AppCats'
    948956    source_name = 'app_cats'
  • main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.py

    r12620 r13617  
    5959                 school_fee_1=None, school_fee_2=None,
    6060                 school_fee_3=None, school_fee_4=None,
    61                  ratio=None,
     61                 ratio=None, degree=None,
    6262                 custom_textline_1=None, custom_textline_2=None,
    6363                 custom_float_1=None, custom_float_2=None):
     
    7474        self.school_fee_4 = school_fee_4
    7575        self.ratio = ratio
     76        self.degree = degree
    7677        self.custom_textline_1 = custom_textline_1
    7778        self.custom_textline_2 = custom_textline_2
  • main/waeup.kofa/trunk/src/waeup/kofa/university/interfaces.py

    r13399 r13617  
    3030    InstTypeSource,
    3131    SemesterSource,
     32    DegreeSource,
    3233    )
    3334
     
    173174        default = u'ug_ft',
    174175        required = True,
     176        )
     177
     178    degree = schema.Choice(
     179        title = _(u'Degree'),
     180        source = DegreeSource(),
     181        required = False,
    175182        )
    176183
  • main/waeup.kofa/trunk/src/waeup/kofa/university/vocabularies.py

    r12862 r13617  
    6868    DICT_NAME = 'STUDY_MODES_DICT'
    6969
     70class DegreeSource(ContextualDictSourceFactoryBase):
     71    """A source for certificate degrees
     72    """
     73    #: name of dict to deliver from kofa utils.
     74    DICT_NAME = 'DEGREES_DICT'
     75
     76    def getTitle(self, context, value):
     77        utils = getUtility(IKofaUtils)
     78        return "%s (%s)" % (getattr(utils, self.DICT_NAME)[value], value)
     79
    7080class CourseSource(BasicSourceFactory):
    7181    """A course source delivers all courses inside the portal by looking
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py

    r13492 r13617  
    2929from waeup.kofa.smtp import send_mail as send_mail_internally
    3030from waeup.kofa.utils.helpers import get_sorted_preferred
     31from waeup.kofa.utils.degrees import DEGREES_DICT
    3132
    3233
     
    8788    #: (e.g. object histories) pdf slips.
    8889    PORTAL_LANGUAGE = 'en'
     90
     91    DEGREES_DICT = DEGREES_DICT
    8992
    9093    PREFERRED_LANGUAGES_DICT = {
Note: See TracChangeset for help on using the changeset viewer.