1 | ## $Id: viewlets.py 17079 2022-08-27 10:33:17Z 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 grok |
---|
20 | from waeup.kofa.interfaces import REQUESTED |
---|
21 | from waeup.kofa.browser.viewlets import ManageActionButton |
---|
22 | from kofacustom.edocons.students.interfaces import ( |
---|
23 | ICustomStudentStudyCourse, ICustomStudentStudyLevel) |
---|
24 | from waeup.kofa.students.fileviewlets import ( |
---|
25 | StudentFileDisplay, StudentFileUpload, StudentImage) |
---|
26 | from waeup.kofa.students.browser import ( |
---|
27 | ExportPDFClearanceSlip, StudyCourseDisplayFormPage, |
---|
28 | StudyLevelDisplayFormPage) |
---|
29 | from waeup.kofa.students.viewlets import ( |
---|
30 | AddPreviousPaymentActionButton, AddBalancePaymentActionButton, |
---|
31 | StudentPersonalEditActionButton) |
---|
32 | |
---|
33 | from kofacustom.nigeria.interfaces import MessageFactory as _ |
---|
34 | |
---|
35 | class AddBalancePaymentActionButton(AddBalancePaymentActionButton): |
---|
36 | grok.require('waeup.payStudent') |
---|
37 | |
---|
38 | # Medical Certificate |
---|
39 | |
---|
40 | class MedicalCertificateDisplay(StudentFileDisplay): |
---|
41 | """Medical Certificate display viewlet. |
---|
42 | """ |
---|
43 | grok.order(19) |
---|
44 | label = _(u'Medical Certificate') |
---|
45 | title = _(u'Medical Certificate') |
---|
46 | download_name = u'medcert' |
---|
47 | |
---|
48 | class MedicalCertificateSlip(MedicalCertificateDisplay): |
---|
49 | grok.view(ExportPDFClearanceSlip) |
---|
50 | |
---|
51 | class MedicalCertificateUpload(StudentFileUpload): |
---|
52 | """Medical Certificate upload viewlet. |
---|
53 | """ |
---|
54 | grok.order(19) |
---|
55 | label = _(u'Medical Certificate (attach blood group, genotype and chest X-ray in one pdf file)') |
---|
56 | title = _(u'Medical Certificate Scan') |
---|
57 | download_name = u'medcert' |
---|
58 | |
---|
59 | class MedicalCertificateImage(StudentImage): |
---|
60 | """Renders Medical Certificate scan. |
---|
61 | """ |
---|
62 | grok.name('medcert') |
---|
63 | download_name = u'medcert' |
---|
64 | |
---|
65 | # Specification for Female Uniform |
---|
66 | |
---|
67 | class SpecificationFemaleUniformDisplay(StudentFileDisplay): |
---|
68 | """Specification for Female Uniform display viewlet. |
---|
69 | """ |
---|
70 | grok.order(20) |
---|
71 | label = _(u'Specification for Female Uniform') |
---|
72 | title = _(u'Specification for Female Uniform') |
---|
73 | download_name = u'femuniform' |
---|
74 | |
---|
75 | class SpecificationFemaleUniformSlip(SpecificationFemaleUniformDisplay): |
---|
76 | grok.view(ExportPDFClearanceSlip) |
---|
77 | |
---|
78 | class SpecificationFemaleUniformUpload(StudentFileUpload): |
---|
79 | """Specification for Female Uniform upload viewlet. |
---|
80 | """ |
---|
81 | grok.order(20) |
---|
82 | label = _(u'Specification for Female Uniform') |
---|
83 | title = _(u'Specification for Female Uniform') |
---|
84 | download_name = u'femuniform' |
---|
85 | |
---|
86 | class SpecificationFemaleUniformImage(StudentImage): |
---|
87 | """Renders Medical Certificate scan. |
---|
88 | """ |
---|
89 | grok.name('femuniform') |
---|
90 | download_name = u'femuniform' |
---|
91 | |
---|
92 | # Hostel Form |
---|
93 | |
---|
94 | class HostelFormDisplay(StudentFileDisplay): |
---|
95 | """Hostel Form display viewlet. |
---|
96 | """ |
---|
97 | grok.order(21) |
---|
98 | label = _(u'Hostel Form') |
---|
99 | title = _(u'Hostel Form') |
---|
100 | download_name = u'hostel' |
---|
101 | |
---|
102 | class HostelFormSlip(HostelFormDisplay): |
---|
103 | grok.view(ExportPDFClearanceSlip) |
---|
104 | |
---|
105 | class HostelFormUpload(StudentFileUpload): |
---|
106 | """Hostel Form upload viewlet. |
---|
107 | """ |
---|
108 | grok.order(22) |
---|
109 | label = _(u'Hostel Form (for those in hostel only)') |
---|
110 | title = _(u'Hostel Form Scan') |
---|
111 | download_name = u'hostel' |
---|
112 | |
---|
113 | class HostelFormImage(StudentImage): |
---|
114 | """Renders Hostel Form scan. |
---|
115 | """ |
---|
116 | grok.name('hostel') |
---|
117 | download_name = u'hostel' |
---|
118 | |
---|
119 | |
---|
120 | # Renouncement of Cult |
---|
121 | |
---|
122 | class RenouncementCultDisplay(StudentFileDisplay): |
---|
123 | """Renouncement of Cult display viewlet. |
---|
124 | """ |
---|
125 | grok.order(23) |
---|
126 | label = _(u'Renouncement of Cult') |
---|
127 | title = _(u'Renouncement of Cult') |
---|
128 | download_name = u'cult' |
---|
129 | |
---|
130 | class RenouncementCultSlip(RenouncementCultDisplay): |
---|
131 | grok.view(ExportPDFClearanceSlip) |
---|
132 | |
---|
133 | class RenouncementCultUpload(StudentFileUpload): |
---|
134 | """Renouncement of Cult upload viewlet. |
---|
135 | """ |
---|
136 | grok.order(23) |
---|
137 | label = _(u'Renouncement of Cult') |
---|
138 | title = _(u'Renouncement of Cult Scan') |
---|
139 | download_name = u'cult' |
---|
140 | |
---|
141 | class RenouncementCultImage(StudentImage): |
---|
142 | """Renders Renouncement of Cult scan. |
---|
143 | """ |
---|
144 | grok.name('cult') |
---|
145 | download_name = u'cult' |
---|
146 | |
---|
147 | |
---|
148 | # Letter of Sponsorship |
---|
149 | |
---|
150 | class LetterSponsorshipDisplay(StudentFileDisplay): |
---|
151 | """Letter of Sponsorship display viewlet. |
---|
152 | """ |
---|
153 | grok.order(24) |
---|
154 | label = _(u'Letter of Sponsorship') |
---|
155 | title = _(u'Letter of Sponsorship') |
---|
156 | download_name = u'sponsor' |
---|
157 | |
---|
158 | class LetterSponsorshipSlip(LetterSponsorshipDisplay): |
---|
159 | grok.view(ExportPDFClearanceSlip) |
---|
160 | |
---|
161 | class LetterSponsorshipUpload(StudentFileUpload): |
---|
162 | """Letter of Sponsorship upload viewlet. |
---|
163 | """ |
---|
164 | grok.order(24) |
---|
165 | label = _(u'Letter of Sponsorship') |
---|
166 | title = _(u'Letter of Sponsorship Scan') |
---|
167 | download_name = u'sponsor' |
---|
168 | |
---|
169 | class LetterSponsorshipImage(StudentImage): |
---|
170 | """Renders Letter of Sponsorship scan. |
---|
171 | """ |
---|
172 | grok.name('sponsor') |
---|
173 | download_name = u'sponsor' |
---|