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
|
Line | |
---|
1 | ##parameters=REQUEST |
---|
2 | # $Id: pay_hostel_fee.py 404 2006-08-22 21:45:50Z joachim $ |
---|
3 | """ |
---|
4 | book an accommodation |
---|
5 | """ |
---|
6 | import DateTime |
---|
7 | current = DateTime.DateTime() |
---|
8 | |
---|
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 | |
---|
20 | res,psm,ds = lt.renderLayout(layout_id= 'accopay', |
---|
21 | schema_id= 'student_hostel_fee', |
---|
22 | context=context, |
---|
23 | mapping=validate and REQUEST, |
---|
24 | ob={}, |
---|
25 | layout_mode='create', |
---|
26 | submit = "pay", |
---|
27 | action = 'pay_hostel_fee', |
---|
28 | ) |
---|
29 | if psm == 'invalid': |
---|
30 | return context.book_accommodation_form(rendered = res, |
---|
31 | psm = "Please correct your input", |
---|
32 | ds = ds, |
---|
33 | ) |
---|
34 | elif psm == '': |
---|
35 | return context.book_accommodation_form(rendered = res, |
---|
36 | psm = None, |
---|
37 | ds = ds, |
---|
38 | ) |
---|
39 | elif psm == 'valid': |
---|
40 | sf = context.getContent() |
---|
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.