[7195] | 1 | ## $Id: vocabularies.py 9414 2012-10-25 09:44:02Z henrik $ |
---|
| 2 | ## |
---|
| 3 | ## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann |
---|
| 4 | ## This program is free software; you can redistribute it and/or modify |
---|
| 5 | ## it under the terms of the GNU General Public License as published by |
---|
| 6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
| 7 | ## (at your option) any later version. |
---|
| 8 | ## |
---|
| 9 | ## This program is distributed in the hope that it will be useful, |
---|
| 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 12 | ## GNU General Public License for more details. |
---|
| 13 | ## |
---|
| 14 | ## You should have received a copy of the GNU General Public License |
---|
| 15 | ## along with this program; if not, write to the Free Software |
---|
| 16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 17 | ## |
---|
[6958] | 18 | """Vocabularies and sources for the accommodation section. |
---|
| 19 | """ |
---|
[7068] | 20 | from grok import getSite |
---|
| 21 | from zope.component import getUtility |
---|
| 22 | from zope.catalog.interfaces import ICatalog |
---|
| 23 | from zc.sourcefactory.contextual import BasicContextualSourceFactory |
---|
[7819] | 24 | from waeup.kofa.interfaces import SimpleKofaVocabulary |
---|
[7811] | 25 | from waeup.kofa.interfaces import MessageFactory as _ |
---|
[9400] | 26 | from waeup.kofa.university.vocabularies import ContextualDictSourceFactoryBase |
---|
[6958] | 27 | |
---|
[7068] | 28 | NOT_OCCUPIED = u'not occupied' |
---|
[6958] | 29 | |
---|
[9400] | 30 | class SpecialHandlingSource(ContextualDictSourceFactoryBase): |
---|
| 31 | """A application category source delivers all special handling categories |
---|
| 32 | provided for accommodation booking. |
---|
| 33 | """ |
---|
| 34 | #: name of dict to deliver from kofa utils. |
---|
| 35 | DICT_NAME = 'SPECIAL_HANDLING_DICT' |
---|
| 36 | |
---|
[7819] | 37 | bed_letters = SimpleKofaVocabulary( |
---|
[7718] | 38 | (_('Bed A'),'A'), |
---|
| 39 | (_('Bed B'),'B'), |
---|
| 40 | (_('Bed C'),'C'), |
---|
| 41 | (_('Bed D'),'D'), |
---|
| 42 | (_('Bed E'),'E'), |
---|
| 43 | (_('Bed F'),'F'), |
---|
| 44 | (_('Bed G'),'G'), |
---|
| 45 | (_('Bed H'),'H'), |
---|
| 46 | (_('Bed I'),'I'), |
---|
[9371] | 47 | (_('Bed J'),'J'), |
---|
| 48 | (_('Bed K'),'K'), |
---|
| 49 | (_('Bed L'),'L'), |
---|
[6958] | 50 | ) |
---|
| 51 | |
---|
[7819] | 52 | blocks = SimpleKofaVocabulary( |
---|
[7718] | 53 | (_('Block A'),'A'), |
---|
| 54 | (_('Block B'),'B'), |
---|
| 55 | (_('Block C'),'C'), |
---|
| 56 | (_('Block D'),'D'), |
---|
| 57 | (_('Block E'),'E'), |
---|
| 58 | (_('Block F'),'F'), |
---|
| 59 | (_('Block G'),'G'), |
---|
| 60 | (_('Block H'),'H'), |
---|
| 61 | (_('Block I'),'I'), |
---|
| 62 | (_('Block K'),'K'), |
---|
| 63 | (_('Block L'),'L'), |
---|
| 64 | (_('Block M'),'M'), |
---|
| 65 | (_('Block N'),'N'), |
---|
| 66 | (_('Block O'),'O'), |
---|
| 67 | (_('Block P'),'P'), |
---|
[9373] | 68 | (_('Block Q'),'Q'), |
---|
[6958] | 69 | ) |
---|