Index: /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py	(revision 9055)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py	(revision 9056)
@@ -21,4 +21,5 @@
 from zope.component import getUtility
 from zope.i18n import translate
+from zope.formlib.textwidgets import BytesDisplayWidget
 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
 from waeup.kofa.students.interfaces import IStudentsUtils
@@ -38,9 +39,23 @@
     ICustomPGApplicant, ICustomUGApplicant, ICustomPGApplicantEdit, ICustomUGApplicantEdit,
     ICustomApplicantOnlinePayment, IPUTMEApplicantEdit,
-    UG_OMIT_DISPLAY_FIELDS, PG_OMIT_DISPLAY_FIELDS,
-    UG_OMIT_PDF_FIELDS, PG_OMIT_PDF_FIELDS,
-    UG_OMIT_MANAGE_FIELDS, PG_OMIT_MANAGE_FIELDS,
-    UG_OMIT_EDIT_FIELDS, PG_OMIT_EDIT_FIELDS, PUTME_OMIT_EDIT_FIELDS,
-    UG_OMIT_RESULT_SLIP_FIELDS)
+    UG_OMIT_DISPLAY_FIELDS,
+    UG_OMIT_PDF_FIELDS,
+    UG_OMIT_MANAGE_FIELDS,
+    UG_OMIT_EDIT_FIELDS,
+    PG_OMIT_DISPLAY_FIELDS,
+    PG_OMIT_PDF_FIELDS,
+    PG_OMIT_MANAGE_FIELDS,
+    PG_OMIT_EDIT_FIELDS,
+    PUTME_OMIT_DISPLAY_FIELDS,
+    PUTME_OMIT_PDF_FIELDS,
+    PUTME_OMIT_MANAGE_FIELDS,
+    PUTME_OMIT_EDIT_FIELDS,
+    PUTME_OMIT_RESULT_SLIP_FIELDS,
+    PUDE_OMIT_DISPLAY_FIELDS,
+    PUDE_OMIT_PDF_FIELDS,
+    PUDE_OMIT_MANAGE_FIELDS,
+    PUDE_OMIT_EDIT_FIELDS,
+    PUDE_OMIT_RESULT_SLIP_FIELDS,
+    )
 from waeup.uniben.interfaces import MessageFactory as _
 
@@ -62,4 +77,31 @@
         return _('Download application slip')
 
+
+class CustomApplicantDisplayFormPage(ApplicantDisplayFormPage):
+    """A display view for applicant data.
+    """
+
+    @property
+    def form_fields(self):
+        target = getattr(self.context.__parent__, 'prefix', None)
+        if target is not None and target.startswith('pg'):
+            form_fields = grok.AutoFields(ICustomPGApplicant)
+            for field in PG_OMIT_DISPLAY_FIELDS:
+                form_fields = form_fields.omit(field)
+        elif target is not None and target.startswith('putme'):
+            form_fields = grok.AutoFields(ICustomUGApplicant)
+            for field in PUTME_OMIT_DISPLAY_FIELDS:
+                form_fields = form_fields.omit(field)
+        elif target is not None and target.startswith('pude'):
+            form_fields = grok.AutoFields(ICustomUGApplicant)
+            for field in PUDE_OMIT_DISPLAY_FIELDS:
+                form_fields = form_fields.omit(field)
+        else:
+            form_fields = grok.AutoFields(ICustomUGApplicant)
+            for field in UG_OMIT_DISPLAY_FIELDS:
+                form_fields = form_fields.omit(field)
+        form_fields['perm_address'].custom_widget = BytesDisplayWidget
+        form_fields['notice'].custom_widget = BytesDisplayWidget
+        return form_fields
 
 class CustomPDFApplicationSlip(PDFApplicationSlip):
@@ -84,33 +126,28 @@
             for field in PG_OMIT_PDF_FIELDS:
                 form_fields = form_fields.omit(field)
-        else:
+        elif target is not None and target.startswith('putme'):
             form_fields = grok.AutoFields(ICustomUGApplicant)
             if self._reduced_slip():
-                for field in UG_OMIT_RESULT_SLIP_FIELDS:
+                for field in PUTME_OMIT_RESULT_SLIP_FIELDS:
                     form_fields = form_fields.omit(field)
             else:
