source: WAeUP_SRP/branches/srpp_branch/skins/waeup_student/pay_hostel_fee.py @ 2234

Last change on this file since 2234 was 166, checked in by joachim, 19 years ago

=more enhancements

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1##parameters=REQUEST
2# $Id: pay_hostel_fee.py 166 2005-11-12 14:45:08Z joachim $
3"""
4book an accomodation
5"""
6import DateTime
7current = DateTime.DateTime()
8
9type_name = 'Student'
10ti = context.portal_types[type_name]
11pm = context.portal_membership
12REQUEST.set('type_name',type_name)
13
14validate = REQUEST.has_key("cpsdocument_edit_button")
15
16
17lt = context.portal_layouts
18pr = context.portal_registration
19
20res,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                      )
29if psm == 'invalid':
30    return context.book_accommodation_form(rendered = res,
31                                 psm = "Please correct your input",
32                                 ds = ds,
33                                 )
34elif psm == '':
35    return context.book_accommodation_form(rendered = res,
36                                 psm = None,
37                                 ds = ds,
38                                 )
39elif 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.