Ignore:
Timestamp:
13 Nov 2006, 15:39:08 (18 years ago)
Author:
joachim
Message:

clearance_edit_manager + clearance_edit_form_manager modified that all
buttons are shown according to the student's workflow-state.
The waeup_student_wf was modified, to allow the transitions
Even though the enter_clearance_pin-transition is allowed for Manager
in the clearance_requested state, the reject_clearance button does not work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_manager.py

    r847 r858  
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=REQUEST,proceed=None, cpsdocument_edit_button=None, final_submit=None, action=None
     7##parameters=REQUEST
    88##title=
    9 # $Id: clearance_edit.py 832 2006-11-10 16:52:23Z joachim $
     9# $Id: clearance_edit.py 852 2006-11-12 21:21:07Z henrik $
    1010"""
    1111"""
     
    1616current = DateTime.DateTime()
    1717
     18cpsdocument_edit_button = REQUEST.has_key('cpsdocument_edit_button')
     19cpsdocument_edit_and_view_button = REQUEST.has_key('cpsdocument_edit_and_view_button')
     20clear_and_validate_button = REQUEST.has_key('clear_and_validate_button')
     21undo_clear_button = REQUEST.has_key('undo_clear_button')
     22reject_clearance_button = REQUEST.has_key('reject_clearance_button')
     23
    1824# Until ajax posts directly to its own script...
    1925##if 'ajax_edit' in REQUEST.form:
    2026##    return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster)
    21 
    22 # Check flexible controls
    23 #context.editLayouts(REQUEST=REQUEST)
    2427
    2528# Validate the document and write it if it's valid
     
    3336clear = info['clear']
    3437clear_doc = info['clear_doc']
    35 state = context.getStudentInfo()['review_state']
    36 if final_submit:
    37     wftool.doActionFor(info['clear'],'close')
    38     wftool.doActionFor(info['student'],'request_clearance')
    39     return REQUEST.RESPONSE.redirect("%s/student_index" % info['url'])
     38review_state = info['review_state']
    4039
    4140is_valid, ds = clear_doc.validate(request=REQUEST,
     
    4847args = {}
    4948action = "/clearance_edit_form_manager"
    50 if cpsdocument_edit_button:
    51     if is_valid:
     49if is_valid:
     50    if cpsdocument_edit_button:
    5251        psm = 'Content changed.'
    53         if ds.get('acknow'):
    54             args['final_submit'] = "Finally Submit"
    55     else:
    56         args = getFormUidUrlArg(REQUEST)
    57         psm = "Please correct your errors."
    58         args['portal_status_message'] = psm
     52    elif cpsdocument_edit_and_view_button:
     53        wftool.doActionFor(info['clear'],'close')
     54        wftool.doActionFor(info['student'],'request_clearance')
     55    elif clear_and_validate_button:
     56        wftool.doActionFor(info['student'],'clear_and_validate')
     57    elif reject_clearance_button:
     58        wftool.doActionFor(info['clear'],'open')
     59        wftool.doActionFor(info['student'],'enter_clearance_pin')
     60    elif undo_clear_button:
     61        wftool.doActionFor(info['student'],'request_clearance')
     62else:
     63    psm = "Please correct your errors."
     64args = getFormUidUrlArg(REQUEST)
     65args['review_state'] = review_state
     66args['portal_status_message'] = psm
    5967if args:
    6068  url = clear.absolute_url() + action + '?' + urlencode(args)
     
    6270  url = clear.absolute_url() + action
    6371REQUEST.RESPONSE.redirect(url)
    64 
Note: See TracChangeset for help on using the changeset viewer.