-                for field in UG_OMIT_PDF_FIELDS:
-                    form_fields = form_fields.omit(field)
+                for field in PUTME_OMIT_PDF_FIELDS:
+                    form_fields = form_fields.omit(field)
+        elif target is not None and target.startswith('pude'):
+            form_fields = grok.AutoFields(ICustomUGApplicant)
+            if self._reduced_slip():
+                for field in PUDE_OMIT_RESULT_SLIP_FIELDS:
+                    form_fields = form_fields.omit(field)
+            else:
+                for field in PUDE_OMIT_PDF_FIELDS:
+                    form_fields = form_fields.omit(field)
+        else:
+            form_fields = grok.AutoFields(ICustomUGApplicant)
+            for field in UG_OMIT_PDF_FIELDS:
+                form_fields = form_fields.omit(field)
         if not getattr(self.context, 'student_id'):
             form_fields = form_fields.omit('student_id')
         return form_fields
 
-class CustomApplicantDisplayFormPage(ApplicantDisplayFormPage):
-    """A display view for applicant data.
-    """
-
-    @property
-    def form_fields(self):
-        target = getattr(self.context.__parent__, 'prefix', None)
-        if target is not None and target.startswith('pg'):
-            form_fields = grok.AutoFields(ICustomPGApplicant)
-            for field in PG_OMIT_DISPLAY_FIELDS:
-                form_fields = form_fields.omit(field)
-        else:
-            form_fields = grok.AutoFields(ICustomUGApplicant)
-            for field in UG_OMIT_DISPLAY_FIELDS:
-                form_fields = form_fields.omit(field)
-        return form_fields
-
 class CustomApplicantManageFormPage(ApplicantManageFormPage):
     """A full edit view for applicant data.
@@ -124,4 +161,12 @@
             for field in PG_OMIT_MANAGE_FIELDS:
                 form_fields = form_fields.omit(field)
+        elif target is not None and target.startswith('putme'):
+            form_fields = grok.AutoFields(ICustomUGApplicant)
+            for field in PUTME_OMIT_MANAGE_FIELDS:
+                form_fields = form_fields.omit(field)
+        elif target is not None and target.startswith('pude'):
+            form_fields = grok.AutoFields(ICustomUGApplicant)
+            for field in PUDE_OMIT_MANAGE_FIELDS:
+                form_fields = form_fields.omit(field)
         else:
             form_fields = grok.AutoFields(ICustomUGApplicant)
@@ -146,4 +191,8 @@
             form_fields = grok.AutoFields(IPUTMEApplicantEdit)
             for field in PUTME_OMIT_EDIT_FIELDS:
+                form_fields = form_fields.omit(field)
+        elif target is not None and target.startswith('pude'):
+            form_fields = grok.AutoFields(ICustomUGApplicant)
+            for field in PUDE_OMIT_EDIT_FIELDS:
                 form_fields = form_fields.omit(field)
         else:
Index: /main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py	(revision 9055)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py	(revision 9056)
@@ -40,22 +40,21 @@
     UG_OMIT_MANAGE_FIELDS,
     UG_OMIT_EDIT_FIELDS,
-    PUTME_OMIT_EDIT_FIELDS,
-    UG_OMIT_RESULT_SLIP_FIELDS,
     PG_OMIT_DISPLAY_FIELDS,
     PG_OMIT_PDF_FIELDS,
     PG_OMIT_MANAGE_FIELDS,
     PG_OMIT_EDIT_FIELDS,
+    PUTME_OMIT_DISPLAY_FIELDS,
+    PUTME_OMIT_PDF_FIELDS,
+    PUTME_OMIT_MANAGE_FIELDS,
+    PUTME_OMIT_EDIT_FIELDS,
+    PUTME_OMIT_RESULT_SLIP_FIELDS,
+    PUDE_OMIT_DISPLAY_FIELDS,
+    PUDE_OMIT_PDF_FIELDS,
+    PUDE_OMIT_MANAGE_FIELDS,
+    PUDE_OMIT_EDIT_FIELDS,
+    PUDE_OMIT_RESULT_SLIP_FIELDS,
     )
 from waeup.uniben.interfaces import MessageFactory as _
 from waeup.uniben.payments.interfaces import ICustomOnlinePayment
-
-############################################################
-# Use former lgas for Uniben. Must be removed after application.
-from waeup.uniben.applicants.lgas import LGAS
-class LGASource(LGASource):
-    """A source for school subjects used in exam documentation.
-    """
-    lga_dict = dict(LGAS)
-############################################################
 
 class ICustomUGApplicant(INigeriaUGApplicant):
@@ -67,76 +66,4 @@
     """
 
