Ignore:
Timestamp:
31 Aug 2012, 21:35:09 (12 years ago)
Author:
Henrik Bettermann
Message:

Add StudentTransferFormPage?.

Do not show any button on old studycourse (studycourse_1 or studycourse_2) pages.

File:
1 edited

Legend:

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

    r9124 r9138  
    5252    IUGStudentClearance,IPGStudentClearance,
    5353    IStudentPersonal, IStudentBase, IStudentStudyCourse,
     54    IStudentStudyCourseTransfer,
    5455    IStudentAccommodation, IStudentStudyLevel,
    5556    ICourseTicket, ICourseTicketAdd, IStudentPaymentsContainer,
     
    775776                mapping = {'a':', '.join(deleted)}))
    776777        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
     778        return
     779
     780class StudentTransferFormPage(KofaAddFormPage):
     781    """Page to transfer the student.
     782    """
     783    grok.context(IStudent)
     784    grok.name('transfer')
     785    grok.require('waeup.manageStudent')
     786    label = _('Transfer student')
     787    form_fields = grok.AutoFields(IStudentStudyCourseTransfer).omit(
     788        'entry_mode', 'entry_session')
     789    pnav = 4
     790
     791    def update(self):
     792        super(StudentTransferFormPage, self).update()
     793        warning.need()
     794        return
     795
     796    @jsaction(_('Transfer'))
     797    def transferStudent(self, **data):
     798        error = self.context.transfer(**data)
     799        if error == -1:
     800            self.flash(_('Current level does not match certificate levels.'))
     801        elif error == -2:
     802            self.flash(_('Former study course record incomplete.'))
     803        elif error == -3:
     804            self.flash(_('Maximum number of transfers exceeded.'))
     805        else:
     806            self.flash(_('Successfully transferred.'))
    777807        return
    778808
Note: See TracChangeset for help on using the changeset viewer.