Changeset 16127 for main


Ignore:
Timestamp:
25 Jun 2020, 05:18:16 (5 years ago)
Author:
Henrik Bettermann
Message:

Customize admission slip.

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py

    r16031 r16127  
    2121from zope.component import getUtility
    2222from hurry.workflow.interfaces import IWorkflowInfo
    23 from waeup.kofa.interfaces import REQUESTED, IExtFileStore, IKofaUtils
     23from waeup.kofa.interfaces import (REQUESTED, IExtFileStore, IKofaUtils,
     24    academic_sessions_vocab)
    2425from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
    2526from waeup.kofa.browser.layout import (
     
    3031    CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage,
    3132    StartClearancePage, BalancePaymentAddFormPage,
     33    ExportPDFAdmissionSlip,
    3234    msave, emit_lock_message)
    3335from waeup.kofa.students.interfaces import (
    3436    IStudentsUtils, ICourseTicket, IStudent)
     37from waeup.kofa.students.vocabularies import StudyLevelSource
    3538from waeup.kofa.students.workflow import FORBIDDEN_POSTGRAD_TRANS
    3639from kofacustom.nigeria.students.browser import (
     
    219222class CustomBalancePaymentAddFormPage(BalancePaymentAddFormPage):
    220223    grok.require('waeup.payStudent')
     224
     225class CustomExportPDFAdmissionSlip(ExportPDFAdmissionSlip):
     226    """Deliver a PDF Admission slip.
     227    """
     228
     229    omit_fields = ('date_of_birth', 'current_level', 'current_mode',
     230                   'entry_session')
     231
     232    @property
     233    def session(self):
     234        return academic_sessions_vocab.getTerm(
     235            self.context.entry_session).title
     236
     237    @property
     238    def level(self):
     239        studylevelsource = StudyLevelSource()
     240        return studylevelsource.factory.getTitle(
     241            self.context['studycourse'].certificate, self.context.current_level)
     242
     243    @property
     244    def label(self):
     245        return 'OFFER OF PROVISIONAL ADMISSION \nFOR %s SESSION' % self.session
     246
     247    @property
     248    def pre_text(self):
     249        return (
     250            'Following your performance in the screening exercise '
     251            'for the %s academic session, I am pleased to inform '
     252            'you that you have been offered provisional admission into the '
     253            'Igbinedion University, Okada as follows:' % self.session)
     254
     255    @property
     256    def post_text(self):
     257        return """
     258Please note that at the point of registration for your programme of study (course), you will be required to present the following documents: Current UTME result slip, WAEC/NECO (0' Level) result, Birth certificate or sworn affidavit of age, and Health certificate from a recognized Medical Centre.
     259
     260All credentials (orlglnal) will be checked during registration. This admission will be cancelled at any point in time it is found that your claims in the application form are false.
     261
     262You are required to show evidence of the result / credentials you presented on application for admission.
     263
     264Fees can be paid using any of the following options
     265
     2661. Fees can be paid on through you portal page. INSTRUCTIONS can be found below "FEES PAYMENT PROCEDURE" for the options you have to make your payment, as well as instructions on how to use your preferred payment option.
     2672. If you choose to use the bank payment option, you can pay at any branch of the following banks through etranzact platform only: Access Bank, First Bank, Zenith Bank, and Keystone Bank
     268
     269Kindly note the following:
     270
     2711. Fees indicated on the Fee Structure page are valid for the current session only.
     2722. Your Student Id (indicated above) Is your logln to the University portal.
     2733. As an indication of your acceptance of this offer of admission, you should pay a non-refundable Acceptance deposit of 200,000. Further note that the 200,000 deposit is part of the tuition fee for the session. Failure to pay after the expiration of two weeks may lead to forfeiture of admission.
     2744.      All fees must be paid in full at the beginning of the session, as basis for accommodation, registration and attendance of lectures. This is the rule for all students at all levels. Install mental payments of not more than two installments, may be allowed under exceptional circumstances
     2755.      Fees once paid are not refundable.
     2766. It is advisable that you keep the original receipts of fees paid and present them on demand.
     277
     278Accommodation: Accommodation in University hostels is compulsory for every student. No student Is allowed to live outside the hostels. Any student who does so will be expelled from the University. For further details, please refer to the Bursary for Information on fees.
     279
     280Food: Food is available in cafeteria on "pay-as-you-eat" basis.
     281
     282Resumption Date: The University opens for fresh students on Saturday, 28th September, 2020. All newly admitted students are expected to report on that date.
     283
     284Registration/Orientation Programme: Orientation programme/registration for fresh students will start on Monday, 30th September 2020. Registration ends on 2020-10-30. A late registration fee of N50,000 will be charged after this date. All credentials, O'Level Results, Birth Certificate/Age Declaration, UTME Result Slip (Original) will be checked during registration. This admission will be cancelled at any point in time it is found that any of your claims in the application form is false.
     285
     286Transport Facility: The University provides a compulsory shuttle bus service to all students at a fee already included in the other charges.
     287
     288Kindly note that fresh students are not allowed the use of private vehicles.
     289
     290Conduct: All students are expected to conduct themselves properly and dress decently on campus, as well as obey all rules and regulations as failure to comply will attract appropriate sanctions.
     291
     292We wish you a successful academic career In Igbinedion University.
     293
     294Congratulations!
     295
     296L.P.E. Jagbedia
     297Ag. Registrar
     298registrar@iuokada.edo.ng
     29908037349527
     300"""
     301
     302    def render(self):
     303        students_utils = getUtility(IStudentsUtils)
     304        return students_utils.renderPDFAdmissionLetter(self,
     305            self.context.student, omit_fields=self.omit_fields,
     306            pre_text=self.pre_text, post_text=self.post_text)
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_browser.py

    r16087 r16127  
    138138        open(path, 'wb').write(self.browser.contents)
    139139        print "Sample PDF basedata_slip.pdf written to %s" % path
     140
     141    def test_student_admission_letter(self):
     142        # Student cant login if their password is not set
     143        IWorkflowInfo(self.student).fireTransition('admit')
     144        self.browser.open(self.login_path)
     145        self.browser.getControl(name="form.login").value = self.student_id
     146        self.browser.getControl(name="form.password").value = 'spwd'
     147        self.browser.getControl("Login").click()
     148        self.assertMatches(
     149            '...You logged in...', self.browser.contents)
     150        # Admitted student can upload a passport picture
     151        #self.browser.open(self.student_path + '/change_portrait')
     152        #ctrl = self.browser.getControl(name='passportuploadedit')
     153        #file_obj = open(SAMPLE_IMAGE, 'rb')
     154        #file_ctrl = ctrl.mech_control
     155        #file_ctrl.add_file(file_obj, filename='my_photo.jpg')
     156        #self.browser.getControl(
     157        #    name='upload_passportuploadedit').click()
     158        #self.assertTrue(
     159        #    'src="http://localhost/app/students/K1000000/passport.jpg"'
     160        #    in self.browser.contents)
     161        # Students can open admission letter
     162        self.browser.getLink("Base Data").click()
     163        self.browser.getLink("Download admission letter").click()
     164        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     165        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     166        path = os.path.join(samples_dir(), 'admission_slip.pdf')
     167        open(path, 'wb').write(self.browser.contents)
     168        print "Sample PDF admission_slip.pdf written to %s" % path
Note: See TracChangeset for help on using the changeset viewer.