-    nationality = schema.Choice(
-        source = nats_vocab,
-        title = _(u'Nationality'),
-        required = False,
-        )
-    lga = schema.Choice(
-        source = LGASource(),
-        title = _(u'State/LGA (Nigerians only)'),
-        required = False,
-        )
-    perm_address = schema.Text(
-        title = _(u'Permanent Address'),
-        required = False,
-        )
-    course1 = schema.Choice(
-        title = _(u'1st Choice Course of Study'),
-        source = AppCatCertificateSource(),
-        required = True,
-        )
-    course2 = schema.Choice(
-        title = _(u'2nd Choice Course of Study'),
-        source = AppCatCertificateSource(),
-        required = False,
-        )
-    jamb_subjects = schema.Text(
-        title = _(u'Subjects and Scores'),
-        required = False,
-        )
-    jamb_score = schema.Int(
-        title = _(u'Total Score'),
-        required = False,
-        )
-    notice = schema.Text(
-        title = _(u'Notice'),
-        required = False,
-        )
-    screening_venue = schema.TextLine(
-        title = _(u'Screening Venue'),
-        required = False,
-        )
-    screening_date = schema.TextLine(
-        title = _(u'Screening Date'),
-        required = False,
-        )
-    screening_score = schema.Int(
-        title = _(u'Screening Score (%)'),
-        required = False,
-        )
-    aggregate = schema.Int(
-        title = _(u'Aggregate Score (%)'),
-        description = _(u'(average of relative JAMB and PUTME scores)'),
-        required = False,
-        )
-    result_uploaded = schema.Bool(
-        title = _(u'Result uploaded'),
-        default = False,
-        )
-    student_id = schema.TextLine(
-        title = _(u'Student Id'),
-        required = False,
-        readonly = False,
-        )
-    course_admitted = schema.Choice(
-        title = _(u'Admitted Course of Study'),
-        source = CertificateSource(),
-        required = False,
-        )
-    locked = schema.Bool(
-        title = _(u'Form locked'),
-        default = False,
-        )
-
 class ICustomPGApplicant(INigeriaPGApplicant):
     """A postgraduate applicant.
@@ -147,160 +74,4 @@
     """
 
-    nationality = schema.Choice(
-        source = nats_vocab,
-        title = _(u'Nationality'),
-        required = False,
-        )
-    lga = schema.Choice(
-        source = LGASource(),
-        title = _(u'State/LGA (Nigerians only)'),
-        required = False,
-        )
-    perm_address = schema.Text(
-        title = _(u'Permanent Address'),
-        required = False,
-        )
-    course1 = schema.Choice(
-        title = _(u'1st Choice Course of Study'),
-        source = AppCatCertificateSource(),
-        required = True,
-        )
-    course2 = schema.Choice(
-        title = _(u'2nd Choice Course of Study'),
-        source = AppCatCertificateSource(),
-        required = False,
-        )
-    hq_type = schema.Choice(
-        title = _(u'Qualification Obtained'),
-        required = False,
-        readonly = False,
-        vocabulary = high_qual,
-        )
-    hq_matric_no = schema.TextLine(
-        title = _(u'Former Matric Number'),
-        required = False,
-        readonly = False,
-        )
-    hq_degree = schema.Choice(
-        title = _(u'Class of Degree'),
-        required = False,
-        readonly = False,
-        vocabulary = high_grade,
-        )
-    hq_school = schema.TextLine(
-        title = _(u'Institution Attended'),
-        required = False,
-        readonly = False,
-        )
-    hq_session = schema.TextLine(
-        title = _(u'Years Attended'),
-        required = False,
-        readonly = False,
-        )
-    hq_disc = schema.TextLine(
-        title = _(u'Discipline'),
-        required = False,
-        readonly = False,
-        )
-    pp_school = schema.Choice(
-        title = _(u'Qualification Obtained'),
-        required = False,
-        readonly = False,
-        vocabulary = exam_types,
-        )
-    #presently = schema.Bool(
-    #    title = _(u'Attending'),
-    #    required = False,
-    #    readonly = False,
-    #    )
-    presently_inst = schema.TextLine(
-        title = _(u'If yes, name of institution'),
-        required = False,
-        readonly = False,
-        )
-    nysc_year = schema.Int(
-        title = _(u'Nysc Year'),
-        required = False,
-        readonly = False,
-        )
-    nysc_lga = schema.Choice(
-        source = LGASource(),
-        title = _(u'Nysc Location'),
-        required = False,
-        )
-    employer = schema.TextLine(
-        title = _(u'Employer'),
-        required = False,
-        readonly = False,
-        )
-    emp_position = schema.TextLine(
-        title = _(u'Employer Position'),
-        required = False,
-        readonly = False,
-        )
-    emp_start = FormattedDate(
-        title = _(u'Start Date'),
-        required = False,
-        readonly = False,
-        show_year = True,
-        )
-    emp_end = FormattedDate(
-        title = _(u'End Date'),
-        required = False,
-        readonly = False,
-        show_year = True,
-        )
-    emp_reason = schema.TextLine(
-        title = _(u'Reason for Leaving'),
-        required = False,
-        readonly = False,
-        )
-    employer2 = schema.TextLine(
-        title = _(u'2nd Employer'),
-        required = False,
-        readonly = False,
-        )
-    emp2_position = schema.TextLine(
-        title = _(u'2nd Employer Position'),
-        required = False,
-        readonly = False,
-        )
-    emp2_start = FormattedDate(
-        title = _(u'Start Date'),
-        required = False,
-        readonly = False,
-        show_year = True,
-        )
-    emp2_end = FormattedDate(
-        title = _(u'End Date'),
-        required = False,
-        readonly = False,
-        show_year = True,
-        )
-    emp2_reason = schema.TextLine(
-        title = _(u'Reason for Leaving'),
-        required = False,
-        readonly = False,
-        )
-    notice = schema.Text(
-        title = _(u'Notice'),
-        required = False,
-        readonly = False,
-        )
-    student_id = schema.TextLine(
-        title = _(u'Student Id'),
-        required = False,
-        readonly = False,
-        )
-    course_admitted = schema.Choice(
-        title = _(u'Admitted Course of Study'),
-        source = CertificateSource(),
-        required = False,
-        readonly = False,
-        )
-    locked = schema.Bool(
-        title = _(u'Form locked'),
-        default = False,
-        )
 
 class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant):
