source: main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py @ 9206

Last change on this file since 9206 was 9205, checked in by Henrik Bettermann, 12 years ago

In case we need to immediately deactivate clearance.

  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1## $Id: browser.py 9205 2012-09-19 14:24:18Z 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 waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
21from waeup.kofa.students.browser import (
22    StudentClearPage, StudentRejectClearancePage)
23from kofacustom.nigeria.students.browser import (
24    NigeriaOnlinePaymentDisplayFormPage,
25    NigeriaOnlinePaymentAddFormPage,
26    NigeriaExportPDFPaymentSlipPage)
27
28from waeup.uniben.students.interfaces import ICustomStudentOnlinePayment
29
30class CustomOnlinePaymentDisplayFormPage(NigeriaOnlinePaymentDisplayFormPage):
31    """ Page to view an online payment ticket
32    """
33    grok.context(ICustomStudentOnlinePayment)
34    form_fields = grok.AutoFields(ICustomStudentOnlinePayment)
35    form_fields[
36        'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
37    form_fields[
38        'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
39
40class CustomOnlinePaymentAddFormPage(NigeriaOnlinePaymentAddFormPage):
41    """ Page to add an online payment ticket
42    """
43    form_fields = grok.AutoFields(ICustomStudentOnlinePayment).select(
44        'p_category')
45
46class CustomExportPDFPaymentSlipPage(NigeriaExportPDFPaymentSlipPage):
47    """Deliver a PDF slip of the context.
48    """
49    grok.context(ICustomStudentOnlinePayment)
50    form_fields = grok.AutoFields(ICustomStudentOnlinePayment)
51    form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
52    form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
53
54
55## In case we need to deactivate clearance
56#class CustomStudentClearPage(StudentClearPage):
57#    """ Clear student by clearance officer
58#    """
59#    def update(self):
60#        self.flash('Clearance temporarily disabled!')
61#        self.redirect(self.url(self.context,'view_clearance'))
62#        return
63
64#class CustomStudentRejectClearancePage(StudentRejectClearancePage):
65#    """ Reject clearance by clearance officers
66#    """
67
68#    def update(self):
69#        self.flash('Clearance temporarily disabled!')
70#        self.redirect(self.url(self.context,'view_clearance'))
71#        return
Note: See TracBrowser for help on using the repository browser.