Ignore:
Timestamp:
8 Mar 2012, 22:28:46 (13 years ago)
Author:
Henrik Bettermann
Message:

KOFA -> Kofa

File:
1 edited

Legend:

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

    r7811 r7819  
    3333from waeup.kofa.accesscodes.workflow import USED
    3434from waeup.kofa.browser import (
    35     KOFAPage, KOFAEditFormPage, KOFAAddFormPage, KOFADisplayFormPage,
    36     ContactAdminForm, KOFAForm)
     35    KofaPage, KofaEditFormPage, KofaAddFormPage, KofaDisplayFormPage,
     36    ContactAdminForm, KofaForm)
    3737from waeup.kofa.browser.interfaces import ICaptchaManager
    3838from waeup.kofa.browser.breadcrumbs import Breadcrumb
     
    4040from waeup.kofa.browser.layout import jsaction, action, UtilityView
    4141from waeup.kofa.interfaces import (
    42     IKOFAObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm,
    43     IKOFAUtils, IUniversity)
     42    IKofaObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm,
     43    IKofaUtils, IUniversity)
    4444from waeup.kofa.interfaces import MessageFactory as _
    4545from waeup.kofa.widgets.datewidget import (
     
    155155    @property
    156156    def title(self):
    157         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     157        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    158158        # There is no request attribute, thus we can only translate
    159159        # to the default (portal) language
     
    161161            target_language=portal_language)
    162162
    163 class StudentsContainerPage(KOFAPage):
     163class StudentsContainerPage(KofaPage):
    164164    """The standard view for student containers.
    165165    """
     
    194194        return
    195195
    196 class StudentsContainerManagePage(KOFAPage):
     196class StudentsContainerManagePage(KofaPage):
    197197    """The manage page for student containers.
    198198    """
     
    245245        return
    246246
    247 class StudentAddFormPage(KOFAAddFormPage):
     247class StudentAddFormPage(KofaAddFormPage):
    248248    """Add-form to add a student.
    249249    """
     
    265265        return
    266266
    267 class StudentBaseDisplayFormPage(KOFADisplayFormPage):
     267class StudentBaseDisplayFormPage(KofaDisplayFormPage):
    268268    """ Page to display student base data
    269269    """
     
    310310        usertype = getattr(self.request.principal,
    311311                           'user_type', 'system').title()
    312         kofa_utils = getUtility(IKOFAUtils)
     312        kofa_utils = getUtility(IKofaUtils)
    313313        success = kofa_utils.sendContactForm(
    314314                self.request.principal.title,email,
     
    323323        return
    324324
    325 class StudentBaseManageFormPage(KOFAEditFormPage):
     325class StudentBaseManageFormPage(KofaEditFormPage):
    326326    """ View to manage student base data
    327327    """
     
    388388        return
    389389
    390 class StudentClearanceDisplayFormPage(KOFADisplayFormPage):
     390class StudentClearanceDisplayFormPage(KofaDisplayFormPage):
    391391    """ Page to display student clearance data
    392392    """
     
    415415    @property
    416416    def title(self):
    417         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     417        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    418418        return translate(_('Clearance Data'), 'waeup.kofa',
    419419            target_language=portal_language)
     
    421421    @property
    422422    def label(self):
    423         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     423        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    424424        return translate(_('Clearance Slip of '),
    425425            'waeup.kofa', target_language=portal_language) \
     
    434434            self.context.getStudent(), studentview)
    435435
    436 class StudentClearanceManageFormPage(KOFAEditFormPage):
     436class StudentClearanceManageFormPage(KofaEditFormPage):
    437437    """ Page to edit student clearance data
    438438    """
     
    508508        return
    509509
    510 class StudentPersonalDisplayFormPage(KOFADisplayFormPage):
     510class StudentPersonalDisplayFormPage(KofaDisplayFormPage):
    511511    """ Page to display student personal data
    512512    """
     
    523523            mapping = {'a':self.context.display_fullname})
    524524
    525 class StudentPersonalManageFormPage(KOFAEditFormPage):
     525class StudentPersonalManageFormPage(KofaEditFormPage):
    526526    """ Page to edit student clearance data
    527527    """
     
    538538        return
    539539
    540 class StudyCourseDisplayFormPage(KOFADisplayFormPage):
     540class StudyCourseDisplayFormPage(KofaDisplayFormPage):
    541541    """ Page to display the student study course data
    542542    """
     
    556556    def current_mode(self):
    557557        if self.context.certificate is not None:
    558             studymodes_dict = getUtility(IKOFAUtils).getStudyModesDict()
     558            studymodes_dict = getUtility(IKofaUtils).getStudyModesDict()
    559559            return studymodes_dict[self.context.certificate.study_mode]
    560560        return
     
    572572        return
    573573
    574 class StudyCourseManageFormPage(KOFAEditFormPage):
     574class StudyCourseManageFormPage(KofaEditFormPage):
    575575    """ Page to edit the student study course data
    576576    """
     
    645645        return
    646646
    647 class StudyLevelDisplayFormPage(KOFADisplayFormPage):
     647class StudyLevelDisplayFormPage(KofaDisplayFormPage):
    648648    """ Page to display student study levels
    649649    """
     
    662662    @property
    663663    def label(self):
    664         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     664        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    665665        lang = self.request.cookies.get('kofa.language', portal_language)
    666666        level_title = translate(self.context.level_title, 'waeup.kofa',
     
    688688    @property
    689689    def title(self):
    690         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     690        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    691691        return translate(_('Level Data'), 'waeup.kofa',
    692692            target_language=portal_language)
     
    694694    @property
    695695    def content_title(self):
    696         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     696        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    697697        return translate(_('Course List'), 'waeup.kofa',
    698698            target_language=portal_language)
     
    700700    @property
    701701    def label(self):
    702         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     702        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    703703        lang = self.request.cookies.get('kofa.language', portal_language)
    704704        level_title = translate(self.context.level_title, 'waeup.kofa',
     
    709709
    710710    def render(self):
    711         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     711        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    712712        Sem = translate(_('Sem.'), 'waeup.kofa', target_language=portal_language)
    713713        Code = translate(_('Code'), 'waeup.kofa', target_language=portal_language)
     
    735735            tabledata=tabledata)
    736736
    737 class StudyLevelManageFormPage(KOFAEditFormPage):
     737class StudyLevelManageFormPage(KofaEditFormPage):
    738738    """ Page to edit the student study level data
    739739    """
     
    762762    @property
    763763    def label(self):
    764         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     764        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    765765        lang = self.request.cookies.get('kofa.language', portal_language)
    766766        level_title = translate(self.context.level_title, 'waeup.kofa',
     
    853853        return
    854854
    855 class CourseTicketAddFormPage(KOFAAddFormPage):
     855class CourseTicketAddFormPage(KofaAddFormPage):
    856856    """Add a course ticket.
    857857    """
     
    890890        self.redirect(self.url(self.context))
    891891
    892 class CourseTicketDisplayFormPage(KOFADisplayFormPage):
     892class CourseTicketDisplayFormPage(KofaDisplayFormPage):
    893893    """ Page to display course tickets
    894894    """
     
    906906            'b':self.context.code})
    907907
    908 class CourseTicketManageFormPage(KOFAEditFormPage):
     908class CourseTicketManageFormPage(KofaEditFormPage):
    909909    """ Page to manage course tickets
    910910    """
     
    925925        return
    926926
    927 class PaymentsManageFormPage(KOFAEditFormPage):
     927class PaymentsManageFormPage(KofaEditFormPage):
    928928    """ Page to manage the student payments
    929929
     
    982982        self.redirect(self.url(self.context, '@@addop'))
    983983
    984 class OnlinePaymentAddFormPage(KOFAAddFormPage):
     984class OnlinePaymentAddFormPage(KofaAddFormPage):
    985985    """ Page to add an online payment ticket
    986986    """
     
    10391039        return
    10401040
    1041 class OnlinePaymentDisplayFormPage(KOFADisplayFormPage):
     1041class OnlinePaymentDisplayFormPage(KofaDisplayFormPage):
    10421042    """ Page to view an online payment ticket
    10431043    """
     
    11381138
    11391139
    1140 class AccommodationManageFormPage(KOFAEditFormPage):
     1140class AccommodationManageFormPage(KofaEditFormPage):
    11411141    """ Page to manage bed tickets.
    11421142
     
    11951195        return self.actions
    11961196
    1197 class BedTicketAddPage(KOFAPage):
     1197class BedTicketAddPage(KofaPage):
    11981198    """ Page to add an online payment ticket
    11991199    """
     
    12871287            'c':room_nr, 'd':bed_nr,
    12881288            'e':bed.bed_type})
    1289         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     1289        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    12901290        bedticket.bed_coordinates = translate(
    12911291            bc, 'waeup.kofa',target_language=portal_language)
     
    12971297        return
    12981298
    1299 class BedTicketDisplayFormPage(KOFADisplayFormPage):
     1299class BedTicketDisplayFormPage(KofaDisplayFormPage):
    13001300    """ Page to display bed tickets
    13011301    """
     
    13251325    @property
    13261326    def title(self):
    1327         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     1327        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    13281328        return translate(_('Bed Allocation Data'), 'waeup.kofa',
    13291329            target_language=portal_language)
     
    13311331    @property
    13321332    def label(self):
    1333         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     1333        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    13341334        return translate(_('Bed Allocation: '),
    13351335            'waeup.kofa', target_language=portal_language) \
     
    14051405            'c':room_nr, 'd':bed_nr,
    14061406            'e':new_bed.bed_type})
    1407         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     1407        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    14081408        self.context.bed_coordinates = translate(
    14091409            bc, 'waeup.kofa',target_language=portal_language)
     
    14161416        return
    14171417
    1418 class StudentHistoryPage(KOFAPage):
     1418class StudentHistoryPage(KofaPage):
    14191419    """ Page to display student clearance data
    14201420    """
     
    14311431# Pages for students only
    14321432
    1433 class StudentBaseEditFormPage(KOFAEditFormPage):
     1433class StudentBaseEditFormPage(KofaEditFormPage):
    14341434    """ View to edit student base data
    14351435    """
     
    14471447        return
    14481448
    1449 class StudentChangePasswordPage(KOFAEditFormPage):
     1449class StudentChangePasswordPage(KofaEditFormPage):
    14501450    """ View to manage student base data
    14511451    """
     
    14731473        return
    14741474
    1475 class StudentFilesUploadPage(KOFAPage):
     1475class StudentFilesUploadPage(KofaPage):
    14761476    """ View to upload files by student
    14771477    """
     
    14901490        return
    14911491
    1492 class StartClearancePage(KOFAPage):
     1492class StartClearancePage(KofaPage):
    14931493    grok.context(IStudent)
    14941494    grok.name('start_clearance')
     
    15931593        return
    15941594
    1595 class RequestClearancePage(KOFAPage):
     1595class RequestClearancePage(KofaPage):
    15961596    grok.context(IStudent)
    15971597    grok.name('request_clearance')
     
    16241624        return
    16251625
    1626 class StartCourseRegistrationPage(KOFAPage):
     1626class StartCourseRegistrationPage(KofaPage):
    16271627    grok.context(IStudentStudyCourse)
    16281628    grok.name('start_course_registration')
     
    16731673        return
    16741674
    1675 class AddStudyLevelFormPage(KOFAEditFormPage):
     1675class AddStudyLevelFormPage(KofaEditFormPage):
    16761676    """ Page for students to add current study levels
    16771677    """
     
    17101710        return
    17111711
    1712 class StudyLevelEditFormPage(KOFAEditFormPage):
     1712class StudyLevelEditFormPage(KofaEditFormPage):
    17131713    """ Page to edit the student study level data by students
    17141714    """
     
    17321732    @property
    17331733    def label(self):
    1734         portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE
     1734        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    17351735        lang = self.request.cookies.get('kofa.language', portal_language)
    17361736        level_title = translate(self.context.level_title, 'waeup.kofa',
     
    18161816        return
    18171817
    1818 class ChangePasswordRequestPage(KOFAForm):
     1818class ChangePasswordRequestPage(KofaForm):
    18191819    """Captcha'd page for students to request a password change.
    18201820    """
     
    18511851        student = list(results)[0]
    18521852        # Change password
    1853         kofa_utils = getUtility(IKOFAUtils)
     1853        kofa_utils = getUtility(IKofaUtils)
    18541854        pwd = kofa_utils.genPassword()
    18551855        IUserAccount(student).setPassword(pwd)
     
    18661866        return
    18671867
    1868 class SetPasswordPage(KOFAPage):
    1869     grok.context(IKOFAObject)
     1868class SetPasswordPage(KofaPage):
     1869    grok.context(IKofaObject)
    18701870    grok.name('setpassword')
    18711871    grok.require('waeup.Anonymous')
Note: See TracChangeset for help on using the changeset viewer.