@@ -323,5 +94,5 @@
         """
 
-class ICustomUGApplicantEdit(ICustomUGApplicant):
+class ICustomUGApplicantEdit(INigeriaUGApplicantEdit):
     """An undergraduate applicant interface for edit forms.
 
@@ -335,21 +106,5 @@
     """
 
-    email = schema.ASCIILine(
-        title = _(u'Email Address'),
-        required = True,
-        constraint=validate_email,
-        )
-    date_of_birth = FormattedDate(
-        title = _(u'Date of Birth'),
-        required = True,
-        show_year = True,
-        )
-
-ICustomUGApplicantEdit[
-    'date_of_birth'].order =  ICustomUGApplicant['date_of_birth'].order
-ICustomUGApplicantEdit[
-    'email'].order =  ICustomUGApplicant['email'].order
-
-class ICustomPGApplicantEdit(ICustomPGApplicant):
+class ICustomPGApplicantEdit(INigeriaPGApplicantEdit):
     """A postgraduate applicant interface for editing.
 
@@ -363,20 +118,4 @@
     """
 
-    email = schema.ASCIILine(
-        title = _(u'Email Address'),
-        required = True,
-        constraint=validate_email,
-        )
-    date_of_birth = FormattedDate(
-        title = _(u'Date of Birth'),
-        required = True,
-        show_year = True,
-        )
-
-ICustomPGApplicantEdit[
-    'date_of_birth'].order =  ICustomPGApplicant['date_of_birth'].order
-ICustomPGApplicantEdit[
-    'email'].order =  ICustomPGApplicant['email'].order
-
 class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment):
     """An applicant payment via payment gateways.
@@ -384,5 +123,5 @@
     """
 
-class IPUTMEApplicantEdit(ICustomUGApplicant):
+class IPUTMEApplicantEdit(IPUTMEApplicantEdit):
     """An undergraduate applicant interface for editing.
 
@@ -395,21 +134,6 @@
     respective form page.
     """
-    email = schema.ASCIILine(
-        title = _(u'Email Address'),
-        required = True,
-        constraint=validate_email,
-        )
-    date_of_birth = FormattedDate(
-        title = _(u'Date of Birth'),
-        required = True,
-        show_year = True,
-        )
 
-IPUTMEApplicantEdit[
-    'date_of_birth'].order =  ICustomUGApplicant['date_of_birth'].order
-IPUTMEApplicantEdit[
-    'email'].order =  ICustomUGApplicant['email'].order
-
-class ICustomApplicantUpdateByRegNo(ICustomApplicant):
+class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo):
     """Representation of an applicant.
 
@@ -417,6 +141,2 @@
     the applicant object.
     """
-    reg_number = schema.TextLine(
-        title = u'Registration Number',
-        required = False,
-        )
