Changeset 4007 for WAeUP_SRP/trunk


Ignore:
Timestamp:
10 Mar 2009, 06:03:56 (16 years ago)
Author:
Henrik Bettermann
Message:

ease disabling hostel booking (not yet tested)

FCE Okene remains unchanged.

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

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_aaua/getAccommodationInfo.py

    r3960 r4007  
    1515logger = logging.getLogger('Skins.getAccommodationInfo')
    1616import DateTime
     17
     18booking_disabled = True
    1719
    1820request = context.REQUEST
     
    5456info['student'] = student
    5557
     58# do not change these settings!
     59
    5660booking_allowed = False
     61info['booking_disabled'] = False
    5762
    5863# customize from here
     
    8287    return info
    8388
    84 acco_id = 'accommodation_' + session[0]
    85 acco = getattr(student,acco_id,None)
    86 info['acco'] = acco
    87 info['acco_id'] = acco_id
    88 
    89 info['maintenance_paid'] = False
    90 if acco is not None:
    91     info['acco_doc'] = acco.getContent()
    92     info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
    93     info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
    9489d = {}
    9590if level >= 300:
     
    106101    d['sex'] = 'female'
    107102
    108 
    109103info['sex']=d['sex']
    110104d['bt'] = bt
    111105student_status = "%(sex)s_%(bt)s" % d
    112106info['student_status'] = student_status
     107
     108# customize end
     109
     110acco_id = 'accommodation_' + session[0]
     111acco = getattr(student,acco_id,None)
     112info['acco'] = acco
     113info['acco_id'] = acco_id
     114info['maintenance_paid'] = False
     115if acco is not None:
     116    info['acco_doc'] = acco.getContent()
     117    info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
     118    info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
     119elif booking_disabled:
     120    info['booking_allowed'] = False
     121    info['booking_disabled'] = True
     122    logger.info('%s: %s eligible but booking disabled' % (student_id,student_status)) 
     123
    113124return info
    114125
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccommodationInfo.py

    r3985 r4007  
    1616import DateTime
    1717
    18 booking_disabled = False
     18booking_disabled = True
    1919
    2020request = context.REQUEST
     
    5656info['student'] = student
    5757
     58# do not change these settings!
     59
    5860booking_allowed = False
     61info['booking_disabled'] = False
    5962
    6063# customize from here
     
    7679              'courses_validated',
    7780              )
     81new = None
     82arrived = None
    7883
    7984try:
     
    8590except:   
    8691    logger.info('%s has invalid session %s' % (student_id,student_record.session))   
    87 
     92   
    8893level = None
    8994end_level = None
     
    117122    info['acco'] = None
    118123    info['student_status'] = ''
    119     logger.info('%s: no bed found' % (student_id))     
     124    logger.info('%s: not eligible' % (student_id))     
    120125    return info
    121 
    122 acco_id = 'accommodation_' + session[0]
    123 acco = getattr(student,acco_id,None)
    124 info['acco'] = acco
    125 info['acco_id'] = acco_id
    126 bt = 're'
    127 info['maintenance_paid'] = False
    128 if acco is not None:
    129     info['acco_doc'] = acco.getContent()
    130     info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
    131     info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
    132 elif booking_disabled:
    133     info['booking_allowed'] = False
    134126
    135127d = {}
     
    143135else:
    144136    bt = 'fi'
    145 
    146137d['sex'] = 'male'
    147138if student_record.sex:
     
    157148student_status = "%(sex)s_%(bt)s" % d
    158149info['student_status'] = student_status
     150
     151# customize end
     152
     153acco_id = 'accommodation_' + session[0]
     154acco = getattr(student,acco_id,None)
     155info['acco'] = acco
     156info['acco_id'] = acco_id
     157info['maintenance_paid'] = False
     158if acco is not None:
     159    info['acco_doc'] = acco.getContent()
     160    info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
     161    info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
     162elif booking_disabled:
     163    info['booking_allowed'] = False
     164    info['booking_disabled'] = True
     165    logger.info('%s: %s eligible but booking disabled' % (student_id,student_status)) 
     166
    159167return info
  • WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_accommodation.py

    r3784 r4007  
    3434
    3535mode = 'create'
     36if info['booking_disabled']:
     37    return context.REQUEST.RESPONSE.redirect("%s/booking_disabled" % info['student'].absolute_url())
    3638if not info['booking_allowed']:
    3739    return context.REQUEST.RESPONSE.redirect("%s/no_booking_allowed" % info['student'].absolute_url())
  • WAeUP_SRP/trunk/skins/waeup_fceoyo/getAccommodationInfo.py

    r3960 r4007  
    1515logger = logging.getLogger('Skins.getAccommodationInfo')
    1616import DateTime
     17
     18booking_disabled = True
    1719
    1820request = context.REQUEST
     
    5456info['student'] = student
    5557
     58# do not change these settings!
     59
    5660booking_allowed = False
     61info['booking_disabled'] = False
    5762
    5863# customize from here
     
    8287    return info
    8388
    84 acco_id = 'accommodation_' + session[0]
    85 acco = getattr(student,acco_id,None)
    86 info['acco'] = acco
    87 info['acco_id'] = acco_id
    88 
    89 info['maintenance_paid'] = False
    90 if acco is not None:
    91     info['acco_doc'] = acco.getContent()
    92     info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
    93     info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
    9489d = {}
    9590if level >= 300:
     
    111106student_status = "%(sex)s_%(bt)s" % d
    112107info['student_status'] = student_status
     108
     109# customize end
     110
     111acco_id = 'accommodation_' + session[0]
     112acco = getattr(student,acco_id,None)
     113info['acco'] = acco
     114info['acco_id'] = acco_id
     115info['maintenance_paid'] = False
     116if acco is not None:
     117    info['acco_doc'] = acco.getContent()
     118    info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
     119    info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
     120elif booking_disabled:
     121    info['booking_allowed'] = False
     122    info['booking_disabled'] = True
     123    logger.info('%s: %s eligible but booking disabled' % (student_id,student_status)) 
     124
    113125return info
    114 
  • WAeUP_SRP/trunk/skins/waeup_futminna/getAccommodationInfo.py

    r4004 r4007  
    5656info['student'] = student
    5757
     58# do not change these settings!
     59
    5860booking_allowed = False
     61info['booking_disabled'] = False
    5962
    6063# customize from here
     
    7881    return info
    7982
    80 acco_id = 'accommodation_' + session[0]
    81 acco = getattr(student,acco_id,None)
    82 info['acco'] = acco
    83 info['acco_id'] = acco_id
    84 
    85 info['maintenance_paid'] = False
    86 if acco is not None:
    87     info['acco_doc'] = acco.getContent()
    88     info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
    89     info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
    90 elif booking_disabled:
    91     info['booking_allowed'] = False
    92    
    9383d = {}
    9484d['sex'] = 'male'
     
    10191info['student_status'] = student_status
    10292
     93# customize end
     94
     95acco_id = 'accommodation_' + session[0]
     96acco = getattr(student,acco_id,None)
     97info['acco'] = acco
     98info['acco_id'] = acco_id
     99info['maintenance_paid'] = False
     100if acco is not None:
     101    info['acco_doc'] = acco.getContent()
     102    info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
     103    info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
     104elif booking_disabled:
     105    info['booking_allowed'] = False
     106    info['booking_disabled'] = True
     107    logger.info('%s: %s eligible but booking disabled' % (student_id,student_status))
     108
    103109return info
  • WAeUP_SRP/trunk/skins/waeup_unilorin/getAccommodationInfo.py

    r3690 r4007  
    1515logger = logging.getLogger('Skins.getAccommodationInfo')
    1616import DateTime
     17
     18booking_disabled = True
    1719
    1820request = context.REQUEST
     
    5456info['student'] = student
    5557
     58# do not change these settings!
     59
    5660booking_allowed = False
     61info['booking_disabled'] = False
    5762
    5863# customize from here
     
    7681    return info
    7782
    78 acco_id = 'accommodation_' + session[0]
    79 acco = getattr(student,acco_id,None)
    80 info['acco'] = acco
    81 info['acco_id'] = acco_id
    82 
    83 info['maintenance_paid'] = False
    84 if acco is not None:
    85     info['acco_doc'] = acco.getContent()
    86     info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
    87     info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
    8883d = {}
    8984if level >= 300:
     
    105100student_status = "%(sex)s_%(bt)s" % d
    106101info['student_status'] = student_status
     102
     103# customize end
     104
     105acco_id = 'accommodation_' + session[0]
     106acco = getattr(student,acco_id,None)
     107info['acco'] = acco
     108info['acco_id'] = acco_id
     109info['maintenance_paid'] = False
     110if acco is not None:
     111    info['acco_doc'] = acco.getContent()
     112    info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
     113    info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
     114elif booking_disabled:
     115    info['booking_allowed'] = False
     116    info['booking_disabled'] = True
     117    logger.info('%s: %s eligible but booking disabled' % (student_id,student_status))
     118   
    107119return info
    108120
Note: See TracChangeset for help on using the changeset viewer.