Last change
on this file since 453 was
404,
checked in by joachim, 18 years ago
|
accommodation startet
|
-
Property svn:keywords set to
Id
|
File size:
1.3 KB
|
Rev | Line | |
---|
[114] | 1 | ##parameters=REQUEST |
---|
| 2 | # $Id: pay_hostel_fee.py 404 2006-08-22 21:45:50Z joachim $ |
---|
| 3 | """ |
---|
[404] | 4 | book an accommodation |
---|
[114] | 5 | """ |
---|
[166] | 6 | import DateTime |
---|
| 7 | current = DateTime.DateTime() |
---|
| 8 | |
---|
[114] | 9 | type_name = 'Student' |
---|
| 10 | ti = context.portal_types[type_name] |
---|
| 11 | pm = context.portal_membership |
---|
| 12 | REQUEST.set('type_name',type_name) |
---|
| 13 | |
---|
| 14 | validate = REQUEST.has_key("cpsdocument_edit_button") |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | lt = context.portal_layouts |
---|
| 18 | pr = context.portal_registration |
---|
| 19 | |
---|
[166] | 20 | res,psm,ds = lt.renderLayout(layout_id= 'accopay', |
---|
| 21 | schema_id= 'student_hostel_fee', |
---|
[114] | 22 | context=context, |
---|
| 23 | mapping=validate and REQUEST, |
---|
| 24 | ob={}, |
---|
| 25 | layout_mode='create', |
---|
[166] | 26 | submit = "pay", |
---|
| 27 | action = 'pay_hostel_fee', |
---|
[114] | 28 | ) |
---|
| 29 | if psm == 'invalid': |
---|
[164] | 30 | return context.book_accommodation_form(rendered = res, |
---|
[114] | 31 | psm = "Please correct your input", |
---|
| 32 | ds = ds, |
---|
| 33 | ) |
---|
| 34 | elif psm == '': |
---|
[164] | 35 | return context.book_accommodation_form(rendered = res, |
---|
[114] | 36 | psm = None, |
---|
| 37 | ds = ds, |
---|
| 38 | ) |
---|
| 39 | elif psm == 'valid': |
---|
| 40 | sf = context.getContent() |
---|
[166] | 41 | |
---|
| 42 | ds.set('sc_date',current) |
---|
| 43 | sf.setScratchCardData('hostel_fee',ds) |
---|
| 44 | |
---|
| 45 | return context.payed_hostel_fee(dict=ds) |
---|
Note: See
TracBrowser for help on using the repository browser.