source: main/kofacustom.ekodisco/trunk/src/kofacustom/ekodisco/students/browser.py @ 10809

Last change on this file since 10809 was 10809, checked in by Henrik Bettermann, 11 years ago

Add address fields.

  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1## $Id: browser.py 10809 2013-11-29 06:45:29Z henrik $
2##
3## Copyright (C) 2012 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##
18import grok
19from zope.i18n import translate
20from zope.schema.interfaces import ConstraintNotSatisfied
21from zope.component import getUtility
22from hurry.workflow.interfaces import IWorkflowInfo
23from zope.formlib.textwidgets import BytesDisplayWidget
24from waeup.kofa.interfaces import REQUESTED, IExtFileStore, IKofaUtils
25from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
26from waeup.kofa.browser.layout import KofaEditFormPage
27from waeup.kofa.browser.layout import action, jsaction
28from waeup.kofa.students.browser import (
29    StudyLevelEditFormPage, StudyLevelDisplayFormPage,
30    StudentBasePDFFormPage, ExportPDFCourseRegistrationSlipPage,
31    CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage,
32    msave, emit_lock_message, StudyCourseDisplayFormPage,
33    StudyCourseManageFormPage)
34from waeup.kofa.students.interfaces import (
35    IStudentsUtils, ICourseTicket)
36from waeup.kofa.students.workflow import FORBIDDEN_POSTGRAD_TRANS
37from kofacustom.nigeria.students.browser import (
38    NigeriaOnlinePaymentDisplayFormPage,
39    NigeriaStudentBaseDisplayFormPage,
40    NigeriaStudentBaseManageFormPage,
41    NigeriaStudentBaseEditFormPage,
42    NigeriaStudentClearanceEditFormPage,
43    NigeriaOnlinePaymentAddFormPage,
44    NigeriaExportPDFPaymentSlipPage,
45    NigeriaExportPDFClearanceSlipPage,
46    )
47
48from kofacustom.ekodisco.students.interfaces import (
49    ICustomStudentOnlinePayment, ICustomStudentStudyCourse,
50    ICustomStudentStudyLevel, ICustomStudentStudyCourse,
51    ICustomStudentStudyCourse, ICustomStudentBase)
52from kofacustom.ekodisco.interfaces import MessageFactory as _
53
54class CustomStudentBaseDisplayFormPage(NigeriaStudentBaseDisplayFormPage):
55    """ Page to display student base data
56    """
57    form_fields = grok.AutoFields(ICustomStudentBase).omit(
58        'password', 'suspended', 'suspended_comment')
59    form_fields['perm_address'].custom_widget = BytesDisplayWidget
60
61class CustomStudentBaseManageFormPage(NigeriaStudentBaseManageFormPage):
62    """ View to manage student base data
63    """
64    form_fields = grok.AutoFields(ICustomStudentBase).omit(
65        'student_id', 'adm_code', 'suspended')
66
67#class CustomStudentBaseEditFormPage(NigeriaStudentBaseEditFormPage):
68#    """ View to edit student base data
69#    """
70#    form_fields = grok.AutoFields(ICustomStudentBase).select(
71#        'email', 'phone')
72
73
74
75
76
77
78class CustomStudyCourseDisplayFormPage(StudyCourseDisplayFormPage):
79    """ Page to display the student study course data
80    """
81    grok.context(ICustomStudentStudyCourse)
82    grok.template('studycoursepage')
83
84    form_fields = grok.AutoFields(ICustomStudentStudyCourse).select(
85                'certificate', 'entry_session', 'current_session',
86                'service_address')
87    form_fields['service_address'].custom_widget = BytesDisplayWidget
88
89class CustomStudyCourseManageFormPage(StudyCourseManageFormPage):
90    """ Page to edit the student study course data
91    """
92    grok.context(ICustomStudentStudyCourse)
93    grok.template('studycoursemanagepage')
94
95    form_fields = grok.AutoFields(ICustomStudentStudyCourse).select(
96                'certificate', 'entry_session', 'current_session',
97                'service_address')
Note: See TracBrowser for help on using the repository browser.