Changeset 2656 for WAeUP_SRP


Ignore:
Timestamp:
14 Nov 2007, 21:28:30 (17 years ago)
Author:
Henrik Bettermann
Message:

Several modifications made to enable payment for all sessions, all payment modes and both portals I tested all combinations.

'N/A' replaced by in level, verdict and session widgets. A missing value is now always .

Location:
WAeUP_SRP/base
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r2645 r2656  
    312312        log_after = 100
    313313        for student in res:
    314             if not count % log_after: 
     314            if not count % log_after:
    315315                logger.info("processed %d total %d" % (log_after,count))
    316316            count += 1
     
    357357        csv_writer.writerows(l)
    358358    ###)
    359    
     359
    360360    security.declareProtected(ManagePortal, 'removeDeletedDocIds') ###(
    361361    def removeDeletedDocIds(self, max=1000):
     
    630630        else:
    631631            logger.info('matric_no %s not found in results_import' % student.matric_no)
    632             level = 0
    633             verdict = 'N/A'
     632            level = ''
     633            verdict = ''
    634634        #student should not be allowed to perform this transition
    635635        #wftool = self.portal_workflow
     
    838838                                                             brain.reg_no,
    839839                                                             app_picture))
    840            
     840
    841841        return student_id
    842842    ###)
  • WAeUP_SRP/base/Widgets.py

    r2632 r2656  
    254254
    255255class WAeUPSessionWidget(CPSSelectWidget): ###(
    256     """WAeUP Session Widget."""
     256    """WAeUP Session Widget for import only"""
    257257    meta_type = 'WAeUP Session Widget'
    258258
    259259    def _getSessions(self):
    260260        current_year = DateTime().year()
    261         d = {'-1': 'N/A'}
     261        d = {'': ''}
    262262        for y in range(current_year - 9,current_year + 1):
    263263            d['%s' % str(y)[-2:]] = '%4d/%4d' % (y,y+1)
     
    293293        return 1
    294294
     295    # rendering is not used, instead we use a select widget with dynamic vocabulary
    295296    def render(self, mode, datastructure, **kw):
    296297        """Render in mode from datastructure."""
  • WAeUP_SRP/base/skins/waeup_accommodation/getAccommodationInfo.py

    r2454 r2656  
    6464info['email']=s_brain.email
    6565info['level']=s_brain.level
    66 info['verdict']=getattr(s_brain,"verdict","N/A")
     66info['verdict']=getattr(s_brain,'verdict','')
    6767
    6868
     
    9090    info['acco'] = None
    9191    return info
    92 info['session'] = session = context.getSessionId() 
     92info['session'] = session = context.getSessionId()
    9393acco_id = 'accommodation_' + session[0]
    9494acco = getattr(student,acco_id,None)
  • WAeUP_SRP/base/skins/waeup_epayment/approve_epayment.py

    r1568 r2656  
    3030student = getattr(students,student_id)
    3131
     32s_brain = context.students_catalog(id=student_id)[0]
     33session = s_brain.session
     34
     35next_info = context.getNextInfo(s_brain)
     36next_session_id = next_info['next_session_id']
     37next_session_str = next_info['next_session_str']
     38next_level_id = next_info['next_level_id']
     39next_transition = next_info['next_transition']
     40next_verdict = next_info['next_verdict']
     41
    3242pd = {}
    3343#from Products.zdb import set_trace;set_trace()
     
    3949pd['resp_desc'] = 'Payment approved by %s, %s' % (member,DateTime.DateTime())
    4050doc.edit(mapping=pd)
     51
    4152if doc.type_description.startswith('School Fee'):
    42     wftool.doActionFor(student,'pay_school_fee')
     53    study_course = getattr(student,'study_course')
     54    try:
     55        wftool.doActionFor(study_course,'open')
     56    except:
     57        pass
     58    verdict = s_brain.verdict
     59    if verdict == 'N/A':
     60        verdict = ''
     61    study_course.getContent().edit(mapping= {'current_level': next_level_id,
     62                                             'current_session': next_session_id,
     63                                             'current_verdict': next_verdict,
     64                                             'previous_verdict': verdict,
     65                                             })
     66    if next_transition:
     67        wftool.doActionFor(student,next_transition)
     68
    4369logger.info('%s approves epayment for %s' % (member,student_id))
    4470wftool.doActionFor(context,'close')
  • WAeUP_SRP/base/skins/waeup_student/getNextInfo.py

    r2652 r2656  
    4242    info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1)
    4343    if int(session_id) > 4:
    44         info['next_transition'] = "pay_school_fee"
    4544        info['next_verdict'] = ''
    4645        if verdict in ('A','B',):
     
    4847        else:
    4948            info['next_level_id'] = level_id
     49        if int(session_id) > int(context.getSessionId()[0]) -2:
     50            info['next_transition'] = "pay_school_fee"
    5051    else:
    5152        info['next_level_id'] = "%s" % (int(level_id) + 100)
Note: See TracChangeset for help on using the changeset viewer.