Ignore:
Timestamp:
4 Nov 2013, 09:19:39 (11 years ago)
Author:
Henrik Bettermann
Message:

Add Admission Notification Slip. The notification can be downloaded before payment, the slip after payment of school fee.

The difference between an admission slip/letter and a notification is still not clear.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/viewlets.py

    r9873 r10691  
    1717##
    1818
     19import grok
    1920from waeup.kofa.students.viewlets import (
    20     AddPreviousPaymentActionButton, AddBalancePaymentActionButton)
     21    AddPreviousPaymentActionButton, AddBalancePaymentActionButton,
     22    ManageActionButton)
     23from waeup.kofa.students.interfaces import IStudent
     24from waeup.kofa.students.browser import StudentBaseDisplayFormPage
     25from waeup.kofa.students.workflow import (
     26    ADMITTED, PAID, REQUESTED, RETURNING, CLEARED, REGISTERED,
     27    VALIDATED, GRADUATED, TRANSCRIPT, CREATED, CLEARANCE)
     28from waeup.kwarapoly.interfaces import MessageFactory as _
    2129
    2230class AddPreviousPaymentActionButton(AddPreviousPaymentActionButton):
     
    3139    def target_url(self):
    3240        return ''
     41
     42class AdmissionNotificationActionButton(ManageActionButton):
     43    grok.order(4)
     44    grok.context(IStudent)
     45    grok.view(StudentBaseDisplayFormPage)
     46    grok.require('waeup.viewStudent')
     47    icon = 'actionicon_pdf.png'
     48    text = _('Download admission notification')
     49    target = 'admission_notification.pdf'
     50
     51    @property
     52    def target_url(self):
     53        if self.context.state not in (ADMITTED, CLEARANCE, REQUESTED, CLEARED):
     54            return ''
     55        return self.view.url(self.view.context, self.target)
     56
     57class AdmissionSlipActionButton(ManageActionButton):
     58    grok.order(4)
     59    grok.context(IStudent)
     60    grok.view(StudentBaseDisplayFormPage)
     61    grok.require('waeup.viewStudent')
     62    icon = 'actionicon_pdf.png'
     63    text = _('Download admission letter')
     64    target = 'admission_slip.pdf'
     65
     66    @property
     67    def target_url(self):
     68        if self.context.state in (CREATED, ADMITTED,
     69                                  CLEARANCE, REQUESTED, CLEARED):
     70            return ''
     71        return self.view.url(self.view.context, self.target)
Note: See TracChangeset for help on using the changeset viewer.