| 1 | ## $Id: interfaces.py 18354 2026-10-28 13:52:58Z 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 | ContextualDictSourceFactoryBase) |
|---|
| 25 | |
|---|
| 26 | _ = MessageFactory = zope.i18nmessageid.MessageFactory('kofacustom.unidel') |
|---|
| 27 | |
|---|
| 28 | class EnableScoreEditingGroupSource(ContextualDictSourceFactoryBase): |
|---|
| 29 | """A source for filtering groups of students |
|---|
| 30 | """ |
|---|
| 31 | DICT_NAME = 'ENABLE_SCORE_EDITING_GROUP_DICT' |
|---|
| 32 | |
|---|
| 33 | class ICustomSessionConfiguration(ISessionConfiguration): |
|---|
| 34 | """A session configuration object. |
|---|
| 35 | """ |
|---|
| 36 | |
|---|
| 37 | # Base fees, do not remove. |
|---|
| 38 | |
|---|
| 39 | clearance_fee = schema.Float( |
|---|
| 40 | title = _(u'Acceptance Fee (default)'), |
|---|
| 41 | default = 0.0, |
|---|
| 42 | required = False, |
|---|
| 43 | ) |
|---|
| 44 | |
|---|
| 45 | booking_fee = schema.Float( |
|---|
| 46 | title = _(u'Bed Booking Fee'), |
|---|
| 47 | default = 0.0, |
|---|
| 48 | required = False, |
|---|
| 49 | ) |
|---|
| 50 | |
|---|
| 51 | maint_fee = schema.Float( |
|---|
| 52 | title = _(u'Rent (fallback)'), |
|---|
| 53 | default = 0.0, |
|---|
| 54 | required = False, |
|---|
| 55 | ) |
|---|
| 56 | |
|---|
| 57 | late_registration_fee = schema.Float( |
|---|
| 58 | title = _(u'Late Course Reg. Fee'), |
|---|
| 59 | default = 0.0, |
|---|
| 60 | required = False, |
|---|
| 61 | ) |
|---|
| 62 | |
|---|
| 63 | transcript_fee = schema.Float( |
|---|
| 64 | title = _(u'Transcript Fee'), |
|---|
| 65 | default = 0.0, |
|---|
| 66 | required = False, |
|---|
| 67 | ) |
|---|
| 68 | |
|---|
| 69 | transcript_student_fee = schema.Float( |
|---|
| 70 | title = _(u'Transcript Fee Students Copy'), |
|---|
| 71 | default = 0.0, |
|---|
| 72 | required = False, |
|---|
| 73 | ) |
|---|
| 74 | |
|---|
| 75 | transcript_local_fee = schema.Float( |
|---|
| 76 | title = _(u'Transcript Fee Local Copy'), |
|---|
| 77 | default = 0.0, |
|---|
| 78 | required = False, |
|---|
| 79 | ) |
|---|
| 80 | |
|---|
| 81 | transcript_inter_fee = schema.Float( |
|---|
| 82 | title = _(u'Transcript Fee International Copy'), |
|---|
| 83 | default = 0.0, |
|---|
| 84 | required = False, |
|---|
| 85 | ) |
|---|
| 86 | |
|---|
| 87 | transfer_fee = schema.Float( |
|---|
| 88 | title = _(u'Transfer Fee'), |
|---|
| 89 | default = 0.0, |
|---|
| 90 | required = False, |
|---|
| 91 | ) |
|---|
| 92 | |
|---|
| 93 | interswitch_enabled = schema.Bool( |
|---|
| 94 | title = _(u'Interswitch Collegepay integration enabled'), |
|---|
| 95 | default = True, |
|---|
| 96 | ) |
|---|
| 97 | |
|---|
| 98 | interswitch_paydirect_enabled = schema.Bool( |
|---|
| 99 | title = _(u'Interswitch Paydirect integration enabled'), |
|---|
| 100 | default = True, |
|---|
| 101 | ) |
|---|
| 102 | |
|---|
| 103 | etranzact_webconnect_enabled = schema.Bool( |
|---|
| 104 | title = _(u'Etranzact Webconnect integration enabled'), |
|---|
| 105 | default = False, |
|---|
| 106 | ) |
|---|
| 107 | |
|---|
| 108 | etranzact_payoutlet_enabled = schema.Bool( |
|---|
| 109 | title = _(u'Etranzact Payoutlet integration enabled'), |
|---|
| 110 | default = False, |
|---|
| 111 | ) |
|---|
| 112 | |
|---|
| 113 | |
|---|
| 114 | # Additional fees in custom package add here |
|---|
| 115 | |
|---|
| 116 | ugftlocal_clearance_fee = schema.Float( |
|---|
| 117 | title = _(u'UG FT Local Acceptance Fee (without Btech Fee)'), |
|---|
| 118 | default = 0.0, |
|---|
| 119 | required = False, |
|---|
| 120 | ) |
|---|
| 121 | |
|---|
| 122 | ugft_clearance_fee = schema.Float( |
|---|
| 123 | title = _(u'UG FT Non-Local Acceptance Fee (without Btech Fee)'), |
|---|
| 124 | default = 0.0, |
|---|
| 125 | required = False, |
|---|
| 126 | ) |
|---|
| 127 | |
|---|
| 128 | med_reg_fee = schema.Float( |
|---|
| 129 | title = _(u'Medical Registration Fee'), |
|---|
| 130 | default = 0.0, |
|---|
| 131 | required = False, |
|---|
| 132 | ) |
|---|
| 133 | |
|---|
| 134 | teaching_practice_fee = schema.Float( |
|---|
| 135 | title = _(u'Teaching Practice Fee'), |
|---|
| 136 | default = 0.0, |
|---|
| 137 | required = False, |
|---|
| 138 | ) |
|---|
| 139 | |
|---|
| 140 | ijmb_exam_fee = schema.Float( |
|---|
| 141 | title = _(u'IJMB Examination Fees'), |
|---|
| 142 | default = 0.0, |
|---|
| 143 | required = False, |
|---|
| 144 | ) |
|---|
| 145 | |
|---|
| 146 | union_fee = schema.Float( |
|---|
| 147 | title = _(u'Student Union Due'), |
|---|
| 148 | default = 0.0, |
|---|
| 149 | required = False, |
|---|
| 150 | ) |
|---|
| 151 | |
|---|
| 152 | siwes_fee = schema.Float( |
|---|
| 153 | title = _(u'SIWES Fee'), |
|---|
| 154 | default = 0.0, |
|---|
| 155 | required = False, |
|---|
| 156 | ) |
|---|
| 157 | |
|---|
| 158 | trcn_nce_fee = schema.Float( |
|---|
| 159 | title = _(u'NCE TRCN Induction License Fee'), |
|---|
| 160 | default = 0.0, |
|---|
| 161 | required = False, |
|---|
| 162 | ) |
|---|
| 163 | |
|---|
| 164 | trcn_degree_fee = schema.Float( |
|---|
| 165 | title = _(u'Degree TRCN Induction License Fee'), |
|---|
| 166 | default = 0.0, |
|---|
| 167 | required = False, |
|---|
| 168 | ) |
|---|
| 169 | |
|---|
| 170 | bsd_fee = schema.Float( |
|---|
| 171 | title = _(u'Digital Skills Training Fee'), |
|---|
| 172 | default = 0.0, |
|---|
| 173 | required = False, |
|---|
| 174 | ) |
|---|
| 175 | |
|---|
| 176 | twohundred_ced_fee = schema.Float( |
|---|
| 177 | title = _(u'200 Level CED Registration Fee'), |
|---|
| 178 | default = 0.0, |
|---|
| 179 | required = False, |
|---|
| 180 | ) |
|---|
| 181 | |
|---|
| 182 | threehundred_ced_fee = schema.Float( |
|---|
| 183 | title = _(u'300 Level CED Registration Fee'), |
|---|
| 184 | default = 0.0, |
|---|
| 185 | required = False, |
|---|
| 186 | ) |
|---|
| 187 | |
|---|
| 188 | convocation_fee = schema.Float( |
|---|
| 189 | title = _(u'Convocation Fee'), |
|---|
| 190 | default = 0.0, |
|---|
| 191 | required = False, |
|---|
| 192 | ) |
|---|
| 193 | |
|---|
| 194 | plagtest_fee = schema.Float( |
|---|
| 195 | title = _(u'Turnitin Plagiarism Checker Fee'), |
|---|
| 196 | default = 0.0, |
|---|
| 197 | required = False, |
|---|
| 198 | ) |
|---|
| 199 | |
|---|
| 200 | late_registration_fee = schema.Float( |
|---|
| 201 | title = _(u'GLate Course Registration Fee'), |
|---|
| 202 | default = 0.0, |
|---|
| 203 | required = False, |
|---|
| 204 | ) |
|---|
| 205 | |
|---|
| 206 | score_editing_enabled = schema.List( |
|---|
| 207 | title = _(u'Score editing enabled'), |
|---|
| 208 | value_type = schema.Choice( |
|---|
| 209 | source = EnableScoreEditingGroupSource(), |
|---|
| 210 | ), |
|---|
| 211 | required = False, |
|---|
| 212 | defaultFactory=list, |
|---|
| 213 | ) |
|---|
| 214 | |
|---|
| 215 | show_results = schema.List( |
|---|
| 216 | title = _(u'Show course results'), |
|---|
| 217 | value_type = schema.Choice( |
|---|
| 218 | source = EnableScoreEditingGroupSource(), |
|---|
| 219 | ), |
|---|
| 220 | required = False, |
|---|
| 221 | defaultFactory=list, |
|---|
| 222 | ) |
|---|
| 223 | |
|---|
| 224 | def getSessionString(): |
|---|
| 225 | """Returns the session string from the vocabulary. |
|---|
| 226 | """ |
|---|
| 227 | |
|---|
| 228 | |
|---|
| 229 | class ICustomSessionConfigurationAdd(ICustomSessionConfiguration): |
|---|
| 230 | """A session configuration object in add mode. |
|---|
| 231 | """ |
|---|
| 232 | |
|---|
| 233 | academic_session = schema.Choice( |
|---|
| 234 | title = _(u'Academic Session'), |
|---|
| 235 | source = academic_sessions_vocab, |
|---|
| 236 | default = None, |
|---|
| 237 | required = True, |
|---|
| 238 | readonly = False, |
|---|
| 239 | ) |
|---|
| 240 | |
|---|
| 241 | ICustomSessionConfigurationAdd[ |
|---|
| 242 | 'academic_session'].order = ICustomSessionConfiguration[ |
|---|
| 243 | 'academic_session'].order |
|---|