Changeset 858


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
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/profiles/default/layouts/student_clearance.xml

    r852 r858  
    854854   <cell name="def_adm"/>
    855855  </row>
    856   <row>
    857    <cell name="acknow"/>
    858   </row>
    859856 </table>
    860857</object>
  • WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml

    r815 r858  
    3838                  acquired="True">
    3939  </permission-map>
     40  <permission-map name="View" acquired="True">
     41   <permission-role>Owner</permission-role>
     42  </permission-map>
    4043 </state>
    4144 <state state_id="clearance_requested" title="">
     
    4548                  acquired="True">
    4649  </permission-map>
     50  <permission-map name="View" acquired="True">
     51   <permission-role>Owner</permission-role>
     52  </permission-map>
    4753 </state>
    4854 <state state_id="cleared_and_validated" title="">
    4955  <exit-transition transition_id="create_content"/>
    50   <permission-map name="View" acquired="True">
    51    <permission-role>Owner</permission-role>
    52   </permission-map>
     56  <exit-transition transition_id="enter_clearance_pin"/>
     57  <exit-transition transition_id="request_clearance"/>
     58  <permission-map name="View" acquired="True">
     59   <permission-role>Owner</permission-role>
     60  </permission-map>
     61 </state>
     62 <state state_id="clearence_requested" title="">
     63  <exit-transition transition_id="clear_and_validate"/>
     64  <exit-transition transition_id="enter_clearance_pin"/>
     65  <exit-transition transition_id="reject_clearance"/>
     66  <permission-map name="Modify portal content"
     67                  acquired="True">
     68   <permission-role>SectionManager</permission-role>
     69  </permission-map>
     70  <permission-map name="View" acquired="True">
     71  </permission-map>
     72 </state>
     73 <state state_id="closed" title="">
     74  <exit-transition transition_id="open"/>
    5375 </state>
    5476 <state state_id="deferred" title="">
     
    6183  <permission-map name="View" acquired="True">
    6284   <permission-role>Owner</permission-role>
     85  </permission-map>
     86 </state>
     87 <state state_id="opened" title="">
     88  <exit-transition transition_id="close"/>
     89  <permission-map name="Modify portal content"
     90                  acquired="True">
     91   <permission-role>Owner</permission-role>
     92  </permission-map>
     93  <permission-map name="View" acquired="True">
    6394  </permission-map>
    6495 </state>
     
    118149  </guard>
    119150 </transition>
     151 <transition transition_id="close" title=""
     152             new_state="closed" trigger="USER"
     153             before_script="" after_script="">
     154 
     155  <guard>
     156   <guard-role>Manager</guard-role>
     157   <guard-role>SectionManager</guard-role>
     158  </guard>
     159 </transition>
    120160 <transition transition_id="create" title=""
    121161             new_state="student_created" trigger="USER"
     
    176216   <guard-role>SectionManager</guard-role>
    177217   <guard-role>ClearanceOfficer</guard-role>
     218  </guard>
     219 </transition>
     220 <transition transition_id="open" title=""
     221             new_state="opened" trigger="USER"
     222             before_script="" after_script="">
     223 
     224  <guard>
     225   <guard-role>Manager</guard-role>
     226   <guard-role>SectionManager</guard-role>
    178227  </guard>
    179228 </transition>
  • 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.