Changeset 17885 for main/waeup.uniben


Ignore:
Timestamp:
11 Aug 2024, 19:29:13 (3 months ago)
Author:
Henrik Bettermann
Message:

Provide affidavit of good conduct form.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py

    r17880 r17885  
    11671167    grok.require('waeup.uploadStudentFile')
    11681168    grok.template('affidavituploadpage')
    1169     label = _('Upload affidavit of good behavior')
     1169    label = _('Upload affidavit of good conduct')
    11701170    deletion_warning = _('Are you sure?')
    11711171    pnav = 4
     1172
     1173class ExportPDFAffidavitSlip(UtilityView, grok.View):
     1174    """Deliver a affidavit PDF template.
     1175    """
     1176    grok.context(ICustomStudent)
     1177    grok.name('affidavit_good_conduct.pdf')
     1178    grok.require('waeup.viewStudent')
     1179    prefix = 'form'
     1180
     1181    omit_fields = ('date_of_birth', 'current_level', 'certificate',
     1182        'current_mode', 'entry_session')
     1183
     1184    form_fields = grok.AutoFields(ICustomStudentBase).select('student_id', 'matric_number')
     1185
     1186    pre_text = ' '
     1187
     1188    post_text = '''
     1189To undertake as follows:
     1190
     1191(i) to abide by the arrangement(s) put in place by the University Management for the
     1192supply, distribution and utilization of electricity on the campuses of the
     1193University of Benin;
     1194
     1195(ii) to pay outstanding school charges upon resumption as eligibility for examinations
     1196will henceforth be strictly based on presentation of evidence of payment of approved
     1197school charges;
     1198
     1199(iii) not to bring any prohibited appliances, such as hot plate, ring boiler,
     1200gas cooker etc into the Halls of Residence, as violation of this rule shall attract
     1201rustication of such a Student;
     1202
     1203(iv) not to be involved in any unruly conduct that is against the Rules and
     1204Regulations of the University; and
     1205
     1206(v) to be of good conduct, and not to sponsor or participate in any unauthorized
     1207assembly or demonstration within the campuses and their precincts.
     1208
     1209
     1210
     1211
     1212
     1213________________________________
     1214Student Signature
     1215
     1216'''
     1217
     1218    @property
     1219    def label(self):
     1220        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
     1221        return 'Affidavit of Undertaking to be of Good Conduct'
     1222           
     1223    def render(self):
     1224        students_utils = getUtility(IStudentsUtils)
     1225        letterhead_path = os.path.join(
     1226            os.path.dirname(__file__), 'static', 'letterhead.jpg')
     1227        if not os.path.exists(letterhead_path):
     1228            letterhead_path = None
     1229        return students_utils.renderPDFAdmissionLetter(self,
     1230            self.context.student, omit_fields=self.omit_fields,
     1231            letterhead_path=letterhead_path,
     1232            pre_text=self.pre_text, post_text=self.post_text)
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser_templates/affidavituploadpage.pt

    r17883 r17885  
    11<form action="." tal:attributes="action request/URL" method="post"
    22      enctype="multipart/form-data" i18n:domain="waeup.kofa">
    3   <p></p>
     3  <p>Download your personal 'Affidavit of Good Conduct' form,
     4  scan the signed form into a pdf file and re-upload here.</p>
    45  <table class="form-table">
    56    <tbody>
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r17845 r17885  
    12981298        print "Sample PDF fee_payment_history.pdf written to %s" % path
    12991299        return
     1300
     1301    def test_affidavit_slip(self):
     1302        self.browser.open(self.login_path)
     1303        self.browser.getControl(name="form.login").value = self.student_id
     1304        self.browser.getControl(name="form.password").value = 'spwd'
     1305        self.browser.getControl("Login").click()
     1306        self.browser.getLink("Base Data").click()
     1307        self.browser.getLink("Upload affidavit of good conduct").click()
     1308        self.browser.getLink("Download affidavit of good conduct form").click()
     1309        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     1310        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     1311        path = os.path.join(samples_dir(), 'affidavit_good_conduct.pdf')
     1312        open(path, 'wb').write(self.browser.contents)
     1313        print "Sample PDF affidavit_good_conduct.pdf written to %s" % path
  • main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py

    r17881 r17885  
    3939
    4040from waeup.uniben.students.browser import (
    41     StudentMedicalHistoryEditFormPage, StudentAffidavitUploadPage)
     41    StudentMedicalHistoryEditFormPage, StudentAffidavitUploadPage,
     42    StudentAffidavitUploadPage)
    4243
    4344from kofacustom.nigeria.interfaces import MessageFactory as _
     
    271272    grok.require('waeup.handleStudent')
    272273    icon = 'actionicon_signature.png'
    273     text = _('Upload affidavit of good behavior')
     274    text = _('Upload affidavit of good conduct')
    274275    target = 'affidavit_upload'
    275276
     
    281282    grok.view(StudentBaseDisplayFormPage)
    282283    grok.require('waeup.viewStudent')
    283     label = _(u'Scanned Affidavit of Good Behavior')
     284    label = _(u'Scanned Affidavit of Good Conduct')
    284285    download_name = u'affidavit.pdf'
     286
     287class AffidavitSlipActionButton(ManageActionButton):
     288    grok.order(1)
     289    grok.context(ICustomStudent)
     290    grok.view(StudentAffidavitUploadPage)
     291    grok.require('waeup.viewStudent')
     292    icon = 'actionicon_pdf.png'
     293    text = _('Download affidavit of good conduct form')
     294    target = 'affidavit_good_conduct.pdf'
    285295
    286296class AffidavitUploadManage(StudentFileUpload):
     
    291301    grok.view(StudentBaseManageFormPage)
    292302    grok.require('waeup.manageStudent')
    293     label = _(u'Scanned Affidavit of Good Behavior (pdf only)')
     303    label = _(u'Scanned Affidavit of Good Conduct (pdf only)')
    294304    download_name = u'affidavit.pdf'
    295305
    296306class AffidavitUploadEdit(AffidavitUploadManage):
    297     """Affidavit of Good Behavior upload viewlet for students.
     307    """Affidavit of Good Conduct upload viewlet for students.
    298308    """
    299309    grok.view(StudentAffidavitUploadPage)
    300310    grok.require('waeup.uploadStudentFile')
    301311
    302 class AffidavitGoodBehavior(StudentImage):
     312class AffidavitGoodConduct(StudentImage):
    303313    """Renders pdf slip.
    304314    """
Note: See TracChangeset for help on using the changeset viewer.