Ignore:
Timestamp:
12 Nov 2006, 17:01:34 (18 years ago)
Author:
joachim
Message:

new logig for the Apply/Finally? in application_edit and clearance_edit
the field acknow can be removed from clearance schema and layouts (to be done)

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

Legend:

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

    r845 r851  
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=REQUEST,proceed=None, cpsdocument_edit_button=None, action=None
     7##parameters=REQUEST, cpsdocument_edit_button=None, cpsdocument_edit_and_view_button=None, action=None
    88##title=
    99# $Id$
     
    4242base_url = app.absolute_url()
    4343
    44 if app_doc.passport is not None:
    45     args['proceed'] = 'Continue'
    46 
    47 if cpsdocument_edit_button:
    48     if is_valid:
     44if is_valid:
     45    if cpsdocument_edit_button:
    4946        if app_doc.passport is not None:
    5047            args['portal_status_message'] = 'You successfully uploaded your passport picture.'
    5148        else:
    5249            args['portal_status_message'] = "You didn't upload a passport picture."
    53 elif proceed:
    54     if is_valid:
    55         action = "/start_clearance"
    56         base_url = student.absolute_url()
    57         url = base_url + action
    58         return REQUEST.RESPONSE.redirect(url)
    59     else:
    60         args['portal_status_message'] = 'psm_content_error'
     50    elif cpsdocument_edit_and_view_button:
     51        if app_doc.passport is not None:
     52            action = "/start_clearance"
     53            base_url = student.absolute_url()
     54            url = base_url + action
     55            return REQUEST.RESPONSE.redirect(url)
     56        else:
     57            args['portal_status_message'] = "You didn't upload a passport picture."
    6158if args:
    6259  url = base_url + action + '?' + urlencode(args)
  • WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt

    r805 r851  
    77                      use_session=True,);
    88           form_action string:application_edit;
    9             proceed request/proceed|nothing;
    109           edition python:True;
    1110           creation python:False;
     
    3332        <span tal:omit-tag="" tal:replace="structure rendered_main"/>
    3433      </span>
    35       <input type="submit" class="standalone" name="cpsdocument_edit_button"
    36              value="Save"
     34      <input type="submit" class="standalone"
     35             name="cpsdocument_edit_button"
     36             value="Save and Return later"
    3737             id="cpsdocument_edit_button"
    3838             tal:condition="not:creation" />
    39       <input type="submit" class="standalone" name="proceed"
    40              value="proceed"
    41              id="cpsdocument_edit_and_view_button"
    42              tal:condition="proceed"
    43              tal:attributes="value proceed"/>
     39      <input type="submit" class="standalone"
     40             name="cpsdocument_edit_and_view_button"
     41             value="Save and Apply"
     42             id="cpsdocument_edit_and_view_button"
     43             tal:condition="not:creation" />
    4444    </form>
    4545    </metal:main>
  • WAeUP_SRP/trunk/skins/waeup_student/clearance_edit.py

    r847 r851  
    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, cpsdocument_edit_button=None, cpsdocument_edit_and_view_button=None, acknowledge=None
    88##title=
    99# $Id$
     
    3434clear_doc = info['clear_doc']
    3535state = 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'])
    4036
    4137is_valid, ds = clear_doc.validate(request=REQUEST,
     
    4844args = {}
    4945action = "/clearance_edit_form"
    50 if cpsdocument_edit_button:
    51     if is_valid:
     46if is_valid:
     47    if cpsdocument_edit_button:
    5248        psm = 'Content changed.'
    5349        if ds.get('acknow'):
    5450            args['final_submit'] = "Finally Submit"
    55     else:
    56         args = getFormUidUrlArg(REQUEST)
    57         psm = "Please correct your errors."
    58         args['portal_status_message'] = psm
     51    elif cpsdocument_edit_and_view_button:
     52        if acknowledge:
     53            wftool.doActionFor(info['clear'],'close')
     54            wftool.doActionFor(info['student'],'request_clearance')
     55            return REQUEST.RESPONSE.redirect("%s/student_index" % info['url'])
     56        psm = "You didn't check the Acknowledgementbox"
     57else:
     58    psm = "Please correct your errors."
     59args = getFormUidUrlArg(REQUEST)
     60args['portal_status_message'] = psm
    5961if args:
    6062  url = clear.absolute_url() + action + '?' + urlencode(args)
  • WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form.pt

    r844 r851  
    3939        </div>
    4040      </div>
    41    <input type="submit" class="standalone" name="cpsdocument_edit_button"
    42          value="Save & Return later"
    43          id="cpsdocument_edit_button"
    44          tal:condition="not:creation" />
    45    <input type="submit" class="standalone"
    46           tal:condition="request/final_submit|nothing"
    47           name="final_submit"
    48           tal:attributes="value request/final_submit"
    49           />
    50     </form>
    51     <div id="ajax_psm" style="display:none">
    52       ajax feedback
    53     </div>
     41        <table class="layoutDefault" summary="Form layout">
     42          <tr class="even ajaxtd">
     43            <th colspan="5" align="left">I hereby acknowledge by ticking this check box
     44            that if it is discovered at any time that i do not possess any of the
     45            qualifications which i claim to have obtained, i will be expelled from the
     46            University and shall not be re-admitted for the same or any other programme,
     47            even if i have upgraded my previous qualifications or possess additional
     48            qualifications.
     49            </th>
     50          </tr>
     51          <tr>
     52            <div class="" id="acknowledge">
     53              <td valign="top" width="80">
     54                <div class="label">
     55                  <label>Acknowledgement</label>:
     56                </div>
     57                <button type="button" class="tooltipControl"
     58                        onclick="toggleElementVisibility('acknow_help')"> ? </button>
     59              </td>
     60              <td valign="top">
     61                <span class="field">
     62                  <input type="checkbox" value="True"
     63                         name="acknowledge" />
     64                </span>
     65                <div class="tooltipArea"
     66                     style="visibility: hidden;"
     67                     id="acknow_help"
     68                     onclick="showElement(false, 'acknow_help')">
     69                  I hereby acknowledge by ticking this check box that if it is
     70                  discovered at any time that i do not possess any of the qualifications
     71                  which i claim to have obtained, i will be expelled from the University
     72                  and shall not be re-admitted for the same or any other programme, even
     73                  if i have upgraded my previous qualifications or possess additional
     74                  qualifications.
     75                </div>
     76              </td>
     77            </div>
     78          </tr>
     79        </table>
     80        <input type="submit" class="standalone"
     81               name="cpsdocument_edit_button"
     82               value="Save & Return later"
     83               id="cpsdocument_edit_button"
     84               tal:condition="not:creation" />
     85        <input type="submit" class="standalone"
     86               name="cpsdocument_edit_and_view_button"
     87               value="Save & Submit"
     88               id="cpsdocument_edit_and_view_button"
     89               tal:condition="not:creation" />
     90      </form>
     91      <div id="ajax_psm" style="display:none">
     92        ajax feedback
     93      </div>
     94    </metal:block>
    5495  </metal:block>
    55 
    56 </metal:block>
    5796</metal:block>
    5897</tal:block>
Note: See TracChangeset for help on using the changeset viewer.