Ignore:
Timestamp:
15 Nov 2014, 06:11:20 (10 years ago)
Author:
Henrik Bettermann
Message:

Adjust customer workflow.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/customersitelayout.pt

    r11952 r11964  
    3030    <ul class="nav ikoba-navbar-left">
    3131        <tal:primary_nav content="structure provider:primary_nav" />
     32        <tal:primary_nav content="structure provider:primary_nav_customer" />
    3233    </ul>
    3334    <!-- /Diazo element-->
     
    7172
    7273    <!-- Diazo element-->
     74    <span tal:condition="layout/getCustomerName">
     75      <div class="wfstatus">
     76            <span tal:replace="python:context.customer.customer_id">
     77              Id
     78            </span>
     79            &bull;
     80            <span tal:replace="python:context.customer.translated_state">
     81              State
     82            </span>
     83      </div>
     84    </span>
     85    <!-- /Diazo element-->
     86
     87    <!-- Diazo element-->
    7388    <div class="ikoba-content">
    7489      <div class="actionbar" tal:condition="provider:actionbar">
  • main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/staffsitelayout.pt

    r11952 r11964  
    3030
    3131    <!-- Diazo element-->
    32     <ul class="nav ikoba-navbar-left"> 
     32    <ul class="nav ikoba-navbar-left">
    3333      <tal:primary_nav content="structure provider:primary_nav" />
    3434    </ul>
     
    7373
    7474    <!-- Diazo element-->
     75    <span tal:condition="layout/getCustomerName">
     76      <div class="wfstatus">
     77            <span tal:replace="python:context.customer.customer_id">
     78              Id
     79            </span>
     80            &bull;
     81            <span tal:replace="python:context.customer.translated_state">
     82              State
     83            </span>
     84      </div>
     85    </span>
     86    <!-- /Diazo element-->
     87
     88    <!-- Diazo element-->
    7589    <div class="sidebar well">
     90        <div tal:condition="layout/getCustomerName">
     91          <div class="ikoba-sidebar-title" tal:content="layout/getCustomerName">STUDENTNAME</div>
     92          <ul class="nav">
     93            <tal:left content="structure provider:left_customermanage" />
     94          </ul>
     95        </div>
    7696        <div tal:condition="layout/isAuthenticated">
    7797          <div class="ikoba-sidebar-title" tal:content="layout/getUserTitle">USERNAME</div>
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/batching.py

    r11958 r11964  
    3737from waeup.ikoba.interfaces import (
    3838    IBatchProcessor, FatalCSVError, IObjectConverter, IUserAccount,
    39     IObjectHistory, VALIDATED, REGISTERED, IGNORE_MARKER)
     39    IObjectHistory, IGNORE_MARKER)
    4040from waeup.ikoba.interfaces import IIkobaUtils
    4141from waeup.ikoba.interfaces import MessageFactory as _
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/customer.py

    r11958 r11964  
    3737    IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler,
    3838    IIkobaUtils, registration_states_vocab, IExtFileStore,
    39     CREATED, ADMITTED, CLEARANCE, PAID, REGISTERED, VALIDATED, RETURNING)
     39    CREATED, REQUESTED, APPROVED)
    4040from waeup.ikoba.customers.export import EXPORTER_NAMES
    4141from waeup.ikoba.customers.interfaces import (
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/sample_customer_data.csv

    r11958 r11964  
    11customer_id,firstname,lastname,reg_number,date_of_birth,,phone,sex,state
    2 X666666,Aaren,Pieri,1,1990-01-02,aa@aa.ng,1234,M,courses validated
    3 Y777777,Claus,Finau,2,1990-01-03,aa@aa.ng,1234,m,courses validated
    4 ,Susann,Berson,3,1990-01-04,aa@aa.ng,1234,F,courses validated
    5 ,Else,Mueller,4,1990-01-05,aa@aa.ng,1234,f,school fee paid
    6 X888888,Alfons,Meier,5,1990-01-02,aa@aa.ng,1234,m,courses validated
    7 X999999,Herbert,Mueller,6,1990-01-02,aa@aa.ng,1234,m,courses registered
    8 X111111,Fabian,Riester,7,1990-01-02,aa@aa.ng,1234,m,courses validated
    9 X222222,Thomas,Kinderman,8,1990-01-02,aa@aa.ng,1234,m,courses validated
    10 X333333,Paula,Schall,9,1990-01-02,aa@aa.ng,1234,m,courses registered
     2X666666,Aaren,Pieri,1,1990-01-02,aa@aa.ng,1234,M,requested
     3Y777777,Claus,Finau,2,1990-01-03,aa@aa.ng,1234,m,requested
     4,Susann,Berson,3,1990-01-04,aa@aa.ng,1234,F,requested
     5,Else,Mueller,4,1990-01-05,aa@aa.ng,1234,f,approved
     6X888888,Alfons,Meier,5,1990-01-02,aa@aa.ng,1234,m,requested
     7X999999,Herbert,Mueller,6,1990-01-02,aa@aa.ng,1234,m,approved
     8X111111,Fabian,Riester,7,1990-01-02,aa@aa.ng,1234,m,requested
     9X222222,Thomas,Kinderman,8,1990-01-02,aa@aa.ng,1234,m,requested
     10X333333,Paula,Schall,9,1990-01-02,aa@aa.ng,1234,m,approved
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/sample_customer_data_duplicates.csv

    r11958 r11964  
    11customer_id,firstname,lastname,reg_number,date_of_birth,email,phone,password,sex,state
    2 A123456,Aaren,Pieri,1,1990-01-02#,aa@aa.ng,1234,mypw1,m,clearance started
    3 C123456,Aaren,Berson,2,1990-01-04,aa@aa.ng,1234,mypw1,m,admitted
     2A123456,Aaren,Pieri,1,1990-01-02#,aa@aa.ng,1234,mypw1,m,requested
     3C123456,Aaren,Berson,2,1990-01-04,aa@aa.ng,1234,mypw1,m,approved
    44F123456,Frank,Meyer,1,1990-01-06,aa@aa.ng,1234,,m,
    55A123456,Uli,Schulz,3,1990-01-07,aa@aa.ng,1234,,m,
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/sample_customer_data_update.csv

    r11958 r11964  
    11reg_number,date_of_birth,state
    2 1,1980-01-02,admitted
     21,1980-01-02,approved
    332,1980-01-03,
    443,1980-01-04,
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py

    r11958 r11964  
    171171        initial_cust_id = self.app['customers']._curr_cust_id
    172172        errs, inv_errs, conv_dict = self.processor.checkConversion(
    173             dict(reg_number='1', state='admitted'))
     173            dict(reg_number='1', state='approved'))
    174174        self.assertEqual(len(errs),0)
    175175        # Empty state is allowed
     
    206206        self.assertEqual(self.app['customers']['X666666'].reg_number,'1')
    207207        self.assertEqual(
    208             self.app['customers']['X666666'].state, 'courses validated')
     208            self.app['customers']['X666666'].state, 'requested')
    209209        # Two new customer_ids have been created.
    210210        self.assertEqual(self.app['customers']._curr_cust_id, 1000003)
     
    219219        self.assertEqual(num_warns,0)
    220220        # state has changed
    221         self.assertEqual(self.app['customers']['X666666'].state,'admitted')
     221        self.assertEqual(self.app['customers']['X666666'].state,'approved')
    222222        # state has not changed
    223         self.assertEqual(self.app['customers']['Y777777'].state,
    224                          'courses validated')
     223        self.assertEqual(self.app['customers']['Y777777'].state, 'requested')
    225224        shutil.rmtree(os.path.dirname(fin_file))
    226225
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/viewlets.py

    r11958 r11964  
    2626    default_fileupload_template)
    2727
     28grok.context(IIkobaObject) # Make IKofaObject the default context
     29grok.templatedir('browser_templates')
     30
    2831class CustomersTab(PrimaryNavTab):
    2932    """Customers tab in primary navigation.
     
    4144    def link_target(self):
    4245        return self.view.application_url('customers')
     46
     47class PrimaryCustomerNavManager(grok.ViewletManager):
     48    """Viewlet manager for the primary navigation tab.
     49    """
     50    grok.name('primary_nav_customer')
     51
     52class PrimaryCustomerNavTab(grok.Viewlet):
     53    """Base for primary customer nav tabs.
     54    """
     55    grok.baseclass()
     56    grok.viewletmanager(PrimaryCustomerNavManager)
     57    template = default_primary_nav_template
     58    grok.order(1)
     59    grok.require('waeup.Authenticated')
     60    pnav = 0
     61    tab_title = u'Some Text'
     62
     63    @property
     64    def link_target(self):
     65        return self.view.application_url()
     66
     67    @property
     68    def active(self):
     69        view_pnav = getattr(self.view, 'pnav', 0)
     70        if view_pnav == self.pnav:
     71            return 'active'
     72        return ''
     73
     74class MyCustomerDataTab(PrimaryCustomerNavTab):
     75    """MyData dropdown tab in primary navigation.
     76    """
     77    grok.order(3)
     78    grok.require('waeup.viewMyCustomerDataTab')
     79    grok.template('mydatadropdowntabs')
     80    grok.name('mycustomerdatatab')
     81    pnav = 4
     82    tab_title = _(u'My Data')
     83
     84    @property
     85    def active(self):
     86        view_pnav = getattr(self.view, 'pnav', 0)
     87        if view_pnav == self.pnav:
     88            return 'active dropdown'
     89        return 'dropdown'
     90
     91    @property
     92    def targets(self):
     93        customer = grok.getSite()['customers'][self.request.principal.id]
     94        customer_url = self.view.url(customer)
     95        targets = []
     96        targets += [
     97            {'url':customer_url, 'title':'Base Data'},
     98            {'url':customer_url + '/history', 'title':_('History')},
     99            ]
     100        return targets
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/workflow.py

    r11958 r11964  
    2525from waeup.ikoba.interfaces import (
    2626    IObjectHistory, IIkobaWorkflowInfo, IIkobaUtils,
    27     CREATED, ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING,
    28     REGISTERED, VALIDATED, GRADUATED, TRANSCRIPT)
     27    CREATED, REQUESTED, APPROVED)
    2928from waeup.ikoba.interfaces import MessageFactory as _
    3029from waeup.ikoba.workflow import IkobaWorkflow, IkobaWorkflowInfo
     
    3332
    3433
    35 IMPORTABLE_STATES = (ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING,
    36     REGISTERED, VALIDATED, GRADUATED)
     34IMPORTABLE_STATES = (REQUESTED, APPROVED)
    3735
    3836REGISTRATION_TRANSITIONS = (
     
    4240        source = None,
    4341        condition = NullCondition,
    44         msg = _('Record created'),
     42        msg = _('Customer record created'),
    4543        destination = CREATED),
    4644
    4745    Transition(
    48         transition_id = 'admit',
    49         title = _('Admit customer'),
    50         msg = _('Admitted'),
    51         source = CREATED,
    52         destination = ADMITTED),
     46        transition_id = 'request',
     47        title = _('Request registration'),
     48        msg = _('Customer registration requested'),
     49        source = REQUESTED,
     50        destination = APPROVED),
     51
     52    Transition(
     53        transition_id = 'approve',
     54        title = _('Approve customer'),
     55        msg = _('Customer registration approved'),
     56        source = REQUESTED,
     57        destination = APPROVED),
    5358
    5459    Transition(
    5560        transition_id = 'reset1',
    5661        title = _('Reset customer'),
    57         msg = _('Reset to initial state'),
    58         source = ADMITTED,
     62        msg = _('Reset to initial customer state'),
     63        source = APPROVED,
    5964        destination = CREATED),
    6065
    6166    Transition(
    62         transition_id = 'start_clearance',
    63         title = _('Start clearance'),
    64         msg = _('Clearance started'),
    65         source = ADMITTED,
    66         destination = CLEARANCE),
    67 
    68     Transition(
    6967        transition_id = 'reset2',
    70         title = _('Reset to admitted'),
    71         msg = _("Reset to 'admitted'"),
    72         source = CLEARANCE,
    73         destination = ADMITTED),
    74 
    75     Transition(
    76         transition_id = 'request_clearance',
    77         title = _('Request clearance'),
    78         msg = _('Clearance requested'),
    79         source = CLEARANCE,
     68        title = _('Reset to requested'),
     69        msg = _("Reset to 'requested'"),
     70        source = APPROVED,
    8071        destination = REQUESTED),
    8172
    8273    Transition(
    8374        transition_id = 'reset3',
    84         title = _('Reset to clearance started'),
    85         msg = _("Reset to 'clearance started'"),
     75        title = _('Reset customer'),
     76        msg = _("Reset to initial state"),
    8677        source = REQUESTED,
    87         destination = CLEARANCE),
     78        destination = CREATED),
    8879
    89     Transition(
    90         transition_id = 'clear',
    91         title = _('Clear customer'),
    92         msg = _('Cleared'),
    93         source = REQUESTED,
    94         destination = CLEARED),
    95 
    96     Transition(
    97         transition_id = 'reset4',
    98         title = _('Reset to clearance started'),
    99         msg = _("Reset to 'clearance started'"),
    100         source = CLEARED,
    101         destination = CLEARANCE),
    102 
    103     Transition(
    104         transition_id = 'pay_first_school_fee',
    105         title = _('Pay school fee'),
    106         msg = _('First school fee payment made'),
    107         source = CLEARED,
    108         destination = PAID),
    109 
    110     Transition(
    111         transition_id = 'approve_first_school_fee',
    112         title = _('Approve payment'),
    113         msg = _('First school fee payment approved'),
    114         source = CLEARED,
    115         destination = PAID),
    116 
    117     Transition(
    118         transition_id = 'reset5',
    119         title = _('Reset to cleared'),
    120         msg = _("Reset to 'cleared'"),
    121         source = PAID,
    122         destination = CLEARED),
    123 
    124     Transition(
    125         transition_id = 'pay_school_fee',
    126         title = _('Pay school fee'),
    127         msg = _('School fee payment made'),
    128         source = RETURNING,
    129         destination = PAID),
    130 
    131     Transition(
    132         transition_id = 'pay_pg_fee',
    133         title = _('Pay PG school fee'),
    134         msg = _('PG school fee payment made'),
    135         source = PAID,
    136         destination = PAID),
    137 
    138     Transition(
    139         transition_id = 'approve_school_fee',
    140         title = _('Approve school fee payment'),
    141         msg = _('School fee payment approved'),
    142         source = RETURNING,
    143         destination = PAID),
    144 
    145     Transition(
    146         transition_id = 'approve_pg_fee',
    147         title = _('Approve PG school fee payment'),
    148         msg = _('PG school fee payment approved'),
    149         source = PAID,
    150         destination = PAID),
    151 
    152     Transition(
    153         transition_id = 'reset6',
    154         title = _('Reset to returning'),
    155         msg = _("Reset to 'returning'"),
    156         source = PAID,
    157         destination = RETURNING),
    158 
    159     Transition(
    160         transition_id = 'register_courses',
    161         title = _('Register courses'),
    162         msg = _('Courses registered'),
    163         source = PAID,
    164         destination = REGISTERED),
    165 
    166     Transition(
    167         transition_id = 'reset7',
    168         title = _('Reset to school fee paid'),
    169         msg = _("Reset to 'school fee paid'"),
    170         source = REGISTERED,
    171         destination = PAID),
    172 
    173     Transition(
    174         transition_id = 'validate_courses',
    175         title = _('Validate courses'),
    176         msg = _('Courses validated'),
    177         source = REGISTERED,
    178         destination = VALIDATED),
    179 
    180     Transition(
    181         transition_id = 'bypass_validation',
    182         title = _('Return and bypass validation'),
    183         msg = _("Course validation bypassed"),
    184         source = REGISTERED,
    185         destination = RETURNING),
    186 
    187     Transition(
    188         transition_id = 'reset8',
    189         title = _('Reset to school fee paid'),
    190         msg = _("Reset to 'school fee paid'"),
    191         source = VALIDATED,
    192         destination = PAID),
    193 
    194     Transition(
    195         transition_id = 'return',
    196         title = _('Return'),
    197         msg = _("Returned"),
    198         source = VALIDATED,
    199         destination = RETURNING),
    200 
    201     Transition(
    202         transition_id = 'reset9',
    203         title = _('Reset to courses validated'),
    204         msg = _("Reset to 'courses validated'"),
    205         source = RETURNING,
    206         destination = VALIDATED),
    20780    )
    20881
  • main/waeup.ikoba/trunk/src/waeup/ikoba/interfaces.py

    r11958 r11964  
    4646
    4747CREATED = 'created'
    48 ADMITTED = 'admitted'
    49 CLEARANCE = 'clearance started'
    50 REQUESTED = 'clearance requested'
    51 CLEARED = 'cleared'
    52 PAID = 'school fee paid'
    53 RETURNING = 'returning'
    54 REGISTERED = 'courses registered'
    55 VALIDATED = 'courses validated'
    56 GRADUATED = 'graduated'
    57 TRANSCRIPT = 'transcript requested'
    58 
     48REQUESTED = 'requested'
     49APPROVED = 'approved'
    5950
    6051#: A dict giving job status as tuple (<STRING>, <TRANSLATED_STRING>),
     
    9384registration_states_vocab = SimpleIkobaVocabulary(
    9485    (_('created'), CREATED),
    95     (_('admitted'), ADMITTED),
    96     (_('clearance started'), CLEARANCE),
    97     (_('clearance requested'), REQUESTED),
    98     (_('cleared'), CLEARED),
    99     (_('school fee paid'), PAID),
    100     (_('courses registered'), REGISTERED),
    101     (_('courses validated'), VALIDATED),
    102     (_('returning'), RETURNING),
     86    (_('requested'), REQUESTED),
     87    (_('approved'), APPROVED),
    10388    )
    10489
Note: See TracChangeset for help on using the changeset viewer.