[1224] | 1 | #-*- mode: python; mode: fold -*- |
---|
| 2 | from Globals import InitializeClass |
---|
| 3 | from AccessControl import ClassSecurityInfo |
---|
| 4 | |
---|
| 5 | from Products.CMFCore.utils import UniqueObject, getToolByName |
---|
| 6 | from Products.CMFCore.permissions import View |
---|
| 7 | from Products.CMFCore.permissions import ModifyPortalContent |
---|
| 8 | from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder |
---|
| 9 | #from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument |
---|
| 10 | from Products.CPSDocument.CPSDocument import CPSDocument |
---|
| 11 | from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder |
---|
| 12 | from Products.WAeUP_SRP.WAeUPTables import AccommodationTable |
---|
| 13 | import Globals |
---|
| 14 | import DateTime |
---|
| 15 | import re |
---|
| 16 | p_home = Globals.package_home(globals()) |
---|
| 17 | i_home = Globals.INSTANCE_HOME |
---|
| 18 | |
---|
| 19 | class PaymentsFolder(CPSDocument): ###( |
---|
| 20 | """ |
---|
| 21 | WAeUP PaymentsFolder containing Paymentsmmodation halls |
---|
| 22 | """ |
---|
| 23 | meta_type = 'PaymentsFolder' |
---|
| 24 | portal_type = meta_type |
---|
| 25 | security = ClassSecurityInfo() |
---|
| 26 | |
---|
| 27 | security.declareProtected(View,"Title") |
---|
| 28 | def Title(self): |
---|
| 29 | """compose title""" |
---|
| 30 | return "Payments Section" |
---|
| 31 | |
---|
| 32 | ###) |
---|
| 33 | |
---|
| 34 | InitializeClass(PaymentsFolder) |
---|
| 35 | |
---|
| 36 | def addPaymentsFolder(container, id, REQUEST=None, **kw): |
---|
| 37 | """Add a PaymentsFolder.""" |
---|
| 38 | ob = PaymentsFolder(id, **kw) |
---|
| 39 | return CPSBase_adder(container, ob, REQUEST=REQUEST) |
---|
| 40 | ###) |
---|
| 41 | |
---|
| 42 | class Payment(CPSDocument): ###( |
---|
| 43 | """ |
---|
| 44 | WAeUP Payment containing Departments |
---|
| 45 | """ |
---|
| 46 | meta_type = 'Payment' |
---|
| 47 | portal_type = meta_type |
---|
| 48 | security = ClassSecurityInfo() |
---|
| 49 | |
---|
| 50 | security.declareProtected(View,"Title") ###( |
---|
| 51 | def Title(self): |
---|
| 52 | """compose title""" |
---|
| 53 | content = self.getContent() |
---|
| 54 | heading = getattr(content,'heading',None) |
---|
| 55 | if heading is None: |
---|
| 56 | return self.title |
---|
| 57 | return heading |
---|
| 58 | |
---|
| 59 | ###) |
---|
| 60 | |
---|
| 61 | InitializeClass(Payment) |
---|
| 62 | |
---|
| 63 | def addPayment(container, id, REQUEST=None, **kw): |
---|
| 64 | """Add a Payment.""" |
---|
| 65 | ob = Payment(id, **kw) |
---|
| 66 | return CPSBase_adder(container, ob, REQUEST=REQUEST) |
---|
| 67 | ###) |
---|