Ignore:
Timestamp:
3 Nov 2012, 18:47:31 (12 years ago)
Author:
Henrik Bettermann
Message:

Clearly separate current and previous session payment browser components.

File:
1 edited

Legend:

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

    r9452 r9517  
    4343    CourseTicketDisplayFormPage, OnlinePaymentDisplayFormPage,
    4444    AccommodationManageFormPage, BedTicketDisplayFormPage,
    45     StudentClearanceEditFormPage, StudentPersonalEditFormPage)
     45    StudentClearanceEditFormPage, StudentPersonalEditFormPage,
     46    PaymentsManageFormPage)
    4647from waeup.kofa.students.interfaces import (
    4748    IStudentsContainer, IStudent, IStudentStudyCourse, IStudentAccommodation,
    4849    IStudentStudyLevel, ICourseTicket, IStudentOnlinePayment, IBedTicket,
     50    IStudentPaymentsContainer,
    4951    )
    5052from waeup.kofa.utils.helpers import get_fileformat
     
    589591            return self.view.url(self.view.context, self.target)
    590592        return ''
     593
     594class AddPaymentActionButton(AddActionButton):
     595    grok.order(1)
     596    grok.context(IStudentPaymentsContainer)
     597    grok.view(PaymentsManageFormPage)
     598    grok.require('waeup.payStudent')
     599    text = _('Add current session payment ticket')
     600    target = 'addop'
     601
     602class AddPreviousPaymentActionButton(AddActionButton):
     603    grok.order(2)
     604    grok.context(IStudentPaymentsContainer)
     605    grok.view(PaymentsManageFormPage)
     606    grok.require('waeup.payStudent')
     607    text = _('Add previous session payment ticket')
     608    target = 'addpp'
     609
     610    @property
     611    def target_url(self):
     612        student = self.view.context.student
     613        if student.is_fresh:
     614            return ''
     615        return self.view.url(self.view.context, self.target)
    591616
    592617class StudentsTab(PrimaryNavTab):
Note: See TracChangeset for help on using the changeset viewer.