Last change
on this file since 16422 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 | """ |
---|
11 | format the bed for readability |
---|
12 | """ |
---|
13 | |
---|
14 | try: |
---|
15 | from Products.zdb import set_trace |
---|
16 | except: |
---|
17 | def set_trace(): |
---|
18 | pass |
---|
19 | |
---|
20 | if datastructure is not None: |
---|
21 | bed = datastructure.get('bed') |
---|
22 | bed_paid = datastructure.get('acco_maint_date') |
---|
23 | if not bed: |
---|
24 | return '' |
---|
25 | |
---|
26 | if not bed_paid: |
---|
27 | return '<em>visible after payment</em>' |
---|
28 | |
---|
29 | if len(bed.split('_')) != 4: |
---|
30 | return bed |
---|
31 | hall,block,room,letter = bed.split('_') |
---|
32 | info = context.waeup_tool.getHallInfo(bed) |
---|
33 | if info: |
---|
34 | hall_title = info['hall_title'] |
---|
35 | else: |
---|
36 | hall_title = '[%s]' % hall |
---|
37 | return " %s / Block %s / Room %s / Bed %s" % (hall_title,block,room,letter) |
---|
38 | |
---|
Note: See
TracBrowser for help on using the repository browser.