Changeset 10019 for main/waeup.fceokene/trunk/src/waeup/fceokene/students
- Timestamp:
- 12 Mar 2013, 22:17:52 (12 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/students/browser.py
r9986 r10019 30 30 NigeriaExportPDFPaymentSlipPage, 31 31 NigeriaStudentClearanceEditFormPage, 32 NigeriaExportPDFClearanceSlipPage 32 33 ) 33 34 34 from waeup.fceokene.students.interfaces import ICustomStudentOnlinePayment 35 from waeup.fceokene.students.interfaces import ( 36 ICustomStudentOnlinePayment, ICustomUGStudentClearance) 35 37 36 38 class CustomExportPDFAdmissionSlipPage(ExportPDFAdmissionSlipPage): … … 48 50 def label(self): 49 51 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 50 lang = self.request.cookies.get('kofa.language', portal_language)51 52 line0 = '' 52 53 if self.context.student.current_mode.startswith('ug'): … … 92 93 return False 93 94 95 class CustomExportPDFClearanceSlipPage(NigeriaExportPDFClearanceSlipPage): 96 """Deliver a PDF slip of the context. 97 """ 98 99 @property 100 def form_fields(self): 101 if self.context.is_postgrad: 102 form_fields = grok.AutoFields( 103 ICustomPGStudentClearance).omit('clearance_locked') 104 else: 105 form_fields = grok.AutoFields( 106 ICustomUGStudentClearance).omit('clearance_locked') 107 if not getattr(self.context, 'officer_comment'): 108 form_fields = form_fields.omit('officer_comment') 109 return form_fields 110 111 @property 112 def label(self): 113 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 114 115 line0 = '' 116 if self.context.student.current_mode.startswith('ug'): 117 line0 = 'Directorate of Undergraduate Programme\n' 118 line1 = translate(_('Clearance Slip of'), 119 'waeup.kofa', target_language=portal_language) \ 120 + ' %s' % self.context.display_fullname 121 return '%s%s' % (line0, line1) 122 123 94 124 class CustomStudentClearanceEditFormPage(NigeriaStudentClearanceEditFormPage): 95 125 """ View to edit student clearance data by student -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/interfaces.py
r9538 r10019 18 18 19 19 from zope import schema 20 from waeup.kofa.schema import FormattedDate, PhoneNumber 21 from waeup.kofa.students.interfaces import IUGStudentClearance 22 from waeup.kofa.students.vocabularies import nats_vocab 23 from waeup.kofa.schoolgrades import ResultEntryField 24 from kofacustom.nigeria.interfaces import ( 25 high_qual, high_grade, exam_types, LGASource) 20 26 from kofacustom.nigeria.students.interfaces import ( 21 27 INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance, … … 37 43 """ 38 44 39 class ICustomUGStudentClearance(I NigeriaUGStudentClearance):45 class ICustomUGStudentClearance(IUGStudentClearance): 40 46 """Representation of ug student clearance data. 41 47 42 """ 48 Completely customized for FCE Okene. 49 50 """ 51 52 officer_comment = schema.Text( 53 title = _(u"Officer's Comment"), 54 required = False, 55 ) 56 57 clearance_locked = schema.Bool( 58 title = _(u'Clearance form locked'), 59 default = False, 60 required = False, 61 ) 62 63 clr_code = schema.TextLine( 64 title = _(u'CLR Activation Code'), 65 required = False, 66 readonly = False, 67 ) 68 69 date_of_birth = FormattedDate( 70 title = _(u'Date of Birth'), 71 required = False, 72 show_year = True, 73 ) 74 75 nationality = schema.Choice( 76 source = nats_vocab, 77 title = _(u'Nationality'), 78 required = True, 79 ) 80 81 lga = schema.Choice( 82 source = LGASource(), 83 title = _(u'State/LGA (Nigerians only)'), 84 required = False, 85 ) 86 87 def_adm = schema.Bool( 88 title = _(u'Deferent of Admission'), 89 required = False, 90 readonly = False, 91 ) 92 93 fst_sit_fname = schema.TextLine( 94 title = _(u'Full Name'), 95 required = False, 96 readonly = False, 97 ) 98 fst_sit_no = schema.TextLine( 99 title = _(u'Exam Number'), 100 required = False, 101 readonly = False, 102 ) 103 104 fst_sit_date = FormattedDate( 105 title = _(u'Exam Date'), 106 required = False, 107 readonly = False, 108 show_year = True, 109 ) 110 111 fst_sit_type = schema.Choice( 112 title = _(u'Exam Type'), 113 required = False, 114 readonly = False, 115 vocabulary = exam_types, 116 ) 117 118 fst_sit_results = schema.List( 119 title = _(u'Exam Results'), 120 value_type = ResultEntryField(), 121 required = False, 122 readonly = False, 123 default = [], 124 ) 125 126 scd_sit_fname = schema.TextLine( 127 title = _(u'Full Name'), 128 required = False, 129 readonly = False, 130 ) 131 scd_sit_no = schema.TextLine( 132 title = _(u'Exam Number'), 133 required = False, 134 readonly = False, 135 ) 136 137 scd_sit_date = FormattedDate( 138 title = _(u'Exam Date'), 139 required = False, 140 readonly = False, 141 show_year = True, 142 ) 143 144 scd_sit_type = schema.Choice( 145 title = _(u'Exam Type'), 146 required = False, 147 readonly = False, 148 vocabulary = exam_types, 149 ) 150 151 scd_sit_results = schema.List( 152 title = _(u'Exam Results'), 153 value_type = ResultEntryField(), 154 required = False, 155 readonly = False, 156 default = [], 157 ) 158 159 #alr_fname = schema.TextLine( 160 # title = _(u'Full Name'), 161 # required = False, 162 # readonly = False, 163 # ) 164 165 #alr_no = schema.TextLine( 166 # title = _(u'Exam Number'), 167 # required = False, 168 # readonly = False, 169 # ) 170 171 #alr_date = FormattedDate( 172 # title = _(u'Exam Date'), 173 # required = False, 174 # readonly = False, 175 # show_year = True, 176 # ) 177 178 #alr_results = schema.List( 179 # title = _(u'Exam Results'), 180 # value_type = ResultEntryField(), 181 # required = False, 182 # readonly = False, 183 # default = [], 184 # ) 185 186 hq_type = schema.Choice( 187 title = _(u'Qualification Obtained'), 188 required = False, 189 readonly = False, 190 vocabulary = high_qual, 191 ) 192 193 hq_fname = schema.TextLine( 194 title = _(u'Full Name'), 195 required = False, 196 readonly = False, 197 ) 198 199 hq_matric_no = schema.TextLine( 200 title = _(u'Former Matric Number'), 201 required = False, 202 readonly = False, 203 ) 204 205 #hq_degree = schema.Choice( 206 # title = _(u'Class of Degree'), 207 # required = False, 208 # readonly = False, 209 # vocabulary = high_grade, 210 # ) 211 212 hq_school = schema.TextLine( 213 title = _(u'Institution Attended'), 214 required = False, 215 readonly = False, 216 ) 217 218 hq_session = schema.TextLine( 219 title = _(u'Years Attended'), 220 required = False, 221 readonly = False, 222 ) 223 224 hq_disc = schema.TextLine( 225 title = _(u'Course Combination'), 226 required = False, 227 readonly = False, 228 ) 43 229 44 230 class ICustomPGStudentClearance(INigeriaPGStudentClearance): -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py
r10018 r10019 343 343 344 344 def test_open_slips(self): 345 # Managers can add onlineclearance slip345 # Managers can open clearance slip 346 346 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 347 347 self.browser.open(self.student_path + '/view_clearance') -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py
r10012 r10019 330 330 return _('(see payment slip)') 331 331 332 SEPARATORS_DICT = { 333 'form.fst_sit_fname': _(u'First Sitting Record'), 334 'form.scd_sit_fname': _(u'Second Sitting Record'), 335 #'form.alr_fname': _(u'Advanced Level Record'), 336 'form.hq_type': _(u'Advanced Level Record'), 337 'form.hq2_type': _(u'Second Higher Education Record'), 338 'form.nysc_year': _(u'NYSC Information'), 339 'form.employer': _(u'Employment History'), 340 'form.former_matric': _(u'Former Student'), 341 } 342 332 343 # FCEOkene prefix 333 344 STUDENT_ID_PREFIX = u'K'
Note: See TracChangeset for help on using the changeset viewer.