[13355] | 1 | ## $Id: interfaces.py 14336 2016-12-12 12:02:31Z 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 | ## |
---|
| 18 | |
---|
| 19 | import zope.i18nmessageid |
---|
| 20 | from zope import schema |
---|
| 21 | from zc.sourcefactory.basic import BasicSourceFactory |
---|
| 22 | from waeup.kofa.interfaces import (SimpleKofaVocabulary, |
---|
| 23 | ISessionConfiguration, academic_sessions_vocab) |
---|
| 24 | |
---|
[14035] | 25 | _ = MessageFactory = zope.i18nmessageid.MessageFactory('kofacustom.coewarri') |
---|
[13355] | 26 | |
---|
| 27 | # It's recommended to replicate all fields from the base package here. |
---|
| 28 | class ICustomSessionConfiguration(ISessionConfiguration): |
---|
| 29 | """A session configuration object. |
---|
| 30 | """ |
---|
| 31 | |
---|
| 32 | # Base fees, do not remove. |
---|
| 33 | |
---|
| 34 | school_fee_base = schema.Float( |
---|
| 35 | title = _(u'School Fee (ignored)'), |
---|
| 36 | default = 0.0, |
---|
| 37 | required = False, |
---|
| 38 | ) |
---|
| 39 | |
---|
| 40 | clearance_fee = schema.Float( |
---|
[14336] | 41 | title = _(u'Acceptance Fee'), |
---|
[13355] | 42 | default = 0.0, |
---|
| 43 | required = False, |
---|
| 44 | ) |
---|
| 45 | |
---|
| 46 | booking_fee = schema.Float( |
---|
| 47 | title = _(u'Booking Fee'), |
---|
| 48 | default = 0.0, |
---|
| 49 | required = False, |
---|
| 50 | ) |
---|
| 51 | |
---|
| 52 | maint_fee = schema.Float( |
---|
| 53 | title = _(u'Maintenance Fee (ignored)'), |
---|
| 54 | default = 0.0, |
---|
| 55 | required = False, |
---|
| 56 | ) |
---|
| 57 | |
---|
| 58 | transcript_fee = schema.Float( |
---|
| 59 | title = _(u'Transcript Fee'), |
---|
| 60 | default = 0.0, |
---|
| 61 | required = False, |
---|
| 62 | ) |
---|
| 63 | |
---|
| 64 | # Additional fees in custom package add here |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | def getSessionString(): |
---|
| 68 | """Returns the session string from the vocabulary. |
---|
| 69 | """ |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | class ICustomSessionConfigurationAdd(ICustomSessionConfiguration): |
---|
| 73 | """A session configuration object in add mode. |
---|
| 74 | """ |
---|
| 75 | |
---|
| 76 | academic_session = schema.Choice( |
---|
| 77 | title = _(u'Academic Session'), |
---|
| 78 | source = academic_sessions_vocab, |
---|
| 79 | default = None, |
---|
| 80 | required = True, |
---|
| 81 | readonly = False, |
---|
| 82 | ) |
---|
| 83 | |
---|
| 84 | ICustomSessionConfigurationAdd[ |
---|
| 85 | 'academic_session'].order = ICustomSessionConfiguration[ |
---|
[10765] | 86 | 'academic_session'].order |
---|