Changeset 8807 for main


Ignore:
Timestamp:
26 Jun 2012, 07:46:53 (12 years ago)
Author:
Henrik Bettermann
Message:

Merged with waeup.uniben 8802:HEAD.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene

  • main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/browser.py

    r8566 r8807  
    3333    ApplicantBaseDisplayFormPage)
    3434from waeup.kofa.applicants.viewlets import (
    35     PaymentReceiptActionButton)
     35    PaymentReceiptActionButton, PDFActionButton)
    3636from waeup.kofa.applicants.pdf import PDFApplicationSlip
    3737from waeup.fceokene.applicants.interfaces import (
     
    4141    UG_OMIT_PDF_FIELDS, PG_OMIT_PDF_FIELDS,
    4242    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)
    4445from waeup.fceokene.interfaces import MessageFactory as _
    4546
     
    6364    grok.context(ICustomApplicantOnlinePayment)
    6465
     66class 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
    6575class CustomPDFApplicationSlip(PDFApplicationSlip):
    6676
    67     note = _(u'<br /><br /><br />'
    68               'Comfirm your exam venue 72 hours to the exam.')
     77    def _reduced_slip(self):
     78        return getattr(self.context, 'result_uploaded', False)
     79
     80    @property
     81    def note(self):
     82        target = getattr(self.context.__parent__, 'prefix', None)
     83        if target is not None and not target.startswith('pg') \
     84            and not self._reduced_slip():
     85            return _(u'<br /><br /><br />'
     86                      'Comfirm your exam venue 72 hours to the exam.')
     87        return
    6988
    7089    @property
     
    7796        else:
    7897            form_fields = grok.AutoFields(IUGApplicant)
    79             for field in UG_OMIT_PDF_FIELDS:
    80                 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')
    81106        return form_fields
    82107
  • main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/interfaces.py

    r8745 r8807  
    3434from waeup.fceokene.payments.interfaces import ICustomOnlinePayment
    3535
    36 UG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 'password')
     36UG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted',
     37    'password', 'result_uploaded')
    3738UG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('email', 'phone')
    3839UG_OMIT_MANAGE_FIELDS = ()
    3940UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + ('locked', 'course_admitted',
    4041    'student_id', 'screening_score', 'screening_venue', 'notice',
    41     'screening_date')
     42    'screening_date', 'result_uploaded')
    4243PUTME_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + (
    4344    'firstname', 'middlename', 'lastname', 'sex',
    4445    'course1', 'lga', 'jamb_score', 'jamb_subjects')
     46UG_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')
    4550
    4651PG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 'password')
     
    105110        )
    106111    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,
    109123        )
    110124    student_id = schema.TextLine(
  • main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests.py

    r8671 r8807  
    215215        # into two parts.
    216216        self.assertTrue(
    217             'applicant_id,application_date,application_number,course1,course2,'
     217            'aggregate,applicant_id,application_date,application_number,course1,course2,'
    218218            'course_admitted,date_of_birth,display_fullname,email,emp2_end,'
    219219            'emp2_position,emp2_reason,emp2_start,emp_end,emp_position,'
     
    223223            'nationality,notice,nysc_lga,'
    224224            'nysc_year,password,perm_address,phone,pp_school,presently_inst,'
    225             'reg_number,screening_date,screening_score,screening_venue,sex,'
     225            'reg_number,result_uploaded,screening_date,screening_score,screening_venue,sex,'
    226226            'state,student_id,'
    227227            'container_code'
     
    230230            'Application initialized by system\'],,,,,,,,,Tester,,0,M.,,'
    231231            '"Some notice\nin lines.",,,any password,,+234-123-12345,,,'
    232             '123456,"Saturday, 16th June 2012 2:00:00 PM",98,Exam Room,f,'
    233             'initialized,,dp2011' in result)
    234         # We can import the same file with if we ignore some columns.
     232            '123456,,"Saturday, 16th June 2012 2:00:00 PM",98,Exam Room,f,'
     233            'initialized,,dp2011'
     234            in result)
     235        # We can import the same file if we ignore some columns.
    235236        # Since the applicants_catalog hasn't been notified, the same
    236237        # record with same reg_number can be imported twice.
     
    238239        result = processor.doImport(
    239240            self.outfile,
    240             ['ignore_applicant_id','application_date','ignore_application_number',
    241             'course1','course2',
     241            ['aggreagate','ignore_applicant_id','application_date',
     242            'ignore_application_number','course1','course2',
    242243            'course_admitted','date_of_birth','ignore3','email','emp2_end',
    243244            'emp2_position','emp2_reason','emp2_start','emp_end','emp_position',
     
    247248            'nationality','notice','nysc_lga',
    248249            'nysc_year','password','perm_address','phone','pp_school','presently_inst',
    249             'reg_number','screening_date','screening_score','screening_venue','sex',
     250            'reg_number','result_uploaded',
     251            'screening_date','screening_score','screening_venue','sex',
    250252            'state','student_id','container_code'],
    251253            mode='create')
     
    261263        result = processor.doImport(
    262264            self.outfile,
    263             ['ignore_applicant_id','application_date','ignore_application_number',
    264             'course1','course2',
     265            ['aggregate','ignore_applicant_id','application_date',
     266            'ignore_application_number','course1','course2',
    265267            'course_admitted','date_of_birth','ignore3','email','emp2_end',
    266268            'emp2_position','emp2_reason','emp2_start','emp_end','emp_position',
     
    270272            'nationality','notice','nysc_lga',
    271273            'nysc_year','password','perm_address','phone','pp_school','presently_inst',
    272             'reg_number','screening_date','screening_score','screening_venue','sex',
     274            'reg_number','result_uploaded','screening_date','screening_score',
     275            'screening_venue','sex',
    273276            'state','student_id','ignore_container_code'],
    274277            mode='update')
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/interfaces.py

    r8584 r8807  
    3333from waeup.fceokene.interfaces import MessageFactory as _
    3434from waeup.fceokene.payments.interfaces import ICustomOnlinePayment
    35 from waeup.fceokene.utils.lgas import LGAS
    3635
    3736
Note: See TracChangeset for help on using the changeset viewer.