Ignore:
Timestamp:
13 Jul 2016, 04:36:41 (8 years ago)
Author:
Henrik Bettermann
Message:

AAUE applicants are not allowed to remove payment tickets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/browser.py

    r14017 r14027  
    2222from zope.component import getUtility, getAdapter
    2323from zope.i18n import translate
     24from hurry.workflow.interfaces import IWorkflowState
    2425from waeup.kofa.interfaces import (
    2526    IExtFileStore, IFileStoreNameChooser, IKofaUtils)
     
    2829from waeup.kofa.applicants.browser import (
    2930    ApplicantCheckStatusPage, ApplicantBaseDisplayFormPage)
     31from waeup.kofa.applicants.workflow import STARTED, PAID
    3032from waeup.kofa.applicants.viewlets import PDFActionButton
    3133from waeup.kofa.browser.layout import UtilityView
     
    300302    grok.template('applicanteditpage')
    301303
     304    def unremovable(self, ticket):
     305        return True
     306
     307    # AAUE applicants never see the 'Remove Selected Tickets' button.
     308    @property
     309    def display_actions(self):
     310        state = IWorkflowState(self.context).getState()
     311        # If the form is unlocked, applicants are allowed to save the form
     312        actions = [[_('Save')],]
     313        # Only in state started they can also add tickets.
     314        if state == STARTED:
     315            actions = [[_('Save')], [_('Add online payment ticket'),]]
     316        # In state paid, they can submit the data and further add tickets
     317        # if the application is special.
     318        elif self.context.special and state == PAID:
     319            actions = [[_('Save'), _('Finally Submit')],
     320                [_('Add online payment ticket'),]]
     321        elif state == PAID:
     322            actions = [[_('Save'), _('Finally Submit')],]
     323        return actions
     324
    302325    @property
    303326    def form_fields(self):
Note: See TracChangeset for help on using the changeset viewer.