Changeset 1327


Ignore:
Timestamp:
19 Jan 2007, 18:14:23 (18 years ago)
Author:
joachim
Message:

request_transfer_form is directly shown, if transferfee is payed.

Location:
WAeUP_SRP/trunk
Files:
3 edited

Legend:

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

    r1319 r1327  
    3434  <table>
    3535    <row>
    36       <cell name="transfer_type"/>
    37     </row>
    38     <row>
    3936      <cell name="pin"/>
    4037    </row>
  • WAeUP_SRP/trunk/skins/waeup_student/request_transfer.py

    r1321 r1327  
    2626student = getattr(students,student_id)
    2727sbrain = context.students_catalog(id=student_id)[0]
    28 
     28payments = getattr(student,'payments').objectIds()
     29payed = False
     30for payment in payments:
     31    if payment.startswith('transfer'):
     32        payed = True
     33        break
     34if payed:
     35    return context.request_transfer_form(rendered = None,
     36                                 psm = None,
     37                                 payed = True,
     38                                 )
     39   
    2940validate = request.has_key("cpsdocument_create_button")
    3041res,psm,ds = lt.renderLayout(layout_id= 'student_transfer',
     
    6475info = {}
    6576order_id = ds.get('pin_n')
    66 p_id = "p%s" % order_id
     77p_id = "transfer_%s" % order_id
    6778now = DateTime.DateTime()
    6879info['date'] = now
    6980info['amount'] = "n/a"
    7081pin = info['order_id'] = ds.get('pin')
    71 info['type_code'] = "%s" % pin
     82info['type_code'] = "transfer_%s" % pin
    7283info['type_description'] = 'Transfer Form SC %s' % pin
    7384payments.invokeFactory('Payment', p_id)
     
    7788payment.getContent().edit(mapping=info)
    7889wftool.doActionFor(payment,'close')
    79 url = "%s/payments" % (student.absolute_url())
    80 request.RESPONSE.redirect(url)
     90return context.request_transfer_form(rendered = None,
     91                                 psm = None,
     92                                 payed = True,
     93                                 )
    8194
  • WAeUP_SRP/trunk/skins/waeup_student/request_transfer_form.pt

    r1319 r1327  
    11<tal:block define="rendered_main options/rendered;
    22           portal_status_message options/psm;
    3            data_storage options/ds;
     3           payed options/payed|nothing;
    44           edition python:1;"
    55           >
     
    1313      </metal:block>
    1414      <metal:block fill-slot="main">
    15         <h3>Request a Transfer!</h3>
    16         <br />
    17         <div tal:replace="structure rendered_main" />
     15        <span tal:condition="rendered_main">
     16          <h3>Request a Transfer!</h3>
     17          <br />
     18          <div tal:replace="structure rendered_main" />
     19        </span>
     20        <span tal:condition="payed">
     21          <a href="intra_transfer">Request an Intra Faculty Transfer</a>
     22          <a href="inter_transfer">Request an Inter Faculty Transfer</a>
     23        </span>         
    1824      </metal:block>
    1925      <metal:block fill-slot="sub">
Note: See TracChangeset for help on using the changeset viewer.