Changeset 12526


Ignore:
Timestamp:
30 Jan 2015, 14:02:53 (10 years ago)
Author:
Henrik Bettermann
Message:

Extend customer registration workflow.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba
Files:
5 edited

Legend:

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

    r12517 r12526  
    3838    IContactForm, IObjectHistory, IIkobaObject, IIkobaUtils,
    3939    IPasswordValidator, IUserAccount,
    40     VERIFIED, REJECTED, EXPIRED, CREATED, REQUESTED, APPROVED)
     40    VERIFIED, REJECTED, EXPIRED, CREATED, REQUESTED, APPROVED, PROVISIONALLY)
    4141from waeup.ikoba.browser.layout import (
    4242    IkobaPage, IkobaEditFormPage, IkobaAddFormPage, IkobaDisplayFormPage,
     
    322322    @property
    323323    def is_requestable(self):
    324         if self.context.state in (REQUESTED, APPROVED):
     324        if self.context.state in (REQUESTED, PROVISIONALLY, APPROVED):
    325325            return False
    326326        return True
     
    717717    @property
    718718    def form_fields(self):
    719         if self.context.state in (REQUESTED, APPROVED):
     719        if self.context.state in (REQUESTED, PROVISIONALLY, APPROVED):
    720720            return grok.AutoFields(ICustomer).select('email', 'phone')
    721721        return grok.AutoFields(ICustomer).omit(
     
    728728
    729729    def is_requestable(self, action=None):
    730         if self.context.state in (REQUESTED, APPROVED):
     730        if self.context.state in (REQUESTED, PROVISIONALLY, APPROVED):
    731731            return False
    732732        return True
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12524 r12526  
    407407        self.browser.getControl("Apply").click()
    408408        self.browser.open(self.trigtrans_path)
    409         self.browser.getControl(name="transition").value = ['approve']
     409        self.browser.getControl(name="transition").value = ['approve_provisionally']
     410        self.browser.getControl("Apply").click()
     411        self.browser.open(self.trigtrans_path)
     412        self.browser.getControl(name="transition").value = ['approve_finally']
    410413        self.browser.getControl("Apply").click()
    411414        self.browser.open(self.trigtrans_path)
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/utils.py

    r12491 r12526  
    3838from waeup.ikoba.interfaces import (
    3939    STARTED, CREATED, REQUESTED, APPROVED, SUBMITTED, VERIFIED, REJECTED,
    40     EXPIRED,
     40    EXPIRED, PROVISIONALLY,
    4141    IIkobaUtils, IExtFileStore)
    4242from waeup.ikoba.customers.interfaces import ICustomersUtils
     
    290290    CUSTMANAGE_CUSTOMER_STATES = (STARTED,)
    291291
    292     DOCMANAGE_CUSTOMER_STATES = (REQUESTED, APPROVED,)
     292    DOCMANAGE_CUSTOMER_STATES = (REQUESTED, APPROVED, PROVISIONALLY)
    293293
    294294    DOCMANAGE_DOCUMENT_STATES = (CREATED,)
     
    303303        REQUESTED: _('requested'),
    304304        APPROVED: _('approved'),
     305        PROVISIONALLY: _('provisionally approved'),
    305306        }
    306307
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/workflow.py

    r12221 r12526  
    2626from waeup.ikoba.interfaces import (
    2727    IObjectHistory, IIkobaWorkflowInfo, IIkobaUtils,
    28     STARTED, CREATED, REQUESTED, APPROVED,
     28    STARTED, CREATED, REQUESTED, PROVISIONALLY, APPROVED,
    2929    SUBMITTED, VERIFIED, REJECTED, EXPIRED)
    3030from waeup.ikoba.interfaces import MessageFactory as _
     
    6565
    6666    Transition(
     67        transition_id = 'approve_provisionally',
     68        title = _('Approve customer provisionally'),
     69        msg = _('Customer registration provisionally approved'),
     70        source = REQUESTED,
     71        destination = PROVISIONALLY),
     72
     73    Transition(
     74        transition_id = 'approve_finally',
     75        title = _('Approve finally'),
     76        msg = _('Customer registration finally approved'),
     77        source = PROVISIONALLY,
     78        destination = APPROVED),
     79
     80    Transition(
    6781        transition_id = 'approve',
    6882        title = _('Approve customer'),
     
    98112        source = REQUESTED,
    99113        destination = STARTED),
     114
     115    Transition(
     116        transition_id = 'reset4',
     117        title = _('Reset customer'),
     118        msg = _('Reset to initial customer state'),
     119        source = PROVISIONALLY,
     120        destination = STARTED),
     121
     122    Transition(
     123        transition_id = 'reset5',
     124        title = _('Reset to requested'),
     125        msg = _("Reset to 'requested'"),
     126        source = PROVISIONALLY,
     127        destination = REQUESTED),
    100128
    101129    )
  • main/waeup.ikoba/trunk/src/waeup/ikoba/interfaces.py

    r12522 r12526  
    5151STARTED = 'started'
    5252REQUESTED = 'requested'
     53PROVISIONALLY = 'provisionally'
    5354APPROVED = 'approved'
    5455
Note: See TracChangeset for help on using the changeset viewer.