Changeset 8806 for main/waeup.futminna/trunk
- Timestamp:
- 26 Jun 2012, 07:46:43 (13 years ago)
- Location:
- main/waeup.futminna/trunk/src/waeup/futminna
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.futminna/trunk/src/waeup/futminna
- Property svn:mergeinfo changed
/main/waeup.uniben/trunk/src/waeup/uniben merged: 8803-8804
- Property svn:mergeinfo changed
-
main/waeup.futminna/trunk/src/waeup/futminna/applicants/browser.py
r8619 r8806 33 33 ApplicantBaseDisplayFormPage) 34 34 from waeup.kofa.applicants.viewlets import ( 35 PaymentReceiptActionButton )35 PaymentReceiptActionButton, PDFActionButton) 36 36 from waeup.kofa.applicants.pdf import PDFApplicationSlip 37 37 from waeup.futminna.applicants.interfaces import ( … … 41 41 UG_OMIT_PDF_FIELDS, PG_OMIT_PDF_FIELDS, 42 42 UG_OMIT_MANAGE_FIELDS, PG_OMIT_MANAGE_FIELDS, 43 UG_OMIT_EDIT_FIELDS, PG_OMIT_EDIT_FIELDS, PUTME_OMIT_EDIT_FIELDS) 43 UG_OMIT_EDIT_FIELDS, PG_OMIT_EDIT_FIELDS, PUTME_OMIT_EDIT_FIELDS, 44 UG_OMIT_RESULT_SLIP_FIELDS) 44 45 from waeup.futminna.interfaces import MessageFactory as _ 45 46 … … 63 64 grok.context(ICustomApplicantOnlinePayment) 64 65 66 class PDFActionButton(PDFActionButton): 67 68 @property 69 def text(self): 70 if getattr(self.context, 'result_uploaded', False): 71 return _('Download result slip') 72 return _('Download application slip') 73 74 65 75 class CustomPDFApplicationSlip(PDFApplicationSlip): 66 76 77 def _reduced_slip(self): 78 return getattr(self.context, 'result_uploaded', False) 79 67 80 @property 68 81 def note(self): 69 82 target = getattr(self.context.__parent__, 'prefix', None) 70 if target is not None and not target.startswith('pg'): 83 if target is not None and not target.startswith('pg') \ 84 and not self._reduced_slip(): 71 85 return _(u'<br /><br /><br />' 72 86 'Comfirm your exam venue 72 hours to the exam.') … … 82 96 else: 83 97 form_fields = grok.AutoFields(IUGApplicant) 84 for field in UG_OMIT_PDF_FIELDS: 85 form_fields = form_fields.omit(field) 98 if self._reduced_slip(): 99 for field in UG_OMIT_RESULT_SLIP_FIELDS: 100 form_fields = form_fields.omit(field) 101 else: 102 for field in UG_OMIT_PDF_FIELDS: 103 form_fields = form_fields.omit(field) 104 if not getattr(self.context, 'student_id'): 105 form_fields = form_fields.omit('student_id') 86 106 return form_fields 87 107 -
main/waeup.futminna/trunk/src/waeup/futminna/applicants/interfaces.py
r8744 r8806 34 34 from waeup.futminna.payments.interfaces import ICustomOnlinePayment 35 35 36 UG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 'password') 36 UG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 37 'password', 'result_uploaded') 37 38 UG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('email', 'phone') 38 39 UG_OMIT_MANAGE_FIELDS = () 39 40 UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + ('locked', 'course_admitted', 40 41 'student_id', 'screening_score', 'screening_venue', 'notice', 41 'screening_date' )42 'screening_date', 'result_uploaded') 42 43 PUTME_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + ( 43 44 'firstname', 'middlename', 'lastname', 'sex', 44 45 'course1', 'lga', 'jamb_score', 'jamb_subjects') 46 UG_OMIT_RESULT_SLIP_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('email', 'phone', 47 'date_of_birth', 'sex', 48 'nationality', 'lga', 'perm_address', 'course2', 'screening_venue', 49 'screening_date') 45 50 46 51 PG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 'password') … … 105 110 ) 106 111 screening_score = schema.Int( 107 title = _(u'Screening Score'), 108 required = False, 112 title = _(u'Screening Score (%)'), 113 required = False, 114 ) 115 aggregate = schema.Int( 116 title = _(u'Aggregate Score (%)'), 117 description = _(u'(average of relative JAMB and PUTME scores)'), 118 required = False, 119 ) 120 result_uploaded = schema.Bool( 121 title = _(u'Result uploaded'), 122 default = False, 109 123 ) 110 124 student_id = schema.TextLine( -
main/waeup.futminna/trunk/src/waeup/futminna/applicants/tests.py
r8730 r8806 309 309 # into two parts. 310 310 self.assertTrue( 311 'a pplicant_id,application_date,application_number,course1,course2,'311 'aggregate,applicant_id,application_date,application_number,course1,course2,' 312 312 'course_admitted,date_of_birth,display_fullname,email,emp2_end,' 313 313 'emp2_position,emp2_reason,emp2_start,emp_end,emp_position,' … … 317 317 'nationality,notice,nysc_lga,' 318 318 'nysc_year,password,perm_address,phone,pp_school,presently_inst,' 319 'reg_number, screening_date,screening_score,screening_venue,sex,'319 'reg_number,result_uploaded,screening_date,screening_score,screening_venue,sex,' 320 320 'state,student_id,' 321 321 'container_code' … … 324 324 'Application initialized by system\'],,,,,,,,,Tester,,0,M.,,' 325 325 '"Some notice\nin lines.",,,any password,,+234-123-12345,,,' 326 '123456,"Saturday, 16th June 2012 2:00:00 PM",98,Exam Room,f,' 327 'initialized,,dp2011' in result) 328 # We can import the same file with if we ignore some columns. 326 '123456,,"Saturday, 16th June 2012 2:00:00 PM",98,Exam Room,f,' 327 'initialized,,dp2011' 328 in result) 329 # We can import the same file if we ignore some columns. 329 330 # Since the applicants_catalog hasn't been notified, the same 330 331 # record with same reg_number can be imported twice. … … 332 333 result = processor.doImport( 333 334 self.outfile, 334 [' ignore_applicant_id','application_date','ignore_application_number',335 ' course1','course2',335 ['aggreagate','ignore_applicant_id','application_date', 336 'ignore_application_number','course1','course2', 336 337 'course_admitted','date_of_birth','ignore3','email','emp2_end', 337 338 'emp2_position','emp2_reason','emp2_start','emp_end','emp_position', … … 341 342 'nationality','notice','nysc_lga', 342 343 'nysc_year','password','perm_address','phone','pp_school','presently_inst', 343 'reg_number','screening_date','screening_score','screening_venue','sex', 344 'reg_number','result_uploaded', 345 'screening_date','screening_score','screening_venue','sex', 344 346 'state','student_id','container_code'], 345 347 mode='create') … … 355 357 result = processor.doImport( 356 358 self.outfile, 357 [' ignore_applicant_id','application_date','ignore_application_number',358 ' course1','course2',359 ['aggregate','ignore_applicant_id','application_date', 360 'ignore_application_number','course1','course2', 359 361 'course_admitted','date_of_birth','ignore3','email','emp2_end', 360 362 'emp2_position','emp2_reason','emp2_start','emp_end','emp_position', … … 364 366 'nationality','notice','nysc_lga', 365 367 'nysc_year','password','perm_address','phone','pp_school','presently_inst', 366 'reg_number','screening_date','screening_score','screening_venue','sex', 368 'reg_number','result_uploaded','screening_date','screening_score', 369 'screening_venue','sex', 367 370 'state','student_id','ignore_container_code'], 368 371 mode='update') -
main/waeup.futminna/trunk/src/waeup/futminna/students/interfaces.py
r8619 r8806 33 33 from waeup.futminna.interfaces import MessageFactory as _ 34 34 from waeup.futminna.payments.interfaces import ICustomOnlinePayment 35 from waeup.futminna.utils.lgas import LGAS36 35 37 36
Note: See TracChangeset for help on using the changeset viewer.