Ignore:
Timestamp:
21 Sep 2012, 08:19:35 (12 years ago)
Author:
uli
Message:

Rollback r9209. Looks like multiple merges from trunk confuse svn when merging back into trunk.

Location:
main/waeup.kofa/branches/uli-zc-async
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-zc-async

  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/students/workflow.py

    r9209 r9211  
    22"""
    33import grok
    4 from datetime import datetime
    54from zope.component import getUtility
    65from hurry.workflow.workflow import Transition, WorkflowState, NullCondition
     
    1312from waeup.kofa.workflow import KofaWorkflow, KofaWorkflowInfo
    1413from waeup.kofa.students.interfaces import IStudent, IStudentsUtils
    15 from waeup.kofa.utils.helpers import get_current_principal
    1614
    1715
    1816IMPORTABLE_STATES = (ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING,
    1917    REGISTERED, VALIDATED)
    20 
    21 FORBIDDEN_POSTGRAD_STATES = (RETURNING, REGISTERED, VALIDATED)
    2218
    2319REGISTRATION_TRANSITIONS = (
     
    2723        source = None,
    2824        condition = NullCondition,
    29         msg = _('Record created'),
     25        msg = _('Student record created'),
    3026        destination = CREATED),
    3127
     
    3329        transition_id = 'admit',
    3430        title = _('Admit student'),
    35         msg = _('Admitted'),
     31        msg = _('Student admitted'),
    3632        source = CREATED,
    3733        destination = ADMITTED),
     
    6763    Transition(
    6864        transition_id = 'reset3',
    69         title = _('Reset to clearance started'),
    70         msg = _("Reset to 'clearance started'"),
     65        title = _('Reset to clearance'),
     66        msg = _("Reset to 'clearance'"),
    7167        source = REQUESTED,
    7268        destination = CLEARANCE),
     
    8177    Transition(
    8278        transition_id = 'reset4',
    83         title = _('Reset to clearance started'),
    84         msg = _("Reset to 'clearance started'"),
     79        title = _('Reset to clearance'),
     80        msg = _("Reset to 'clearance'"),
    8581        source = CLEARED,
    8682        destination = CLEARANCE),
     
    8985        transition_id = 'pay_first_school_fee',
    9086        title = _('Pay school fee'),
    91         msg = _('First school fee payment made'),
     87        msg = _('School fee paid'),
    9288        source = CLEARED,
    9389        destination = PAID),
     
    9692        transition_id = 'approve_first_school_fee',
    9793        title = _('Approve payment'),
    98         msg = _('First school fee payment approved'),
     94        msg = _('School fee payment approved'),
    9995        source = CLEARED,
    10096        destination = PAID),
     
    110106        transition_id = 'pay_school_fee',
    111107        title = _('Pay school fee'),
    112         msg = _('School fee payment made'),
     108        msg = _('Payment made'),
    113109        source = RETURNING,
    114110        destination = PAID),
     
    116112    Transition(
    117113        transition_id = 'pay_pg_fee',
    118         title = _('Pay PG school fee'),
    119         msg = _('PG school fee payment made'),
     114        title = _('Pay postgraduate school fee'),
     115        msg = _('Payment made'),
    120116        source = PAID,
    121117        destination = PAID),
     
    123119    Transition(
    124120        transition_id = 'approve_school_fee',
    125         title = _('Approve school fee payment'),
     121        title = _('Approve payment'),
    126122        msg = _('School fee payment approved'),
    127123        source = RETURNING,
     
    130126    Transition(
    131127        transition_id = 'approve_pg_fee',
    132         title = _('Approve PG school fee payment'),
    133         msg = _('PG school fee payment approved'),
     128        title = _('Approve postgraduate payment'),
     129        msg = _('School fee payment approved'),
    134130        source = PAID,
    135131        destination = PAID),
     
    151147    Transition(
    152148        transition_id = 'reset7',
    153         title = _('Reset to school fee paid'),
    154         msg = _("Reset to 'school fee paid'"),
     149        title = _('Reset to paid'),
     150        msg = _("Reset to 'paid'"),
    155151        source = REGISTERED,
    156152        destination = PAID),
     
    165161    Transition(
    166162        transition_id = 'reset8',
    167         title = _('Reset to school fee paid'),
    168         msg = _("Reset to 'school fee paid'"),
     163        title = _('Reset to paid'),
     164        msg = _("Reset to 'paid'"),
    169165        source = VALIDATED,
    170166        destination = PAID),
     
    179175    Transition(
    180176        transition_id = 'reset9',
    181         title = _('Reset to courses validated'),
    182         msg = _("Reset to 'courses validated'"),
     177        title = _('Reset to validated'),
     178        msg = _("Reset to 'validated'"),
    183179        source = RETURNING,
    184180        destination = VALIDATED),
     
    187183IMPORTABLE_TRANSITIONS = [i.transition_id for i in REGISTRATION_TRANSITIONS]
    188184
    189 FORBIDDEN_POSTGRAD_TRANS = ['reset6', 'register_courses']
    190185LOCK_CLEARANCE_TRANS = ('reset2', 'request_clearance')
    191186UNLOCK_CLEARANCE_TRANS = ('reset3', 'reset4', 'start_clearance')
     
    217212
    218213    Lock and unlock clearance form.
    219     Trigger actions after school fee payment.
     214    Triger actions after school fee payment.
    220215    """
    221216
     
    236231        new_session = obj['studycourse'].current_session + 1
    237232        obj['studycourse'].current_session = new_session
    238     elif event.transition.transition_id == 'validate_courses':
    239         current_level = obj['studycourse'].current_level
    240         level_object = obj['studycourse'].get(str(current_level), None)
    241         if level_object is not None:
    242             user = get_current_principal()
    243             if user is None:
    244                 usertitle = 'system'
    245             else:
    246                 usertitle = getattr(user, 'public_name', None)
    247                 if not usertitle:
    248                     usertitle = user.title
    249             level_object.validated_by = usertitle
    250             level_object.validation_date = datetime.utcnow()
    251     elif event.transition.transition_id == 'reset8':
    252         current_level = obj['studycourse'].current_level
    253         level_object = obj['studycourse'].get(str(current_level), None)
    254         if level_object is not None:
    255             level_object.validated_by = None
    256             level_object.validation_date = None
    257233    # In some tests we don't have a students container
    258234    try:
Note: See TracChangeset for help on using the changeset viewer.