Changeset 1758 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
8 May 2007, 20:43:37 (18 years ago)
Author:
joachim
Message:

previous sessions students can now pay their previous sessions schoolfees,
please test if "normal" returning students can still pay.

Location:
WAeUP_SRP/trunk/skins
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_default/sessions_voc.py

    r1756 r1758  
    1515except:
    1616    return 'unknown'
    17 ##if len(key) != 2:
    18 ##    return 'unknown'
    1917if y < 90:
    2018    cent = 2000
  • WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py

    r1661 r1758  
    3939is_so = info['is_so'] = context.isSectionOfficer()
    4040
    41 res = context.portal_catalog(portal_type='Student',id = student_id)
    42 if res:
    43     info['review_state'] = res[0].review_state
     41#res = context.portal_catalog(portal_type='Student',id = student_id)
     42#res = context.students_catalog(id = student_id)
     43info['review_state'] = s_brain.review_state
     44session = s_brain.session
     45info['next_session'], info['next_session_str'] = context.getNextSessionId(session)
    4446
    4547info['student_name'] = s_brain.name
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py

    r1568 r1758  
    1616logger = logging.getLogger('Skins.pay_by_sc')
    1717import DateTime
     18try:
     19    from Products.zdb import set_trace
     20except:
     21    def set_trace():
     22        pass
    1823
    1924if context.portal_membership.isAnonymousUser():
     
    2833
    2934student = getattr(students,student_id)
    30 sbrain = context.students_catalog(id=student_id)[0]
    31 amount,description = context.getSchoolFee(sbrain.faculty)
    32 
     35s_brain = context.students_catalog(id=student_id)[0]
     36session = s_brain.session
     37next_session, next_session_str = context.getNextSessionId(session)
     38amount,description = context.getSchoolFee(s_brain.faculty)
    3339validate = request.has_key("cpsdocument_create_button")
    3440res,psm,ds = lt.renderLayout(layout_id= 'student_schoolfee',
     
    4652                                 psm = psm,
    4753                                 mode = 'edit',
     54                                 next_session_str = next_session_str,
    4855                                 ds = ds,
    4956                                 )
     
    5259                                 psm = None,
    5360                                 mode = 'edit',
     61                                 next_session_str = next_session_str,
    5462                                 ds = ds,
    5563                                 )
     
    7381    info['date'] = now
    7482    info['amount'] = "n/a"
    75     pin = info['order_id'] = ds.get('pin')
     83    pin = info['order_id'] = "%s__%s" % (ds.get('pin'),next_session)
    7684    info['type_code'] = "%s" % pin
    77     info['type_description'] = 'School Fee for Session 2006/2007'
     85    info['type_description'] = 'School Fee for Session %s' % next_session_str
    7886    info['resp_code'] = "SC"
    7987    info['resp_desc'] = "SC Payment Successful"
     
    8492    payment.getContent().edit(mapping=info)
    8593    wftool.doActionFor(payment,'close')
    86     wftool.doActionFor(student,'pay_school_fee')
     94    if next_session == context.getSessionId():
     95        wftool.doActionFor(student,'pay_school_fee')
     96    else:
     97        study_course = getattr(student,'study_course')
     98        wftool.doActionFor(study_course,'open')
     99        study_course_doc = study_course.getContent()
     100        next_level = "%s" % (int(s_brain.level) + 100)
     101        study_course_doc.edit(mapping= {'current_level': next_level,
     102                                        'current_session': next_session,})
    87103    logger.info('%s paid school fee by scratch card' % student_id)
    88104else:
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc_form.pt

    r1378 r1758  
    1313      </metal:block>
    1414      <metal:block fill-slot="main">
    15         <h3>Pay Your 2006/2007 School Fee by Scratch Card!</h3>
     15        <h3>Pay Your <span tal:replace="options/next_session_str" /> School Fee by Scratch Card!</h3>
    1616        <br />
    1717        <div tal:replace="structure rendered_main" />
  • WAeUP_SRP/trunk/skins/waeup_epayment/payments_view.pt

    r1636 r1758  
    6969        <form tal:condition="python:review_state == 'returning'"
    7070              tal:attributes="action string: ${context/absolute_url}/pay_by_sc" method="post" class="group">
     71         <input type="hidden" name="paid_session"
     72                tal:attributes="value info/next_session"
     73                />
     74
    7175         <input type="submit" name="epayment"
    7276                class="context"
    73                 value="Pay School Fee by Scratch Card"
     77                value="Pay School Fee by Scratch Card"
     78                tal:attributes="value string:Pay ${info/next_session_str} School Fee by Scratch Card"
    7479                />
    7580        </form>         
  • WAeUP_SRP/trunk/skins/waeup_student/getSchoolFeePrefix.py

    r1571 r1758  
    1616    return None
    1717
     18try:
     19    from Products.zdb import set_trace
     20except:
     21    def set_trace():
     22        pass
    1823import logging
    1924logger = logging.getLogger('Skins.getSchoolFeePrefix')
     
    2328res = context.portal_catalog(portal_type="Certificate",
    2429                                     id = sbrain.course)
     30#set_trace()
    2531if not res:
    2632    logger.info('%s, certificate %s not found' % (student_id,course))
Note: See TracChangeset for help on using the changeset viewer.