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 | |
---|
13 | class AccoFolder(CPSDocument): ###( |
---|
14 | """ |
---|
15 | WAeUP AccoFolder containing Accommodation halls |
---|
16 | """ |
---|
17 | meta_type = 'AccoFolder' |
---|
18 | portal_type = meta_type |
---|
19 | security = ClassSecurityInfo() |
---|
20 | |
---|
21 | |
---|
22 | InitializeClass(AccoFolder) |
---|
23 | |
---|
24 | def addAccoFolder(container, id, REQUEST=None, **kw): |
---|
25 | """Add a AccoFolder.""" |
---|
26 | ob = AccoFolder(id, **kw) |
---|
27 | return CPSBase_adder(container, ob, REQUEST=REQUEST) |
---|
28 | ###) |
---|
29 | |
---|
30 | |
---|
31 | class Accommodation(CPSDocument): ###( |
---|
32 | """ |
---|
33 | WAeUP Accommodation containing Departments |
---|
34 | """ |
---|
35 | meta_type = 'Accommodation' |
---|
36 | portal_type = meta_type |
---|
37 | security = ClassSecurityInfo() |
---|
38 | |
---|
39 | security.declareProtected(View,"Title") |
---|
40 | def Title(self): |
---|
41 | """compose title""" |
---|
42 | content = self.getContent() |
---|
43 | heading = getattr(content,'heading',None) |
---|
44 | if heading is None: |
---|
45 | return self.title |
---|
46 | return heading |
---|
47 | |
---|
48 | InitializeClass(Accommodation) |
---|
49 | |
---|
50 | def addAccommodation(container, id, REQUEST=None, **kw): |
---|
51 | """Add a Accommodation.""" |
---|
52 | ob = Accommodation(id, **kw) |
---|
53 | return CPSBase_adder(container, ob, REQUEST=REQUEST) |
---|
54 | ###) |
---|