source: main/waeup.kwarapoly/branches/0.1/src/waeup/kwarapoly/students/viewlets.py @ 14395

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

Add personal data fields.

  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1## $Id: viewlets.py 10705 2013-11-06 08:59:15Z 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
19import grok
20from waeup.kofa.students.viewlets import (
21    AddPreviousPaymentActionButton, AddBalancePaymentActionButton,
22    ManageActionButton)
23from waeup.kofa.students.interfaces import IStudent
24from waeup.kofa.students.browser import StudentBaseDisplayFormPage
25from waeup.kofa.students.workflow import (
26    ADMITTED, PAID, REQUESTED, RETURNING, CLEARED, REGISTERED,
27    VALIDATED, GRADUATED, TRANSCRIPT, CREATED, CLEARANCE)
28from waeup.kwarapoly.interfaces import MessageFactory as _
29
30class AddPreviousPaymentActionButton(AddPreviousPaymentActionButton):
31
32    @property
33    def target_url(self):
34        return ''
35
36class AddBalancePaymentActionButton(AddBalancePaymentActionButton):
37
38    @property
39    def target_url(self):
40        return ''
41
42class AdmissionNotificationActionButton(ManageActionButton):
43    grok.order(4)
44    grok.context(IStudent)
45    grok.view(StudentBaseDisplayFormPage)
46    grok.require('waeup.viewStudent')
47    icon = 'actionicon_pdf.png'
48    text = _('Download admission notification')
49    target = 'admission_notification.pdf'
50
51    @property
52    def target_url(self):
53        if self.context.state not in (ADMITTED, CLEARANCE, REQUESTED, CLEARED):
54            return ''
55        return self.view.url(self.view.context, self.target)
56
57class AdmissionSlipActionButton(ManageActionButton):
58    grok.order(4)
59    grok.context(IStudent)
60    grok.view(StudentBaseDisplayFormPage)
61    grok.require('waeup.viewStudent')
62    icon = 'actionicon_pdf.png'
63    text = _('Download admission letter')
64    target = 'admission_slip.pdf'
65
66    @property
67    def target_url(self):
68        if self.context.state in (CREATED, ADMITTED,
69                                  CLEARANCE, REQUESTED, CLEARED):
70            return ''
71        return self.view.url(self.view.context, self.target)
72
73class RegistrationSlipActionButton(ManageActionButton):
74    grok.order(4)
75    grok.context(IStudent)
76    grok.view(StudentBaseDisplayFormPage)
77    grok.require('waeup.viewStudent')
78    icon = 'actionicon_pdf.png'
79    text = _('Download registration form')
80    target = 'registration_slip.pdf'
81
82    @property
83    def target_url(self):
84        if self.context.state in (CREATED,):
85            return ''
86        return self.view.url(self.view.context, self.target)
Note: See TracBrowser for help on using the repository browser.