source: WAeUP_SRP/trunk/skins/waeup_fceokene/getFormattedBedOkene.py @ 17328

Last change on this file since 17328 was 5582, checked in by Henrik Bettermann, 14 years ago

FCEOkene: Show bed coordinates only after payment.

  • Property svn:keywords set to Id
File size: 851 bytes
Line 
1## Script (Python) "getFormattedBed"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=bed=None,mode=None,datastructure=None
8##title=
9# $Id: getFormattedBedOkene.py 5582 2010-11-10 08:56:03Z henrik $
10"""
11format the bed for readability
12"""
13
14try:
15    from Products.zdb import set_trace
16except:
17    def set_trace():
18        pass
19
20if datastructure is not None:
21    bed = datastructure.get('bed')
22    bed_paid = datastructure.get('acco_maint_date')
23if not bed:
24    return ''
25
26if not bed_paid:
27    return '<em>visible after payment</em>'   
28   
29if len(bed.split('_')) != 4:
30    return bed
31hall,block,room,letter = bed.split('_')
32info = context.waeup_tool.getHallInfo(bed)
33if info:
34    hall_title = info['hall_title']
35else:
36    hall_title = '[%s]' % hall
37return " %s / Block %s / Room %s / Bed %s" % (hall_title,block,room,letter)
38
Note: See TracBrowser for help on using the repository browser.