[13357] | 1 | ## $Id: interfaces.py 17619 2023-10-21 05:44:44Z 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, |
---|
[14700] | 23 | ISessionConfiguration, academic_sessions_vocab, |
---|
| 24 | ContextualDictSourceFactoryBase) |
---|
[13357] | 25 | |
---|
| 26 | _ = MessageFactory = zope.i18nmessageid.MessageFactory('waeup.aaue') |
---|
| 27 | |
---|
[14700] | 28 | class EnableScoreEditingGroupSource(ContextualDictSourceFactoryBase): |
---|
| 29 | """A source for filtering groups of students |
---|
| 30 | """ |
---|
| 31 | DICT_NAME = 'ENABLE_SCORE_EDITING_GROUP_DICT' |
---|
| 32 | |
---|
[13357] | 33 | # It's recommended to replicate all fields from the base package here. |
---|
| 34 | class ICustomSessionConfiguration(ISessionConfiguration): |
---|
| 35 | """A session configuration object. |
---|
| 36 | """ |
---|
| 37 | |
---|
| 38 | clearance_fee = schema.Float( |
---|
| 39 | title = _(u'Regular Acceptance Fee'), |
---|
| 40 | default = 0.0, |
---|
| 41 | required = True, |
---|
| 42 | ) |
---|
| 43 | |
---|
| 44 | clearance_fee_fp = schema.Float( |
---|
| 45 | title = _(u'FP Acceptance Fee'), |
---|
| 46 | default = 0.0, |
---|
| 47 | required = True, |
---|
| 48 | ) |
---|
| 49 | |
---|
[14518] | 50 | clearance_fee_ijmbe = schema.Float( |
---|
| 51 | title = _(u'IJMBE Acceptance Fee'), |
---|
| 52 | default = 0.0, |
---|
| 53 | required = True, |
---|
| 54 | ) |
---|
| 55 | |
---|
[13678] | 56 | clearance_fee_pg = schema.Float( |
---|
| 57 | title = _(u'FT PG Acceptance Fee'), |
---|
[13377] | 58 | default = 0.0, |
---|
| 59 | required = True, |
---|
| 60 | ) |
---|
| 61 | |
---|
[13678] | 62 | clearance_fee_ug_pt = schema.Float( |
---|
[15393] | 63 | title = _(u'PT and DSH UG Acceptance Fee'), |
---|
[13377] | 64 | default = 0.0, |
---|
| 65 | required = True, |
---|
| 66 | ) |
---|
| 67 | |
---|
[13678] | 68 | clearance_fee_pg_pt = schema.Float( |
---|
| 69 | title = _(u'PT PG Acceptance Fee'), |
---|
[13525] | 70 | default = 0.0, |
---|
| 71 | required = True, |
---|
| 72 | ) |
---|
| 73 | |
---|
[13678] | 74 | clearance_fee_med = schema.Float( |
---|
| 75 | title = _(u'Medical Acceptance Fee'), |
---|
| 76 | default = 0.0, |
---|
| 77 | required = True, |
---|
| 78 | ) |
---|
| 79 | |
---|
[14954] | 80 | clearance_fee_dp = schema.Float( |
---|
| 81 | title = _(u'Diploma Acceptance Fee'), |
---|
| 82 | default = 0.0, |
---|
| 83 | required = True, |
---|
| 84 | ) |
---|
| 85 | |
---|
[15373] | 86 | clearance_fee_bridge = schema.Float( |
---|
| 87 | title = _(u'Bridge Acceptance Fee'), |
---|
| 88 | default = 0.0, |
---|
| 89 | required = True, |
---|
| 90 | ) |
---|
| 91 | |
---|
[13357] | 92 | booking_fee = schema.Float( |
---|
| 93 | title = _(u'Booking Fee'), |
---|
| 94 | default = 0.0, |
---|
| 95 | required = True, |
---|
| 96 | ) |
---|
| 97 | |
---|
[14296] | 98 | transcript_fee_inter = schema.Float( |
---|
| 99 | title = _(u'International Transcript Fee'), |
---|
[13357] | 100 | default = 0.0, |
---|
| 101 | required = True, |
---|
| 102 | ) |
---|
| 103 | |
---|
[14296] | 104 | transcript_fee_local = schema.Float( |
---|
| 105 | title = _(u'Local Transcript Fee'), |
---|
| 106 | default = 0.0, |
---|
| 107 | required = True, |
---|
| 108 | ) |
---|
| 109 | |
---|
[13357] | 110 | # Additional fees in custom package |
---|
| 111 | |
---|
| 112 | maint_fee = schema.Float( |
---|
| 113 | title = _(u'Maintenance Fee'), |
---|
| 114 | default = 0.0, |
---|
| 115 | required = True, |
---|
| 116 | ) |
---|
| 117 | |
---|
| 118 | transfer_fee = schema.Float( |
---|
| 119 | title = _(u'Transfer Fee'), |
---|
| 120 | default = 0.0, |
---|
| 121 | required = True, |
---|
| 122 | ) |
---|
| 123 | |
---|
| 124 | penalty_ug = schema.Float( |
---|
| 125 | title = _(u'UG Penalty Fee'), |
---|
| 126 | default = 0.0, |
---|
| 127 | required = True, |
---|
| 128 | ) |
---|
| 129 | |
---|
| 130 | penalty_pg = schema.Float( |
---|
| 131 | title = _(u'PG Penalty Fee'), |
---|
| 132 | default = 0.0, |
---|
| 133 | required = True, |
---|
| 134 | ) |
---|
| 135 | |
---|
| 136 | late_registration_fee = schema.Float( |
---|
| 137 | title = _(u'Late Course Reg. Fee'), |
---|
| 138 | default = 0.0, |
---|
| 139 | required = True, |
---|
| 140 | ) |
---|
| 141 | |
---|
[14117] | 142 | late_pg_registration_fee = schema.Float( |
---|
| 143 | title = _(u'Late PG Course Reg. Fee'), |
---|
| 144 | default = 0.0, |
---|
| 145 | required = True, |
---|
| 146 | ) |
---|
| 147 | |
---|
[14234] | 148 | id_card_fee = schema.Float( |
---|
| 149 | title = _(u'Student ID Card Fee'), |
---|
| 150 | default = 0.0, |
---|
| 151 | required = True, |
---|
| 152 | ) |
---|
| 153 | |
---|
[13374] | 154 | welfare_fee = schema.Float( |
---|
| 155 | title = _(u'AAU Student Welfare Assurance Fee'), |
---|
| 156 | default = 0.0, |
---|
| 157 | required = True, |
---|
| 158 | ) |
---|
| 159 | |
---|
| 160 | union_fee = schema.Float( |
---|
[13463] | 161 | title = _(u'Student Union Due'), |
---|
[13374] | 162 | default = 0.0, |
---|
| 163 | required = True, |
---|
| 164 | ) |
---|
| 165 | |
---|
| 166 | lapel_fee = schema.Float( |
---|
| 167 | title = _(u'AAU Lapel/File Fee'), |
---|
| 168 | default = 0.0, |
---|
| 169 | required = True, |
---|
| 170 | ) |
---|
| 171 | |
---|
| 172 | matric_gown_fee = schema.Float( |
---|
| 173 | title = _(u'Matriculation Gown Fee'), |
---|
| 174 | default = 0.0, |
---|
| 175 | required = True, |
---|
| 176 | ) |
---|
| 177 | |
---|
| 178 | concessional_fee = schema.Float( |
---|
| 179 | title = _(u'Concessional Fee'), |
---|
| 180 | default = 0.0, |
---|
| 181 | required = True, |
---|
| 182 | ) |
---|
| 183 | |
---|
[14355] | 184 | gst_text_book_0_fee = schema.Float( |
---|
| 185 | title = _(u'Text Book Fee GST101 GST102 GST111 GST112'), |
---|
| 186 | default = 0.0, |
---|
| 187 | required = True, |
---|
| 188 | ) |
---|
| 189 | |
---|
[14258] | 190 | gst_text_book_1_fee = schema.Float( |
---|
[14348] | 191 | title = _(u'Text Book Fee GST101 and GST102'), |
---|
[14248] | 192 | default = 0.0, |
---|
| 193 | required = True, |
---|
| 194 | ) |
---|
| 195 | |
---|
[14258] | 196 | gst_text_book_2_fee = schema.Float( |
---|
[14348] | 197 | title = _(u'Text Book Fee GST111 and GST112'), |
---|
[14248] | 198 | default = 0.0, |
---|
| 199 | required = True, |
---|
| 200 | ) |
---|
| 201 | |
---|
[14258] | 202 | gst_text_book_3_fee = schema.Float( |
---|
[14248] | 203 | title = _(u'Text Book Fee GST222'), |
---|
| 204 | default = 0.0, |
---|
| 205 | required = True, |
---|
| 206 | ) |
---|
| 207 | |
---|
[16754] | 208 | ent_text_book_0_fee = schema.Float( |
---|
| 209 | title = _(u'Text Book Fee ENT201, ENT211'), |
---|
| 210 | default = 0.0, |
---|
| 211 | required = True, |
---|
| 212 | ) |
---|
| 213 | |
---|
[14355] | 214 | ent_text_book_1_fee = schema.Float( |
---|
[14248] | 215 | title = _(u'Text Book Fee ENT201'), |
---|
| 216 | default = 0.0, |
---|
| 217 | required = True, |
---|
| 218 | ) |
---|
| 219 | |
---|
[16749] | 220 | ent_text_book_2_fee = schema.Float( |
---|
| 221 | title = _(u'Text Book Fee ENT211'), |
---|
| 222 | default = 0.0, |
---|
| 223 | required = True, |
---|
| 224 | ) |
---|
| 225 | |
---|
[14258] | 226 | gst_registration_1_fee = schema.Float( |
---|
[14248] | 227 | title = _(u'Registration Fee GST101 GST102 GST111 GST112'), |
---|
| 228 | default = 0.0, |
---|
| 229 | required = True, |
---|
| 230 | ) |
---|
| 231 | |
---|
[14258] | 232 | gst_registration_2_fee = schema.Float( |
---|
[14248] | 233 | title = _(u'Registration Fee GST222'), |
---|
| 234 | default = 0.0, |
---|
| 235 | required = True, |
---|
| 236 | ) |
---|
| 237 | |
---|
[16754] | 238 | ent_registration_0_fee = schema.Float( |
---|
| 239 | title = _(u'Registration Fee ENT201, ENT211'), |
---|
| 240 | default = 0.0, |
---|
| 241 | required = True, |
---|
| 242 | ) |
---|
| 243 | |
---|
[14355] | 244 | ent_registration_1_fee = schema.Float( |
---|
[14248] | 245 | title = _(u'Registration Fee ENT201'), |
---|
| 246 | default = 0.0, |
---|
| 247 | required = True, |
---|
| 248 | ) |
---|
| 249 | |
---|
[16749] | 250 | ent_registration_2_fee = schema.Float( |
---|
| 251 | title = _(u'Registration Fee ENT211'), |
---|
| 252 | default = 0.0, |
---|
| 253 | required = True, |
---|
| 254 | ) |
---|
| 255 | |
---|
[16805] | 256 | ent_combined_fee = schema.Float( |
---|
| 257 | title = _(u'Registration plus Textbook Fee ENT201, ENT211'), |
---|
| 258 | default = 0.0, |
---|
| 259 | required = True, |
---|
| 260 | ) |
---|
| 261 | |
---|
[15742] | 262 | #fac_dep_fee = schema.Float( |
---|
| 263 | # title = _(u'Faculty and Departmental Dues'), |
---|
| 264 | # default = 0.0, |
---|
| 265 | # required = True, |
---|
| 266 | # ) |
---|
[14248] | 267 | |
---|
[14375] | 268 | restitution_fee = schema.Float( |
---|
| 269 | title = _(u'Restitution Fee'), |
---|
| 270 | default = 0.0, |
---|
| 271 | required = True, |
---|
| 272 | ) |
---|
| 273 | |
---|
[15180] | 274 | sports_fee = schema.Float( |
---|
| 275 | title = _(u'Sports Development Fee'), |
---|
| 276 | default = 0.0, |
---|
| 277 | required = True, |
---|
| 278 | ) |
---|
| 279 | |
---|
| 280 | library_fee = schema.Float( |
---|
[15181] | 281 | title = _(u'Library Development Fee UG'), |
---|
[15180] | 282 | default = 0.0, |
---|
| 283 | required = True, |
---|
| 284 | ) |
---|
| 285 | |
---|
[15971] | 286 | library_pg_fee = schema.Float( |
---|
[15181] | 287 | title = _(u'Library Development Fee PG'), |
---|
| 288 | default = 0.0, |
---|
| 289 | required = True, |
---|
| 290 | ) |
---|
| 291 | |
---|
[16123] | 292 | # Is being calculated in utils.py |
---|
[15992] | 293 | #sports_library_fee = schema.Float( |
---|
[16123] | 294 | # title = _(u'Sports Development and PG Library Fee'), |
---|
[15992] | 295 | # default = 0.0, |
---|
| 296 | # required = True, |
---|
| 297 | # ) |
---|
[15978] | 298 | |
---|
[16668] | 299 | #ict_fee = schema.Float( |
---|
| 300 | # title = _(u'ICT/Affidavit Fee'), |
---|
| 301 | # default = 0.0, |
---|
| 302 | # required = True, |
---|
| 303 | # ) |
---|
[15745] | 304 | |
---|
[16181] | 305 | affidavit_fee = schema.Float( |
---|
| 306 | title = _(u'Affidavit Fee'), |
---|
| 307 | default = 0.0, |
---|
| 308 | required = True, |
---|
| 309 | ) |
---|
| 310 | |
---|
[16080] | 311 | lab_1_fee = schema.Float( |
---|
[16020] | 312 | title = _(u'Faculty Laboratory Due (CHM102/PHY103/CSC101)'), |
---|
| 313 | default = 0.0, |
---|
| 314 | required = True, |
---|
| 315 | ) |
---|
| 316 | |
---|
[16080] | 317 | lab_2_fee = schema.Float( |
---|
| 318 | title = _(u'Laboratory Due (BIO101/BIO111)'), |
---|
| 319 | default = 0.0, |
---|
| 320 | required = True, |
---|
| 321 | ) |
---|
| 322 | |
---|
[17514] | 323 | lmsplus_fee = schema.Float( |
---|
| 324 | title = _(u'LMS Plus Fees'), |
---|
[16929] | 325 | default = 0.0, |
---|
| 326 | required = True, |
---|
| 327 | ) |
---|
| 328 | |
---|
[16933] | 329 | exam_fee = schema.Float( |
---|
| 330 | title = _(u'IJMBE Examination Fee'), |
---|
| 331 | default = 0.0, |
---|
| 332 | required = True, |
---|
| 333 | ) |
---|
| 334 | |
---|
[17619] | 335 | access_fee = schema.Float( |
---|
[17099] | 336 | title = _(u'AAU Access Card Fee'), |
---|
| 337 | default = 0.0, |
---|
| 338 | required = True, |
---|
| 339 | ) |
---|
| 340 | |
---|
[13357] | 341 | coursereg_deadline = schema.Datetime( |
---|
[14117] | 342 | title = _(u'FT Course Reg. Deadline'), |
---|
[13357] | 343 | required = False, |
---|
| 344 | description = _('Example: ') + u'2011-12-31 23:59:59+01:00', |
---|
| 345 | ) |
---|
| 346 | |
---|
[14117] | 347 | coursereg_deadline_pg = schema.Datetime( |
---|
| 348 | title = _(u'PG Course Reg. Deadline'), |
---|
| 349 | required = False, |
---|
| 350 | description = _('Example: ') + u'2011-12-31 23:59:59+01:00', |
---|
| 351 | ) |
---|
[13357] | 352 | |
---|
[14117] | 353 | coursereg_deadline_pt = schema.Datetime( |
---|
| 354 | title = _(u'PT Course Reg. Deadline'), |
---|
| 355 | required = False, |
---|
| 356 | description = _('Example: ') + u'2011-12-31 23:59:59+01:00', |
---|
| 357 | ) |
---|
| 358 | |
---|
| 359 | coursereg_deadline_dp = schema.Datetime( |
---|
| 360 | title = _(u'DP Course Reg. Deadline'), |
---|
| 361 | required = False, |
---|
| 362 | description = _('Example: ') + u'2011-12-31 23:59:59+01:00', |
---|
| 363 | ) |
---|
| 364 | |
---|
| 365 | coursereg_deadline_found = schema.Datetime( |
---|
| 366 | title = _(u'FOUND Course Reg. Deadline'), |
---|
| 367 | required = False, |
---|
| 368 | description = _('Example: ') + u'2011-12-31 23:59:59+01:00', |
---|
| 369 | ) |
---|
| 370 | |
---|
[15458] | 371 | coursereg_deadline_bridge = schema.Datetime( |
---|
| 372 | title = _(u'Bridge Course Reg. Deadline'), |
---|
| 373 | required = False, |
---|
| 374 | description = _('Example: ') + u'2011-12-31 23:59:59+01:00', |
---|
| 375 | ) |
---|
| 376 | |
---|
[14700] | 377 | score_editing_enabled = schema.List( |
---|
| 378 | title = _(u'Score editing enabled'), |
---|
| 379 | value_type = schema.Choice( |
---|
| 380 | source = EnableScoreEditingGroupSource(), |
---|
| 381 | ), |
---|
| 382 | required = False, |
---|
| 383 | defaultFactory=list, |
---|
| 384 | ) |
---|
[14117] | 385 | |
---|
[14944] | 386 | show_results = schema.List( |
---|
| 387 | title = _(u'Show course results'), |
---|
| 388 | value_type = schema.Choice( |
---|
| 389 | source = EnableScoreEditingGroupSource(), |
---|
| 390 | ), |
---|
| 391 | required = False, |
---|
| 392 | defaultFactory=list, |
---|
| 393 | ) |
---|
[14700] | 394 | |
---|
[15330] | 395 | studylevel_repair_enabled = schema.Bool( |
---|
| 396 | title = _(u'Course list repair enabled'), |
---|
| 397 | description = _(u'If set, students will be able to add and delete courses.'), |
---|
| 398 | default = False, |
---|
| 399 | required = False, |
---|
| 400 | ) |
---|
[14944] | 401 | |
---|
[15760] | 402 | interswitch_enabled = schema.Bool( |
---|
| 403 | title = _(u'Interswitch integration enabled'), |
---|
| 404 | default = False, |
---|
| 405 | ) |
---|
[15330] | 406 | |
---|
[15760] | 407 | etranzact_webconnect_enabled = schema.Bool( |
---|
| 408 | title = _(u'Etranzact Webconnect integration enabled'), |
---|
| 409 | default = False, |
---|
| 410 | ) |
---|
| 411 | |
---|
| 412 | etranzact_payoutlet_enabled = schema.Bool( |
---|
| 413 | title = _(u'Etranzact Payoutlet integration enabled'), |
---|
| 414 | default = False, |
---|
| 415 | ) |
---|
| 416 | |
---|
[13357] | 417 | def getSessionString(): |
---|
| 418 | """Returns the session string from the vocabulary. |
---|
| 419 | """ |
---|
| 420 | |
---|
| 421 | |
---|
| 422 | class ICustomSessionConfigurationAdd(ICustomSessionConfiguration): |
---|
| 423 | """A session configuration object in add mode. |
---|
| 424 | """ |
---|
| 425 | |
---|
| 426 | academic_session = schema.Choice( |
---|
| 427 | title = _(u'Academic Session'), |
---|
| 428 | source = academic_sessions_vocab, |
---|
| 429 | default = None, |
---|
| 430 | required = True, |
---|
| 431 | readonly = False, |
---|
| 432 | ) |
---|
| 433 | |
---|
| 434 | ICustomSessionConfigurationAdd[ |
---|
| 435 | 'academic_session'].order = ICustomSessionConfiguration[ |
---|
[6923] | 436 | 'academic_session'].order |
---|