Ignore:
Timestamp:
30 Dec 2014, 17:47:58 (10 years ago)
Author:
Henrik Bettermann
Message:

First batch of UI improvements.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/customers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py

    r12345 r12346  
    685685        return
    686686
     687    @action(_('Cancel'), validator=NullValidator)
     688    def cancel(self, **data):
     689        self.redirect(self.url(self.context))
     690
    687691
    688692class CustomerChangePasswordPage(IkobaEditFormPage):
     
    711715                self.flash(' '.join(errors), type="warning")
    712716        return
     717
     718    @action(_('Cancel'), validator=NullValidator)
     719    def cancel(self, **data):
     720        self.redirect(self.url(self.context))
     721
    713722
    714723class CustomerBasePDFFormPage(IkobaDisplayFormPage):
     
    12261235    pnav = 4
    12271236
    1228     form_fields = grok.AutoFields(IContract).select('product_object')
     1237    form_fields = grok.AutoFields(IContractEdit).select('product_object')
    12291238
    12301239    def update(self):
     
    12931302    def save(self, **data):
    12941303        msave(self, **data)
     1304        return
     1305
     1306    @action(_('Final Submit'), warning=WARNING)
     1307    def finalsubmit(self, **data):
     1308        msave(self, **data)
     1309        IWorkflowInfo(self.context).fireTransition('submit')
     1310        self.flash(_('Form has been submitted.'))
     1311        self.redirect(self.url(self.context))
    12951312        return
    12961313
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/contracts.py

    r12337 r12346  
    6161    """This is a customer contract baseclass.
    6262    """
     63    grok.implements(IContractEdit)  # Necesary for the selectproduct page
    6364
    6465    grok.baseclass()
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/viewlets.py

    r12337 r12346  
    2020from zope.i18n import translate
    2121from zope.interface import Interface
     22from zope.component import getUtility
    2223from waeup.ikoba.interfaces import IIkobaObject
    2324from waeup.ikoba.interfaces import MessageFactory as _
     
    2829    ICustomer, ICustomersContainer,
    2930    ICustomerDocumentsContainer, ICustomerDocument,
    30     IContractsContainer, IContract)
     31    IContractsContainer, IContract, ICustomersUtils)
    3132from waeup.ikoba.customers.browser import (
    3233    CustomersContainerPage, CustomersContainerManagePage,
     
    297298    target = 'change_portrait'
    298299
     300    @property
     301    def target_url(self):
     302        CUSTMANAGE_STATES = getUtility(
     303            ICustomersUtils).CUSTMANAGE_CUSTOMER_STATES
     304        if self.context.state not in CUSTMANAGE_STATES:
     305            return ''
     306        return self.view.url(self.view.context, self.target)
     307
    299308
    300309# Viewlets for customer documents
Note: See TracChangeset for help on using the changeset viewer.