Changeset 2459


Ignore:
Timestamp:
28 Oct 2007, 13:56:01 (17 years ago)
Author:
Henrik Bettermann
Message:

show payment button only if verdict, session and level are not empty
pay_by_sc.py: open study_course to fill new level and session after payment

Location:
WAeUP_SRP/base/skins
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_epayment/getPaymentsFolderInfo.py

    r2454 r2459  
    6262#    sc_payment = True
    6363
    64 if review_state == 'cleared_and_validated':
    65     online_payment = True
    66 elif review_state == 'returning':
    67     sc_payment = True
    68 
    6964info['online_payment'] = online_payment
    7065info['sc_payment'] = sc_payment
     
    7469info['next_session'] = next_info['next_session_id']
    7570info['next_session_str'] = next_info['next_session_str']
     71
     72if review_state == 'cleared_and_validated':
     73    online_payment = True
     74elif review_state == 'returning' and info['next_session'] != session:
     75    sc_payment = True
    7676
    7777info['student_name'] = s_brain.name
  • WAeUP_SRP/base/skins/waeup_epayment/pay_by_sc.py

    r2454 r2459  
    112112
    113113    study_course = getattr(student,'study_course')
     114    try:
     115        wftool.doActionFor(study_course,'open')
     116    except:
     117        pass   
    114118    study_course.getContent().edit(mapping= {'current_level': next_level_id,
    115119                                             'current_session': next_session_id,})
    116120    if next_transition:
    117         wftool.doActionFor(student,next_transition)   
    118    
     121        wftool.doActionFor(student,next_transition)
     122
    119123    #if next_session == context.getSessionId()[-2:]:
    120124    #    wftool.doActionFor(student,'pay_school_fee')
     
    126130    #    study_course_doc.edit(mapping= {'current_level': next_level,
    127131    #                                    'current_session': next_session,})
    128    
     132
    129133    logger.info('%s paid school fee by scratch card' % student_id)
    130134else:
  • WAeUP_SRP/base/skins/waeup_student/getNextInfo.py

    r2456 r2459  
    2525if review_state == 'cleared_and_validated':
    2626    info['next_transition'] = "pay_school_fee"
    27 elif review_state == 'returning':
    28     if level_id:
    29         info['next_level_id'] = "%s" % (int(level_id) + 100)
    30     if session_id:
    31         info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1)
    32         if int(session_id) > int(context.getSessionId()[0]) -2:
    33             info['next_transition'] = "pay_school_fee"
    34             if verdict not in ('A','B',):
    35                 info['next_level_id'] = level_id
     27elif review_state == 'returning' and verdict and level_id and session:
     28    info['next_level_id'] = "%s" % (int(level_id) + 100)
     29    info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1)
     30    if int(session_id) > int(context.getSessionId()[0]) -2:
     31        info['next_transition'] = "pay_school_fee"
     32        if verdict not in ('A','B',):
     33            info['next_level_id'] = level_id
    3634
    3735info['next_session_str'] = context.sessions_voc(next_session_id)
Note: See TracChangeset for help on using the changeset viewer.