## $Id: browser.py 10809 2013-11-29 06:45:29Z henrik $ ## ## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## import grok from zope.i18n import translate from zope.schema.interfaces import ConstraintNotSatisfied from zope.component import getUtility from hurry.workflow.interfaces import IWorkflowInfo from zope.formlib.textwidgets import BytesDisplayWidget from waeup.kofa.interfaces import REQUESTED, IExtFileStore, IKofaUtils from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget from waeup.kofa.browser.layout import KofaEditFormPage from waeup.kofa.browser.layout import action, jsaction from waeup.kofa.students.browser import ( StudyLevelEditFormPage, StudyLevelDisplayFormPage, StudentBasePDFFormPage, ExportPDFCourseRegistrationSlipPage, CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage, msave, emit_lock_message, StudyCourseDisplayFormPage, StudyCourseManageFormPage) from waeup.kofa.students.interfaces import ( IStudentsUtils, ICourseTicket) from waeup.kofa.students.workflow import FORBIDDEN_POSTGRAD_TRANS from kofacustom.nigeria.students.browser import ( NigeriaOnlinePaymentDisplayFormPage, NigeriaStudentBaseDisplayFormPage, NigeriaStudentBaseManageFormPage, NigeriaStudentBaseEditFormPage, NigeriaStudentClearanceEditFormPage, NigeriaOnlinePaymentAddFormPage, NigeriaExportPDFPaymentSlipPage, NigeriaExportPDFClearanceSlipPage, ) from kofacustom.ekodisco.students.interfaces import ( ICustomStudentOnlinePayment, ICustomStudentStudyCourse, ICustomStudentStudyLevel, ICustomStudentStudyCourse, ICustomStudentStudyCourse, ICustomStudentBase) from kofacustom.ekodisco.interfaces import MessageFactory as _ class CustomStudentBaseDisplayFormPage(NigeriaStudentBaseDisplayFormPage): """ Page to display student base data """ form_fields = grok.AutoFields(ICustomStudentBase).omit( 'password', 'suspended', 'suspended_comment') form_fields['perm_address'].custom_widget = BytesDisplayWidget class CustomStudentBaseManageFormPage(NigeriaStudentBaseManageFormPage): """ View to manage student base data """ form_fields = grok.AutoFields(ICustomStudentBase).omit( 'student_id', 'adm_code', 'suspended') #class CustomStudentBaseEditFormPage(NigeriaStudentBaseEditFormPage): # """ View to edit student base data # """ # form_fields = grok.AutoFields(ICustomStudentBase).select( # 'email', 'phone') class CustomStudyCourseDisplayFormPage(StudyCourseDisplayFormPage): """ Page to display the student study course data """ grok.context(ICustomStudentStudyCourse) grok.template('studycoursepage') form_fields = grok.AutoFields(ICustomStudentStudyCourse).select( 'certificate', 'entry_session', 'current_session', 'service_address') form_fields['service_address'].custom_widget = BytesDisplayWidget class CustomStudyCourseManageFormPage(StudyCourseManageFormPage): """ Page to edit the student study course data """ grok.context(ICustomStudentStudyCourse) grok.template('studycoursemanagepage') form_fields = grok.AutoFields(ICustomStudentStudyCourse).select( 'certificate', 'entry_session', 'current_session', 'service_address')