Changeset 858 for WAeUP_SRP/trunk/skins


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.

Location:
WAeUP_SRP/trunk/skins/waeup_student
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form_manager.pt

    r850 r858  
    77                                               layout_mode='edit',
    88                                               use_session=True);
    9            form_action string:clearance_edit;
     9           form_action string:clearance_edit_manager;
     10           isManager context/isManager;
    1011           edition python:True;
    1112           creation python:False;
    12            metadata nothing;
    13            is_manager context/isManager;
     13           review_state info/review_state
    1414    ">
    1515<metal:block use-macro="here/waeup_content_master/macros/master">
    16 
    1716  <metal:block fill-slot="header">
    18     <span tal:condition="not: is_manager">
    19         <metal:block use-macro="here/error_not_found/macros/not_found" />
     17    <span tal:condition="not: isManager">
     18      <metal:block use-macro="here/error_not_found/macros/not_found" />
    2019    </span>
    21     <span tal:condition="is_manager">
    22     <a href=""
    23        tal:attributes="href string:${here/academicsParent}">
    24       <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
    25       Up one level
    26     </a>
    27        <h3>
    28          <span tal:condition="info">
    29            <span tal:content="info/student/Title" />:
    30          </span>
    31          <span tal:content="here/title_or_id" />
     20    <span tal:condition="isManager">
     21      <a href=""
     22         tal:attributes="href string:${here/academicsParent}">
     23        <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
     24        Up one level
     25      </a>
     26      <h3>
     27        <span tal:condition="info">
     28          <span tal:content="info/student/Title" />:
     29        </span>
     30        <span tal:content="here/title_or_id" />
    3231      </h3>
    33     <br />   
     32      <br />   
    3433    </span>
    3534  </metal:block>
    36 
    37   <metal:block fill-slot="main" tal:condition="is_manager">
     35  <metal:block fill-slot="main">
    3836    <form action="ACTION" method="post" id="editForm"
    3937          enctype="multipart/form-data" class="workflow"
     
    4947        </div>
    5048      </div>
    51     <input type="submit" class="standalone" name="cpsdocument_edit_button"
    52          value="Save & Return later"
    53          id="cpsdocument_edit_button"
    54          tal:condition="not:creation" />
    55     <input type="submit" class="standalone"
    56           tal:condition="request/final_submit|nothing"
    57           name="final_submit"
    58           tal:attributes="value request/final_submit"
    59           />
    60     </form>
    61     <div id="ajax_psm" style="display:none">
    62       ajax feedback
    63     </div>
     49      <input type="submit" class="standalone"
     50             name="cpsdocument_edit_button"
     51             value="Save & Return later"
     52             id="cpsdocument_edit_button"
     53             tal:condition="python: review_state == 'clearance_pin_entered'" />
     54      <input type="submit" class="standalone"
     55             name="cpsdocument_edit_and_view_button"
     56             value="Save & Submit"
     57             id="cpsdocument_edit_and_view_button"
     58             tal:condition="python: review_state == 'clearance_pin_entered'" />
     59      <input type="submit" class="standalone"
     60             name="clear_and_validate_button"
     61             value="Clear & Validate"
     62             id="clear_and_validate_button"
     63             tal:condition="python:review_state == 'clearance_requested'" />
     64      <input type="submit" class="standalone"
     65             name="reject_clearance_button"
     66             value="Reject Clearance"
     67             id="reject_clearance_button"
     68             tal:condition="python:review_state == 'clearance_requested'" />
     69      <input type="submit" class="standalone"
     70             name="undo_clear_button"
     71             value="Undo Clear & Validate"
     72             id="undo_clear_button"
     73             tal:condition="python:review_state == 'cleared_and_validated'" />
     74      </form>
     75      <div id="ajax_psm" style="display:none">
     76        ajax feedback
     77      </div>
     78    </metal:block>
    6479  </metal:block>
    65  
    66 </metal:block>
    6780</tal:block>
  • 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.