Index: /main/kofacustom.nigeria/tags/1.0/CHANGES.txt
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/CHANGES.txt	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/CHANGES.txt	(revision 11268)
@@ -0,0 +1,15 @@
+Changes
+*******
+
+1.0 (2014-02-22)
+================
+
+- Diazofied complete package.
+
+- We now work with waeup.kofa >= 1.0.
+
+
+0.1 (2014-02-21)
+================
+
+- Initial implementation.
Index: /main/kofacustom.nigeria/tags/1.0/README.txt
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/README.txt	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/README.txt	(revision 11268)
@@ -0,0 +1,4 @@
+kofacustom.nigeria
+******************
+
+Customizations of the `waeup.kofa` package for the nigerian market.
Index: /main/kofacustom.nigeria/tags/1.0/bootstrap.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/bootstrap.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/bootstrap.py	(revision 11268)
@@ -0,0 +1,165 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+"""
+
+import os, shutil, sys, tempfile
+from optparse import OptionParser
+
+tmpeggs = tempfile.mkdtemp()
+
+usage = '''\
+[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]
+
+Bootstraps a buildout-based project.
+
+Simply run this script in a directory containing a buildout.cfg, using the
+Python that you want bin/buildout to use.
+
+Note that by using --setup-source and --download-base to point to
+local resources, you can keep this script from going over the network.
+'''
+
+parser = OptionParser(usage=usage)
+parser.add_option("-v", "--version", help="use a specific zc.buildout version")
+
+parser.add_option("-t", "--accept-buildout-test-releases",
+                  dest='accept_buildout_test_releases',
+                  action="store_true", default=False,
+                  help=("Normally, if you do not specify a --version, the "
+                        "bootstrap script and buildout gets the newest "
+                        "*final* versions of zc.buildout and its recipes and "
+                        "extensions for you.  If you use this flag, "
+                        "bootstrap and buildout will get the newest releases "
+                        "even if they are alphas or betas."))
+parser.add_option("-c", "--config-file",
+                   help=("Specify the path to the buildout configuration "
+                         "file to be used."))
+parser.add_option("-f", "--find-links",
+                   help=("Specify a URL to search for buildout releases"))
+
+
+options, args = parser.parse_args()
+
+######################################################################
+# load/install distribute
+
+to_reload = False
+try:
+    import pkg_resources, setuptools
+    if not hasattr(pkg_resources, '_distribute'):
+        to_reload = True
+        raise ImportError
+except ImportError:
+    ez = {}
+
+    try:
+        from urllib.request import urlopen
+    except ImportError:
+        from urllib2 import urlopen
+
+    exec(urlopen('http://python-distribute.org/distribute_setup.py').read(), ez)
+    setup_args = dict(to_dir=tmpeggs, download_delay=0, no_fake=True)
+    ez['use_setuptools'](**setup_args)
+
+    if to_reload:
+        reload(pkg_resources)
+    import pkg_resources
+    # This does not (always?) update the default working set.  We will
+    # do it.
+    for path in sys.path:
+        if path not in pkg_resources.working_set.entries:
+            pkg_resources.working_set.add_entry(path)
+
+######################################################################
+# Install buildout
+
+ws  = pkg_resources.working_set
+
+cmd = [sys.executable, '-c',
+       'from setuptools.command.easy_install import main; main()',
+       '-mZqNxd', tmpeggs]
+
+find_links = os.environ.get(
+    'bootstrap-testing-find-links',
+    options.find_links or
+    ('http://downloads.buildout.org/'
+     if options.accept_buildout_test_releases else None)
+    )
+if find_links:
+    cmd.extend(['-f', find_links])
+
+distribute_path = ws.find(
+    pkg_resources.Requirement.parse('distribute')).location
+
+requirement = 'zc.buildout'
+version = options.version
+if version is None and not options.accept_buildout_test_releases:
+    # Figure out the most recent final version of zc.buildout.
+    import setuptools.package_index
+    _final_parts = '*final-', '*final'
+    def _final_version(parsed_version):
+        for part in parsed_version:
+            if (part[:1] == '*') and (part not in _final_parts):
+                return False
+        return True
+    index = setuptools.package_index.PackageIndex(
+        search_path=[distribute_path])
+    if find_links:
+        index.add_find_links((find_links,))
+    req = pkg_resources.Requirement.parse(requirement)
+    if index.obtain(req) is not None:
+        best = []
+        bestv = None
+        for dist in index[req.project_name]:
+            distv = dist.parsed_version
+            if _final_version(distv):
+                if bestv is None or distv > bestv:
+                    best = [dist]
+                    bestv = distv
+                elif distv == bestv:
+                    best.append(dist)
+        if best:
+            best.sort()
+            version = best[-1].version
+if version:
+    requirement = '=='.join((requirement, version))
+cmd.append(requirement)
+
+import subprocess
+if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=distribute_path)) != 0:
+    raise Exception(
+        "Failed to execute command:\n%s",
+        repr(cmd)[1:-1])
+
+######################################################################
+# Import and run buildout
+
+ws.add_entry(tmpeggs)
+ws.require(requirement)
+import zc.buildout.buildout
+
+if not [a for a in args if '=' not in a]:
+    args.append('bootstrap')
+
+# if -c was provided, we push it back into args for buildout' main function
+if options.config_file is not None:
+    args[0:0] = ['-c', options.config_file]
+
+zc.buildout.buildout.main(args)
+shutil.rmtree(tmpeggs)
Index: /main/kofacustom.nigeria/tags/1.0/buildout.cfg
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/buildout.cfg	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/buildout.cfg	(revision 11268)
@@ -0,0 +1,217 @@
+[buildout]
+# See http://pypi.python.org/pypi/mr.developer for details
+extensions = mr.developer
+# Install waeup.kofa as develop egg
+auto-checkout = waeup.kofa
+sources-dir = sources
+develop = .
+parts =
+    eggbasket
+    app
+    i18n
+    test
+    mkdirs
+    zpasswd
+    zope_conf
+    site_zcml
+    zdaemon_conf
+    raw_deploy_ini
+    raw_debug_ini
+    themed_deploy_ini
+    themed_debug_ini
+    profile_ini
+# waeupdocs
+    coverage-detect
+    coverage-report
+# kofactl creation must be _after_ app!
+    kofactl
+    lxml
+    diazo
+# For backward compatibility, telling buildout not to throw away
+# the data and log subdirectories from the parts directory.
+    data
+    log
+# newest = false
+
+extends = versions.cfg
+show-picked-versions = true
+update-versions-file = versions.cfg
+
+
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+[sources]
+waeup.kofa = svn https://svn.waeup.org/repos/main/waeup.kofa/trunk
+[kofa_params]
+## Basic parameters for deployment.
+# default is 127.0.0.1
+host = 0.0.0.0
+# default is 8080
+base_port = 8080
+zeo1_port = 8080
+zeo2_port = 8081
+zeo3_port = 8082
+server_port = 8100
+# default 7. Number of pre-opened ZODB threads/client
+pool_size = 7
+# default 20MB. Cache size of each client (ZEO only)
+client_cache = 20MB
+# default 5000. Number of objects cached.
+object_cache = 5000
+# number of preopened paster threads, default 10
+threadpool_workers = 10
+devel_pkg = kofacustom.nigeria
+
+[app]
+# This creates all scripts in bin/. The kofactl created here is 'faulty'.
+recipe = zc.recipe.egg
+eggs = kofacustom.nigeria [beaker, diazo]
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+       repoze.profile
+       ZODB3
+interpreter = python-console
+
+[kofactl]
+# See http://pypi.python.org/pypi/zc.recipe.egg for details...
+# Here we create the kofactl script again, this time with a
+# fixed path to zdaemon.conf as argument.
+recipe = zc.recipe.egg
+eggs = kofacustom.nigeria [beaker, diazo]
+       waeup.kofa
+arguments = "${buildout:parts-directory}/etc/zdaemon.conf"
+scripts = kofactl=kofactl
+
+[mkdirs]
+recipe = z3c.recipe.mkdir
+paths =
+    ${zope_conf:filestorage}
+    ${zope_conf:logfiles}
+    ${zope_conf:blobstorage}
+    ${buildout:directory}/var/mailqueue/cur
+    ${buildout:directory}/var/mailqueue/tmp
+    ${buildout:directory}/var/mailqueue/new
+    ${buildout:directory}/var/datacenter/media
+    ${buildout:directory}/parts/test/datacenter
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = kofacustom.nigeria [beaker, test]
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = kofacustom.nigeria
+eggs = kofacustom.nigeria
+domain = kofacustom.nigeria
+output = src/kofacustom/nigeria/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = kofacustom.nigeria
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = collective.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+filestorage = ${buildout:directory}/var/filestorage
+blobstorage = ${buildout:directory}/var/blobstorage
+logfiles = ${buildout:directory}/var/log
+extra =
+# extra = <grokwarnings>True</grokwarnings>
+# 'extra' is copied verbatim. Use it for product config sections and so.
+
+# The [data] and [log] parts are still in here to instruct buildout to not
+# unintentionally throw away the parts/data and parts/log subdirectories
+# that contain the Data.fs and the log files. These files should be
+# copied to the new locations. See the upgrade notes for more information.
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[mailqueue]
+recipe = zc.recipe.filestorage
+
+[site_zcml]
+recipe = collective.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = collective.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[raw_debug_ini]
+recipe = collective.recipe.template
+input = etc/raw/debug.ini.in
+output = ${buildout:parts-directory}/etc/raw-debug.ini
+
+[raw_deploy_ini]
+recipe = collective.recipe.template
+input = etc/raw/deploy.ini.in
+output = ${buildout:parts-directory}/etc/raw-deploy.ini
+
+[themed_debug_ini]
+recipe = collective.recipe.template
+input = etc/themed/debug.ini.in
+output = ${buildout:parts-directory}/etc/themed-debug.ini
+
+[themed_deploy_ini]
+recipe = collective.recipe.template
+input = etc/themed/deploy.ini.in
+output = ${buildout:parts-directory}/etc/themed-deploy.ini
+
+[profile_ini]
+recipe = collective.recipe.template
+input = etc/profile.ini.in
+output = ${buildout:parts-directory}/etc/profile.ini
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.1.tgz
+
+#[waeupdocs]
+#recipe = collective.recipe.sphinxbuilder
+#eggs = kofacustom.nigeria[docs]
+#source = ${buildout:directory}/docs/source
+#build = ${buildout:directory}/docs/build
+
+# Collect test coverage data.
+[coverage-detect]
+recipe = zc.recipe.testrunner
+eggs = kofacustom.nigeria[beaker]
+defaults = ['--tests-pattern', '^f?tests$', '-v', '--coverage', 'coverage']
+
+# Create a coverage report.
+# Make sure to run bin/coverage-detect to collect the data for the report
+# first!
+[coverage-report]
+recipe = zc.recipe.egg
+eggs = z3c.coverage
+scripts = coveragereport
+arguments = ('${buildout:parts-directory}/coverage-detect/working-directory/coverage', '${buildout:directory}/coverage-report')
+
+[lxml]
+recipe = z3c.recipe.staticlxml
+egg = lxml
+
+[diazo]
+recipe = zc.recipe.egg
+eggs =
+    diazo [wsgi]
+    PasteScript
+    kofacustom.nigeria [beaker,diazo]
Index: /main/kofacustom.nigeria/tags/1.0/etc/README.txt
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/etc/README.txt	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/etc/README.txt	(revision 11268)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini
Index: /main/kofacustom.nigeria/tags/1.0/etc/debug.ini.in
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/etc/debug.ini.in	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/etc/debug.ini.in	(revision 11268)
@@ -0,0 +1,94 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog, asynclog, async_tracelog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_asynclog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_async_tracelog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async_trace.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[logger_async]
+level = INFO
+handlers = asynclog
+qualname = zc.async
+propagate = 0
+
+[logger_async_trace]
+level = INFO
+handlers = async_tracelog
+qualname = zc.async.trace
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:${kofa_params:devel_pkg}#debug
+filter-with = translogger
+exempt-exceptions = zope.security.interfaces.IUnauthorized
+
+[server:main]
+use = egg:Paste#http
+host = ${kofa_params:host}
+port = ${kofa_params:base_port}
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
+env_vars = ZC_ASYNC_UUID ${buildout:directory}/var/uuid1.txt
Index: /main/kofacustom.nigeria/tags/1.0/etc/deploy.ini.in
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/etc/deploy.ini.in	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/etc/deploy.ini.in	(revision 11268)
@@ -0,0 +1,94 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi, async, async_trace
+
+[handlers]
+keys = null, console, accesslog, asynclog, async_tracelog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+#handlers = accesslog
+handlers = null
+qualname = wsgi
+propagate = 0
+
+[logger_async]
+level = INFO
+handlers = asynclog
+qualname = zc.async
+propagate = 0
+
+[logger_async_trace]
+level = INFO
+handlers = async_tracelog
+qualname = zc.async.trace
+propagate = 0
+
+[handler_null]
+# you can use 'NullHandler' (w/o the path) if under Python 2.7+
+class = waeup.kofa.utils.helpers.NullHandler
+args = ()
+level = NOTSET
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[handler_asynclog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_async_tracelog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async_trace.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:${kofa_params:devel_pkg}
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = ${kofa_params:host}
+port = ${kofa_params:base_port}
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
+env_vars = ZC_ASYNC_UUID ${buildout:directory}/var/uuid1.txt
Index: /main/kofacustom.nigeria/tags/1.0/etc/profile.ini.in
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/etc/profile.ini.in	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/etc/profile.ini.in	(revision 11268)
@@ -0,0 +1,93 @@
+# profile.ini
+#
+# Profiling configuration for use with paster/WSGI
+#
+# Call http://localhost:8080/__profile__ to see the profiler in action
+
+[loggers]
+keys = root, wsgi, async, async_trace
+
+[handlers]
+keys = console, accesslog, asynclog, async_tracelog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[logger_async]
+level = INFO
+handlers = asynclog
+qualname = zc.async
+propagate = 0
+
+[logger_async_trace]
+level = INFO
+handlers = async_tracelog
+qualname = zc.async.trace
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[handler_asynclog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_async_tracelog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async_trace.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter:profiler]
+use = egg:repoze.profile#profile
+
+[app:app]
+use = egg:${kofa_params:devel_pkg}
+
+[pipeline:main]
+pipeline = translogger profiler app
+
+[server:main]
+use = egg:Paste#http
+host = ${kofa_params:host}
+port = ${kofa_params:base_port}
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
+env_vars = ZC_ASYNC_UUID ${buildout:directory}/var/uuid1.txt
Index: /main/kofacustom.nigeria/tags/1.0/etc/raw/debug.ini.in
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/etc/raw/debug.ini.in	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/etc/raw/debug.ini.in	(revision 11268)
@@ -0,0 +1,94 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog, asynclog, async_tracelog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_asynclog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_async_tracelog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async_trace.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[logger_async]
+level = INFO
+handlers = asynclog
+qualname = zc.async
+propagate = 0
+
+[logger_async_trace]
+level = INFO
+handlers = async_tracelog
+qualname = zc.async.trace
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:${kofa_params:devel_pkg}#debug
+filter-with = translogger
+exempt-exceptions = zope.security.interfaces.IUnauthorized
+
+[server:main]
+use = egg:Paste#http
+host = ${kofa_params:host}
+port = ${kofa_params:base_port}
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
+env_vars = ZC_ASYNC_UUID ${buildout:directory}/var/uuid1.txt
Index: /main/kofacustom.nigeria/tags/1.0/etc/raw/deploy.ini.in
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/etc/raw/deploy.ini.in	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/etc/raw/deploy.ini.in	(revision 11268)
@@ -0,0 +1,94 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi, async, async_trace
+
+[handlers]
+keys = null, console, accesslog, asynclog, async_tracelog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+#handlers = accesslog
+handlers = null
+qualname = wsgi
+propagate = 0
+
+[logger_async]
+level = INFO
+handlers = asynclog
+qualname = zc.async
+propagate = 0
+
+[logger_async_trace]
+level = INFO
+handlers = async_tracelog
+qualname = zc.async.trace
+propagate = 0
+
+[handler_null]
+# you can use 'NullHandler' (w/o the path) if under Python 2.7+
+class = waeup.kofa.utils.helpers.NullHandler
+args = ()
+level = NOTSET
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[handler_asynclog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_async_tracelog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async_trace.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:${kofa_params:devel_pkg}
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = ${kofa_params:host}
+port = ${kofa_params:base_port}
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
+env_vars = ZC_ASYNC_UUID ${buildout:directory}/var/uuid1.txt
Index: /main/kofacustom.nigeria/tags/1.0/etc/site.zcml.in
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/etc/site.zcml.in	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/etc/site.zcml.in	(revision 11268)
@@ -0,0 +1,82 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:kofa="http://namespaces.waeup.org/kofa"
+           i18n_domain="${kofa_params:devel_pkg}">
+
+  <include package="${kofa_params:devel_pkg}" />
+  <include package="${kofa_params:devel_pkg}" file="mail.zcml" />
+  <!-- install job container
+
+       install a job container for asynchronous jobs. Pick one of the
+       two possibilites: 'single' for installation in the one big ZODB
+       or 'multidb' for setup with a dedicated ZODB for job handling.
+  -->
+  <!-- include package="waeup.kofa" file="async_single.zcml" / -->
+  <include package="waeup.kofa" file="async_multidb.zcml" />
+
+  <!-- install dispatcher and other needed async components
+
+       install other needed components for asynchronous jobs. Pick one
+       of the two possibilities: 'basic_dispatcher' for single ZODB
+       setup, 'multidb_dispatcher' for setup with a dedicated ZODB for
+       job handling. Make sure the setting matches the setting picked
+       above. -->
+  <!-- include package="zc.async" file="basic_dispatcher_policy.zcml" / -->
+  <include package="zc.async" file="multidb_dispatcher_policy.zcml" />
+
+  <!-- Where should the datacenter reside by default? -->
+  <kofa:datacenter
+      path="${buildout:directory}/var/datacenter" />
+
+    <configure i18n_domain="${kofa_params:devel_pkg}">
+
+
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="321b9cd3739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- XMLRPC user for demo and testing
+           Plaintext password is xmlrpcuser1
+           Don't use it in real deployment -->
+      <principal id="zope.xmlrpcuser1"
+                 title="XMLRPC User 1"
+                 login="xmlrpcuser1"
+                 password="{SSHA}ZaL4-UiwmSu6AbLYY-yCS_8vtKpH5Hc6"
+                 password_manager="SSHA"
+                 />
+
+      <grant role="waeup.xmlrpcusers1"
+             principal="zope.xmlrpcuser1" />
+
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+      <grant permission="zope.View"
+             principal="zope.Authenticated" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Authenticated" />
+      <grant permission="waeup.Public"
+             principal="zope.Everybody" />
+      <grant permission="waeup.Anonymous"
+             principal="zope.Anybody" />
+      <grant permission="waeup.Authenticated"
+             principal="zope.Authenticated" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>
Index: /main/kofacustom.nigeria/tags/1.0/etc/themed/debug.ini.in
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/etc/themed/debug.ini.in	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/etc/themed/debug.ini.in	(revision 11268)
@@ -0,0 +1,118 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI and diazo
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog, asynclog, async_tracelog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_asynclog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_async_tracelog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async_trace.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[logger_async]
+level = INFO
+handlers = asynclog
+qualname = zc.async
+propagate = 0
+
+[logger_async_trace]
+level = INFO
+handlers = async_tracelog
+qualname = zc.async.trace
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter:debugger]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+
+[app:zope]
+use = egg:${kofa_params:devel_pkg}#debug
+exempt-exceptions = zope.security.interfaces.IUnauthorized
+
+[app:static]
+use = egg:Paste#static
+document_root = %(LAYOUT_DIR)s/static
+
+[composite:main]
+use = egg:Paste#urlmap
+/static = static
+/ = default
+
+[filter:theme]
+use = egg:diazo
+rules = file:///%(LAYOUT_DIR)s/rules.xml
+prefix = /
+doctype = <!DOCTYPE html>
+# set to false, if you don't want rules.xml being rebuild on each request
+debug = true
+
+[pipeline:default]
+pipeline = theme
+           translogger
+           debugger
+           zope
+
+[server:main]
+use = egg:Paste#http
+host = ${kofa_params:host}
+port = ${kofa_params:base_port}
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
+env_vars = ZC_ASYNC_UUID ${buildout:directory}/var/uuid1.txt
+# the directory where all real diazo config is done (no trailing slash)
+LAYOUT_DIR = ${buildout:directory}/sources/waeup.kofa/layout
+STATIC_DIR = %(LAYOUT_DIR)s/static
Index: /main/kofacustom.nigeria/tags/1.0/etc/themed/deploy.ini.in
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/etc/themed/deploy.ini.in	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/etc/themed/deploy.ini.in	(revision 11268)
@@ -0,0 +1,118 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi, async, async_trace
+
+[handlers]
+keys = null, console, accesslog, asynclog, async_tracelog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+#handlers = accesslog
+handlers = null
+qualname = wsgi
+propagate = 0
+
+[logger_async]
+level = INFO
+handlers = asynclog
+qualname = zc.async
+propagate = 0
+
+[logger_async_trace]
+level = INFO
+handlers = async_tracelog
+qualname = zc.async.trace
+propagate = 0
+
+[handler_null]
+# you can use 'NullHandler' (w/o the path) if under Python 2.7+
+class = waeup.kofa.utils.helpers.NullHandler
+args = ()
+level = NOTSET
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[handler_asynclog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_async_tracelog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async_trace.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:content]
+use = egg:${kofa_params:devel_pkg}
+filter-with = translogger
+
+[app:static]
+use = egg:Paste#static
+document_root = %(LAYOUT_DIR)s/static/
+
+[composite:main]
+use = egg:Paste#urlmap
+/static = static
+/ = default
+
+[server:main]
+use = egg:Paste#http
+host = ${kofa_params:host}
+port = ${kofa_params:base_port}
+
+[filter:theme]
+use = egg:diazo
+rules = file:///%(LAYOUT_DIR)s/rules.xml
+prefix = /
+doctype = <!DOCTYPE html>
+# set to true, if you want rules.xml being rebuild on each request
+debug = false
+
+[pipeline:default]
+pipeline = theme
+           content
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
+env_vars = ZC_ASYNC_UUID ${buildout:directory}/var/uuid1.txt
+# the directory where all real diazo config is done (no trailing slash)
+LAYOUT_DIR = ${buildout:directory}/sources/waeup.kofa/layout
+STATIC_DIR = %(LAYOUT_DIR)s/static
Index: /main/kofacustom.nigeria/tags/1.0/etc/zdaemon.conf.in
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/etc/zdaemon.conf.in	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/etc/zdaemon.conf.in	(revision 11268)
@@ -0,0 +1,8 @@
+<runner>
+  program ${buildout:directory}/bin/paster serve ${buildout:directory}/parts/etc/themed-deploy.ini
+  daemon on
+  transcript ${zope_conf:logfiles}/zdaemon.log
+  socket-name ${zope_conf:logfiles}/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>
Index: /main/kofacustom.nigeria/tags/1.0/etc/zope.conf.in
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/etc/zope.conf.in	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/etc/zope.conf.in	(revision 11268)
@@ -0,0 +1,62 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard blob storage
+  <blobstorage>
+    blob-dir ${zope_conf:blobstorage}
+    <filestorage>
+      path ${zope_conf:filestorage}/Data.fs
+    </filestorage>
+  </blobstorage>
+
+# Uncomment this if you want a blob-less standard file storage instead:
+#  <filestorage>
+#       path ${zope_conf:filestorage}
+#  </filestorage>
+
+# Uncomment this if you want to connect to a ZEO server instead:
+#  <zeoclient>
+#    server localhost:8100
+#    storage 1
+#    # ZEO client cache, in bytes
+#    cache-size 20MB
+#    # Uncomment to have a persistent disk cache
+#    #client zeo1
+#  </zeoclient>
+
+</zodb>
+
+<zodb async>
+  <filestorage>
+    # create true
+    path ${zope_conf:filestorage}/Data.async.fs
+  </filestorage>
+</zodb>
+
+<eventlog>
+  # This sets up logging to a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${zope_conf:logfiles}/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+# devmode on
+
+# Extra configuration lines can be added to zope_conf's extra option. Put for 
+# instance productconf sections in here.
+${zope_conf:extra}
Index: /main/kofacustom.nigeria/tags/1.0/setup.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/setup.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/setup.py	(revision 11268)
@@ -0,0 +1,100 @@
+import os
+from setuptools import setup, find_packages
+
+version = '1.0dev'
+
+install_requires =[
+    'setuptools',
+    'grok',
+    'waeup.kofa >= 1.0',
+    ],
+
+# Having beaker installed additionally is a feature very recommended
+# for production use. The default buildout includes beaker for tests,
+# start scripts, and other parts that can benefit from it. The windows
+# buildout does not include it due to compiling problems with the
+# beaker package.
+beaker_require = [
+    'dolmen.beaker',
+    ]
+
+tests_require = [
+    'z3c.testsetup',
+    'zope.app.testing',
+    'zope.testbrowser',
+    'zope.testing',
+    'unittest2',
+    ]
+
+docs_require = [
+    'Sphinx',
+    'collective.recipe.sphinxbuilder',
+    'docutils',
+    'roman',
+    'repoze.sphinx.autointerface',
+    ]
+
+diazo_require = [
+    'diazo',
+    'webob',
+    ]
+
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+long_description = (
+    read('README.txt')
+    + '\n\n'
+    + read('CHANGES.txt')
+    + '\n\n'
+    + 'Download\n'
+    + '********\n'
+    )
+
+setup(name = 'kofacustom.nigeria',
+      version = version,
+      description = "Nigerian customizations of the waeup.kofa package",
+      long_description = long_description,
+
+      keywords = "portal waeup kofa student university registration nigeria",
+      # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
+      classifiers = [
+        'Development Status :: 3 - Alpha',
+        'Environment :: Web Environment',
+        'Intended Audience :: Education',
+        'License :: OSI Approved :: GNU General Public License (GPL)',
+        'Programming Language :: Python',
+        'Operating System :: POSIX',
+        'Operating System :: POSIX :: Linux',
+        'Framework :: Zope3',
+        'Topic :: Education',
+        'Topic :: Internet :: WWW/HTTP',
+        ],
+      author = "The WAeUP team.",
+      author_email = "",
+      url = "http://www.waeup.org/",
+      license = "GPL",
+      package_dir = {'': 'src'},
+      packages= find_packages('src'),
+      namespace_packages = ['kofacustom',],
+      include_package_data = True,
+      zip_safe = False,
+      install_requires = install_requires,
+      tests_require = tests_require,
+      extras_require = dict(
+        test = tests_require,
+        docs = docs_require,
+        beaker = beaker_require,
+        diazo = diazo_require,
+        ),
+      entry_points="""
+      # Add entry points here
+      [console_scripts]
+      kofa-debug = grokcore.startup:interactive_debug_prompt
+      kofactl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = waeup.kofa.startup:env_app_factory
+      debug = waeup.kofa.startup:env_debug_app_factory
+
+      """,
+      )
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/__init__.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/__init__.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/__init__.py	(revision 11268)
@@ -0,0 +1,7 @@
+# namespace package boilerplate
+try:
+    import pkg_resources
+    pkg_resources.declare_namespace(__name__)
+except ImportError, e:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/__init__.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/__init__.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/__init__.py	(revision 11268)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/applicant.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/applicant.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/applicant.py	(revision 11268)
@@ -0,0 +1,66 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+
+import grok
+from zope.interface import implementedBy
+from waeup.kofa.applicants.applicant import Applicant, ApplicantFactory
+from waeup.kofa.utils.helpers import attrs_to_fields
+from kofacustom.nigeria.applicants.interfaces import(
+    INigeriaApplicant,
+    INigeriaUGApplicantEdit, INigeriaPGApplicantEdit,
+    IPUTMEApplicantEdit)
+
+class NigeriaApplicant(Applicant):
+
+    grok.implements(INigeriaApplicant, INigeriaUGApplicantEdit,
+        INigeriaPGApplicantEdit, IPUTMEApplicantEdit)
+    grok.provides(INigeriaApplicant)
+
+    # Meanwhile perm_address has been removed but the attribute still exists in
+    # some applicant objects. So we'll leave it until all 2012 students
+    # have been created.
+    create_names = Applicant.create_names + [
+        'lga', 'nationality', 'perm_address']  
+
+    def _setStudyCourseAttributes(self, studycourse):
+        if self.applicant_id.startswith('pude'):
+            studycourse.entry_mode = u'de_ft'
+            studycourse.current_level = 200
+        else:
+            studycourse.entry_mode = self.course_admitted.study_mode
+            studycourse.current_level = self.course_admitted.start_level
+        studycourse.certificate = self.course_admitted
+        studycourse.entry_session = self.__parent__.year
+        studycourse.current_session = self.__parent__.year
+        return
+
+# Set all attributes of NigeriaApplicant required in INigeriaApplicant as field
+# properties. Doing this, we do not have to set initial attributes
+# ourselves and as a bonus we get free validation when an attribute is
+# set.
+NigeriaApplicant = attrs_to_fields(NigeriaApplicant)
+
+class NigeriaApplicantFactory(ApplicantFactory):
+    """A factory for customized applicants.
+    """
+
+    def __call__(self, *args, **kw):
+        return NigeriaApplicant()
+
+    def getInterfaces(self):
+        return implementedBy(NigeriaApplicant)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/batching.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/batching.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/batching.py	(revision 11268)
@@ -0,0 +1,38 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Batch processing for applicants.
+"""
+from waeup.kofa.utils.batching import BatchProcessor
+from waeup.kofa.applicants.batching import ApplicantProcessor
+from kofacustom.nigeria.applicants.interfaces import (
+    INigeriaApplicant, INigeriaApplicantUpdateByRegNo)
+
+class NigeriaApplicantProcessor(ApplicantProcessor):
+    """A batch processor for IApplicant objects.
+
+    In create mode container_code is required. If application_number is given
+    an applicant with this number is created in the designated container.
+    If application_number is not given a random application_number is assigned.
+    applicant_id is being determined by the system and can't be imported.
+
+    In update or remove mode container_code and application_number columns
+    must not exist. The applicant object is solely searched by its applicant_id
+    or reg_number.
+    """
+    iface = INigeriaApplicant
+    iface_byregnumber = INigeriaApplicantUpdateByRegNo
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/browser.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/browser.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/browser.py	(revision 11268)
@@ -0,0 +1,240 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""UI components for basic applicants and related components.
+"""
+import grok
+from zope.component import getUtility
+from zope.i18n import translate
+from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
+from zope.formlib.textwidgets import BytesDisplayWidget
+from waeup.kofa.students.interfaces import IStudentsUtils
+from waeup.kofa.applicants.interfaces import (
+    IApplicantRegisterUpdate, IApplicant, IApplicantEdit)
+from waeup.kofa.applicants.browser import (ApplicantDisplayFormPage,
+    ApplicantManageFormPage, ApplicantEditFormPage,
+    ApplicantRegistrationPage, ApplicantAddFormPage,
+    OnlinePaymentDisplayFormPage, ApplicationFeePaymentAddPage,
+    OnlinePaymentBreadcrumb, ExportPDFPaymentSlipPage,
+    ApplicantBaseDisplayFormPage)
+from waeup.kofa.applicants.viewlets import (
+    PaymentReceiptActionButton, PDFActionButton)
+from waeup.kofa.applicants.pdf import PDFApplicationSlip
+from kofacustom.nigeria.applicants.interfaces import (
+    INigeriaPGApplicant, INigeriaUGApplicant,
+    INigeriaPGApplicantEdit, INigeriaUGApplicantEdit,
+    INigeriaApplicantOnlinePayment,IPUTMEApplicantEdit,
+    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 kofacustom.nigeria.interfaces import MessageFactory as _
+
+class NigeriaOnlinePaymentBreadcrumb(OnlinePaymentBreadcrumb):
+    """A breadcrumb for payments.
+    """
+    grok.context(INigeriaApplicantOnlinePayment)
+
+class PDFActionButton(PDFActionButton):
+
+    @property
+    def text(self):
+        if getattr(self.context, 'result_uploaded', False):
+            return _('Download result slip')
+        return _('Download application slip')
+
+class NigeriaApplicantDisplayFormPage(ApplicantDisplayFormPage):
+    """A display view for applicant data.
+    """
+
+    def _not_paid(self):
+        return self.context.state in ('initialized', 'started',)
+
+    @property
+    def form_fields(self):
+        if self.target is not None and self.target.startswith('pg'):
+            form_fields = grok.AutoFields(INigeriaPGApplicant)
+            for field in PG_OMIT_DISPLAY_FIELDS:
+                form_fields = form_fields.omit(field)
+        elif self.target is not None and self.target.startswith('putme'):
+            form_fields = grok.AutoFields(INigeriaUGApplicant)
+            for field in PUTME_OMIT_DISPLAY_FIELDS:
+                form_fields = form_fields.omit(field)
+        elif self.target is not None and self.target.startswith('pude'):
+            form_fields = grok.AutoFields(INigeriaUGApplicant)
+            for field in PUDE_OMIT_DISPLAY_FIELDS:
+                form_fields = form_fields.omit(field)
+        else:
+            form_fields = grok.AutoFields(INigeriaUGApplicant)
+            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
+        if not getattr(self.context, 'student_id'):
+            form_fields = form_fields.omit('student_id')
+        if not getattr(self.context, 'screening_score'):
+            form_fields = form_fields.omit('screening_score')
+        if not getattr(self.context, 'screening_venue') or self._not_paid():
+            form_fields = form_fields.omit('screening_venue')
+        if not getattr(self.context, 'screening_date') or self._not_paid():
+            form_fields = form_fields.omit('screening_date')
+        return form_fields
+
+class NigeriaPDFApplicationSlip(PDFApplicationSlip):
+
+    def _addLoginInformation(self):
+        """ We do no longer render login information on
+        pdf application slips.
+        """
+        return
+
+    def _reduced_slip(self):
+        return getattr(self.context, 'result_uploaded', False)
+
+    @property
+    def form_fields(self):
+        if self.target is not None and self.target.startswith('pg'):
+            form_fields = grok.AutoFields(INigeriaPGApplicant)
+            for field in PG_OMIT_PDF_FIELDS:
+                form_fields = form_fields.omit(field)
+        elif self.target is not None and self.target.startswith('putme'):
+            form_fields = grok.AutoFields(INigeriaUGApplicant)
+            if self._reduced_slip():
+                for field in PUTME_OMIT_RESULT_SLIP_FIELDS:
+                    form_fields = form_fields.omit(field)
+            else:
+                for field in PUTME_OMIT_PDF_FIELDS:
+                    form_fields = form_fields.omit(field)
+        elif self.target is not None and self.target.startswith('pude'):
+            form_fields = grok.AutoFields(INigeriaUGApplicant)
+            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(INigeriaUGApplicant)
+            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')
+        if not getattr(self.context, 'screening_score'):
+            form_fields = form_fields.omit('screening_score')
+        if not getattr(self.context, 'screening_venue'):
+            form_fields = form_fields.omit('screening_venue')
+        if not getattr(self.context, 'screening_date'):
+            form_fields = form_fields.omit('screening_date')
+        return form_fields
+
+class NigeriaApplicantManageFormPage(ApplicantManageFormPage):
+    """A full edit view for applicant data.
+    """
+    
+    @property
+    def form_fields(self):
+        if self.target is not None and self.target.startswith('pg'):
+            form_fields = grok.AutoFields(INigeriaPGApplicant)
+            for field in PG_OMIT_MANAGE_FIELDS:
+                form_fields = form_fields.omit(field)
+        elif self.target is not None and self.target.startswith('putme'):
+            form_fields = grok.AutoFields(INigeriaUGApplicant)
+            for field in PUTME_OMIT_MANAGE_FIELDS:
+                form_fields = form_fields.omit(field)
+        elif self.target is not None and self.target.startswith('pude'):
+            form_fields = grok.AutoFields(INigeriaUGApplicant)
+            for field in PUDE_OMIT_MANAGE_FIELDS:
+                form_fields = form_fields.omit(field)
+        else:
+            form_fields = grok.AutoFields(INigeriaUGApplicant)
+            for field in UG_OMIT_MANAGE_FIELDS:
+                form_fields = form_fields.omit(field)
+        form_fields['student_id'].for_display = True
+        form_fields['applicant_id'].for_display = True
+        return form_fields
+
+class NigeriaApplicantEditFormPage(ApplicantEditFormPage):
+    """An applicant-centered edit view for applicant data.
+    """
+
+    @property
+    def form_fields(self):
+        if self.target is not None and self.target.startswith('pg'):
+            form_fields = grok.AutoFields(INigeriaPGApplicantEdit)
+            for field in PG_OMIT_EDIT_FIELDS:
+                form_fields = form_fields.omit(field)
+        elif self.target is not None and self.target.startswith('putme'):
+            form_fields = grok.AutoFields(IPUTMEApplicantEdit)
+            for field in PUTME_OMIT_EDIT_FIELDS:
+                form_fields = form_fields.omit(field)
+        elif self.target is not None and self.target.startswith('pude'):
+            form_fields = grok.AutoFields(INigeriaUGApplicantEdit)
+            for field in PUDE_OMIT_EDIT_FIELDS:
+                form_fields = form_fields.omit(field)
+        else:
+            form_fields = grok.AutoFields(INigeriaUGApplicantEdit)
+            for field in UG_OMIT_EDIT_FIELDS:
+                form_fields = form_fields.omit(field)
+        form_fields['applicant_id'].for_display = True
+        form_fields['reg_number'].for_display = True
+        return form_fields
+
+class NigeriaOnlinePaymentDisplayFormPage(OnlinePaymentDisplayFormPage):
+    """ Page to view an online payment ticket
+    """
+    grok.context(INigeriaApplicantOnlinePayment)
+    form_fields = grok.AutoFields(INigeriaApplicantOnlinePayment).omit('ac',
+        'provider_amt', 'gateway_amt', 'thirdparty_amt', 'p_item')
+    form_fields[
+        'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+    form_fields[
+        'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+
+class NigeriaExportPDFPaymentSlipPage(ExportPDFPaymentSlipPage):
+    """Deliver a PDF slip of the context.
+    """
+    grok.context(INigeriaApplicantOnlinePayment)
+    form_fields = grok.AutoFields(INigeriaApplicantOnlinePayment).omit(
+        'ac', 'provider_amt', 'gateway_amt', 'thirdparty_amt', 'p_item')
+    form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+    form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+
+class NigeriaApplicantRegistrationPage(ApplicantRegistrationPage):
+    """Captcha'd registration page for applicants.
+    """
+
+    #def _redirect(self, email, password, applicant_id):
+    #    # Forward email and credentials to landing page.
+    #    self.redirect(self.url(self.context, 'registration_complete',
+    #        data = dict(email=email, password=password,
+    #        applicant_id=applicant_id)))
+    #    return
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/export.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/export.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/export.py	(revision 11268)
@@ -0,0 +1,41 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Exporters for applicant-related stuff.
+"""
+import grok
+from waeup.kofa.applicants.interfaces import IApplicantBaseData
+from waeup.kofa.applicants.export import ApplicantsExporter
+from kofacustom.nigeria.applicants.interfaces import (
+    INigeriaUGApplicant, INigeriaPGApplicant)
+
+class NigeriaApplicantsExporter(ApplicantsExporter):
+    """Exporter for Nigeria Applicants.
+    """
+
+    fields = tuple(sorted(set(
+        INigeriaUGApplicant.names() +
+        INigeriaPGApplicant.names() +
+        IApplicantBaseData.names()
+        ))) + ('container_code',)
+
+    def mangle_value(self, value, name, context=None):
+        if '_result' in name and value:
+            value = [eval(entry.to_string()) for entry in value]
+        return super(
+            NigeriaApplicantsExporter, self).mangle_value(
+            value, name, context=context)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/interfaces.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/interfaces.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/interfaces.py	(revision 11268)
@@ -0,0 +1,513 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Customized interfaces of the university application package.
+"""
+
+from zope import schema
+from waeup.kofa.applicants.interfaces import (
+    contextual_reg_num_source,
+    IApplicantBaseData,
+    AppCatCertificateSource, CertificateSource)
+from waeup.kofa.schoolgrades import ResultEntryField
+from waeup.kofa.interfaces import (
+    SimpleKofaVocabulary, academic_sessions_vocab, validate_email)
+from waeup.kofa.schema import FormattedDate, TextLineChoice
+from waeup.kofa.students.vocabularies import nats_vocab, GenderSource
+from kofacustom.nigeria.interfaces import (
+    LGASource, high_qual, high_grade, exam_types)
+from kofacustom.nigeria.interfaces import MessageFactory as _
+from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment
+
+# Fields to be omitted in all display forms. course_admitted is
+# rendered separately.
+
+OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted',
+    'result_uploaded', 'suspended', 'special_application')
+
+# UG students are all undergraduate students.
+UG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS
+UG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('phone',)
+UG_OMIT_MANAGE_FIELDS = ('special_application',)
+UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + OMIT_DISPLAY_FIELDS + (
+    'student_id', 'notice',
+    'screening_score', 'screening_venue',
+    'screening_date', 'jamb_subjects',
+    'jamb_score', 'aggregate')
+
+# PUTME is a subgroup of UG with the same interface.
+PUTME_OMIT_FIELDS = (
+    'hq_type', 'hq_matric_no',
+    'hq_degree', 'hq_school',
+    'hq_session', 'hq_disc',)
+PUTME_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PUTME_OMIT_FIELDS
+PUTME_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PUTME_OMIT_FIELDS
+PUTME_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + PUTME_OMIT_FIELDS + (
+    'firstname', 'middlename', 'lastname', 'sex',
+    'course1', 'lga')
+PUTME_OMIT_PDF_FIELDS = PUTME_OMIT_DISPLAY_FIELDS + ('phone',)
+PUTME_OMIT_RESULT_SLIP_FIELDS = PUTME_OMIT_DISPLAY_FIELDS + (
+    'phone',
+    'date_of_birth', 'sex',
+    'nationality', 'lga', #'perm_address',
+    'course2', 'screening_venue',
+    'screening_date')
+
+# PUDE is a subgroup of UG with the same interface.
+PUDE_OMIT_FIELDS = (
+    'jamb_subjects','jamb_score', 'aggregate')
+PUDE_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PUDE_OMIT_FIELDS
+PUDE_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PUDE_OMIT_FIELDS
+PUDE_OMIT_EDIT_FIELDS = set(UG_OMIT_EDIT_FIELDS + PUDE_OMIT_FIELDS + (
+    'firstname', 'middlename', 'lastname', 'sex',
+    'course1', 'lga'))
+PUDE_OMIT_PDF_FIELDS = PUDE_OMIT_DISPLAY_FIELDS + ('phone',)
+PUDE_OMIT_RESULT_SLIP_FIELDS = PUDE_OMIT_DISPLAY_FIELDS + (
+    'phone',
+    'date_of_birth', 'sex',
+    'nationality', 'lga', #'perm_address',
+    'course2', 'screening_venue',
+    'screening_date')
+
+# PG has its own interface
+PG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS
+PG_OMIT_PDF_FIELDS = PG_OMIT_DISPLAY_FIELDS + ('phone',)
+PG_OMIT_MANAGE_FIELDS = ('special_application',)
+PG_OMIT_EDIT_FIELDS = PG_OMIT_MANAGE_FIELDS + PG_OMIT_DISPLAY_FIELDS + (
+    'student_id', 'notice',
+    'screening_score', 'screening_venue',
+    'screening_date',)
+
+class INigeriaUGApplicant(IApplicantBaseData):
+    """An undergraduate applicant.
+
+    This interface defines the least common multiple of all fields
+    in ug application forms. In customized forms, fields can be excluded by
+    adding them to the UG_OMIT* tuples.
+    """
+
+    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,
+        )
+    jamb_subjects = schema.Text(
+        title = _(u'Subjects and Scores'),
+        required = False,
+        )
+    jamb_score = schema.Int(
+        title = _(u'Total JAMB 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,
+        required = 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,
+        required = False,
+        )
+
+INigeriaUGApplicant[
+    'locked'].order =  IApplicantBaseData['suspended'].order
+INigeriaUGApplicant[
+    'result_uploaded'].order =  INigeriaUGApplicant['suspended'].order
+
+class INigeriaPGApplicant(IApplicantBaseData):
+    """A postgraduate applicant.
+
+    This interface defines the least common multiple of all fields
+    in pg application forms. In customized forms, fields can be excluded by
+    adding them to the PG_OMIT* tuples.
+    """
+
+    nationality = schema.Choice(
+        source = nats_vocab,
+        title = _(u'Nationality'),
+        required = True,
+        )
+    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_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,
+        )
+    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,
+        )
+    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,
+        required = False,
+        )
+
+INigeriaPGApplicant[
+    'locked'].order =  IApplicantBaseData['suspended'].order
+
+class INigeriaApplicant(INigeriaUGApplicant, INigeriaPGApplicant):
+    """An interface for both types of applicants.
+
+    Attention: The INigeriaPGApplicant field seetings will be overwritten
+    by INigeriaPGApplicant field settings. If a field is defined
+    in both interfaces zope.schema validates only against the
+    constraints in INigeriaUGApplicant. This does not affect the forms
+    since they are build on either INigeriaUGApplicant or INigeriaPGApplicant.
+    """
+
+    def writeLogMessage(view, comment):
+        """Adds an INFO message to the log file
+        """
+
+    def createStudent():
+        """Create a student object from applicant data
+        and copy applicant object.
+        """
+
+class INigeriaUGApplicantEdit(INigeriaUGApplicant):
+    """An undergraduate applicant interface for edit forms.
+
+    Here we can repeat the fields from base data and set the
+    `required` and `readonly` attributes to True to further restrict
+    the data access. Or we can allow only certain certificates to be
+    selected by choosing the appropriate source.
+
+    We cannot omit fields here. This has to be done in the
+    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,
+        )
+
+INigeriaUGApplicantEdit[
+    'date_of_birth'].order =  INigeriaUGApplicant['date_of_birth'].order
+INigeriaUGApplicantEdit[
+    'email'].order =  INigeriaUGApplicant['email'].order
+
+class INigeriaPGApplicantEdit(INigeriaPGApplicant):
+    """A postgraduate applicant interface for editing.
+
+    Here we can repeat the fields from base data and set the
+    `required` and `readonly` attributes to True to further restrict
+    the data access. Or we can allow only certain certificates to be
+    selected by choosing the appropriate source.
+
+    We cannot omit fields here. This has to be done in the
+    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,
+        )
+
+INigeriaPGApplicantEdit[
+    'date_of_birth'].order =  INigeriaPGApplicant['date_of_birth'].order
+INigeriaPGApplicantEdit[
+    'email'].order =  INigeriaPGApplicant['email'].order
+
+class INigeriaApplicantOnlinePayment(INigeriaOnlinePayment):
+    """An applicant payment via payment gateways.
+
+    """
+
+class IPUTMEApplicantEdit(INigeriaUGApplicant):
+    """An undergraduate applicant interface for editing.
+
+    Here we can repeat the fields from base data and set the
+    `required` and `readonly` attributes to True to further restrict
+    the data access. Or we can allow only certain certificates to be
+    selected by choosing the appropriate source.
+
+    We cannot omit fields here. This has to be done in the
+    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,
+        )
+    nationality = schema.Choice(
+        source = nats_vocab,
+        title = _(u'Nationality'),
+        required = True,
+        )
+
+IPUTMEApplicantEdit[
+    'date_of_birth'].order =  INigeriaUGApplicant['date_of_birth'].order
+IPUTMEApplicantEdit[
+    'email'].order =  INigeriaUGApplicant['email'].order
+IPUTMEApplicantEdit[
+    'nationality'].order =  INigeriaUGApplicant['nationality'].order
+
+class INigeriaApplicantUpdateByRegNo(INigeriaApplicant):
+    """Representation of an applicant.
+
+    Skip regular reg_number validation if reg_number is used for finding
+    the applicant object.
+    """
+    reg_number = schema.TextLine(
+        title = u'Registration Number',
+        required = False,
+        )
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/__init__.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/__init__.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/__init__.py	(revision 11268)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/test_applicant.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/test_applicant.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/test_applicant.py	(revision 11268)
@@ -0,0 +1,79 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Tests for applicants and related.
+"""
+import grok
+import shutil
+import tempfile
+from StringIO import StringIO
+from zope.component import adapts, queryUtility
+from zope.component.interfaces import IFactory
+from zope.interface import verify, implements
+from zope.location.interfaces import ILocation
+from waeup.kofa.image.interfaces import IKofaImageFile
+from waeup.kofa.imagestorage import DefaultStorage
+from waeup.kofa.interfaces import IFileStoreHandler, IFileStoreNameChooser
+from waeup.kofa.testing import FunctionalTestCase
+from kofacustom.nigeria.applicants.applicant import (
+    NigeriaApplicant, NigeriaApplicantFactory,
+    )
+from kofacustom.nigeria.applicants.interfaces import INigeriaApplicant
+from kofacustom.nigeria.testing import FunctionalLayer
+
+class NigeriaApplicantTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(NigeriaApplicantTest, self).setUp()
+        self.applicant = NigeriaApplicant()
+        return
+
+    def tearDown(self):
+        super(NigeriaApplicantTest, self).tearDown()
+        return
+
+    def test_interfaces(self):
+        verify.verifyClass(INigeriaApplicant, NigeriaApplicant)
+        verify.verifyObject(INigeriaApplicant, self.applicant)
+        return
+
+class NigeriaApplicantFactoryTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(NigeriaApplicantFactoryTest, self).setUp()
+        self.factory = NigeriaApplicantFactory()
+        return
+
+    def tearDown(self):
+        super(NigeriaApplicantFactoryTest, self).tearDown()
+        return
+
+    def test_interfaces(self):
+        verify.verifyClass(IFactory, NigeriaApplicantFactory)
+        verify.verifyObject(IFactory, self.factory)
+
+    def test_factory(self):
+        obj = self.factory()
+        assert isinstance(obj, NigeriaApplicant)
+
+    def test_getInterfaces(self):
+        implemented_by = self.factory.getInterfaces()
+        assert implemented_by.isOrExtends(INigeriaApplicant)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/test_applicantcopier.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/test_applicantcopier.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/test_applicantcopier.py	(revision 11268)
@@ -0,0 +1,83 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Tests for the creation of student containers with data from admitted applicants.
+"""
+import os
+import grok
+from datetime import datetime
+from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState
+from zope.event import notify
+from zope.component import getUtility
+from zope.i18n import translate
+from waeup.kofa.interfaces import IExtFileStore, IFileStoreNameChooser
+from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup
+from kofacustom.nigeria.testing import FunctionalLayer
+
+session = datetime.now().year - 2
+
+class ApplicantCopierFunctionalTests(ApplicantsFullSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(ApplicantCopierFunctionalTests, self).setUp()
+        return
+
+    def test_copier_ume(self):
+        IWorkflowState(self.applicant).setState('admitted')
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.manage_path)
+        self.fill_correct_values()
+        self.browser.getControl("Save").click()
+        self.browser.getControl(name="form.nationality").value = ['NG']
+        self.browser.getControl(name="form.course_admitted").value = ['CERT1']
+        self.browser.getControl("Save").click()
+        (success, msg) = self.applicant.createStudent()
+        student_id = translate(msg, 'waeup.kofa').split()[1]
+        student = self.app['students'][student_id]
+        self.assertEqual(student.state, 'admitted')
+        # Has the ume student studycourse the correct attributes?
+        self.assertEqual(student['studycourse'].certificate.code, 'CERT1')
+        self.assertEqual(student['studycourse'].entry_session, session)
+        self.assertEqual(student['studycourse'].entry_mode, 'ug_ft')
+        self.assertEqual(student['studycourse'].current_session, session)
+        self.assertEqual(student['studycourse'].current_level, 100)
+
+    def test_copier_de(self):
+        IWorkflowState(self.applicant).setState('admitted')
+        # The applicant_id decides how studycourse attributes
+        # are being set.
+        self.applicant.applicant_id = u'pude2010_anything'
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.manage_path)
+        self.fill_correct_values()
+        self.browser.getControl("Save").click()
+        self.browser.getControl(name="form.nationality").value = ['NG']
+        self.browser.getControl(name="form.course_admitted").value = ['CERT1']
+        self.browser.getControl("Save").click()
+        (success, msg) = self.applicant.createStudent()
+        student_id = translate(msg, 'waeup.kofa').split()[1]
+        student = self.app['students'][student_id]
+        self.assertEqual(student.state, 'admitted')
+        # Has the ume student studycourse the correct attributes?
+        self.assertEqual(student['studycourse'].certificate.code, 'CERT1')
+        self.assertEqual(student['studycourse'].entry_session, session)
+        self.assertEqual(student['studycourse'].entry_mode, 'de_ft')
+        self.assertEqual(student['studycourse'].current_session, session)
+        self.assertEqual(student['studycourse'].current_level, 200)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/test_browser.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/test_browser.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/tests/test_browser.py	(revision 11268)
@@ -0,0 +1,429 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import os
+import shutil
+import tempfile
+import datetime
+import grok
+import pytz
+from zope.event import notify
+from zope.intid.interfaces import IIntIds
+from zope.interface.verify import verifyClass, verifyObject
+from zope.schema.interfaces import ConstraintNotSatisfied
+from zope.component.hooks import setSite, clearSite
+from zope.component import createObject, getUtility
+from zope.catalog.interfaces import ICatalog
+from zope.testbrowser.testing import Browser
+from hurry.workflow.interfaces import IWorkflowState
+from waeup.kofa.app import University
+from waeup.kofa.university.faculty import Faculty
+from waeup.kofa.university.department import Department
+from waeup.kofa.testing import FunctionalTestCase
+from waeup.kofa.configuration import SessionConfiguration
+from waeup.kofa.applicants.container import ApplicantsContainer
+from waeup.kofa.applicants.tests.test_batching import ApplicantImportExportSetup
+from waeup.kofa.interfaces import IBatchProcessor
+from kofacustom.nigeria.testing import FunctionalLayer
+from kofacustom.nigeria.applicants.export import NigeriaApplicantsExporter
+from kofacustom.nigeria.applicants.batching import NigeriaApplicantProcessor
+
+session_1 = datetime.datetime.now().year - 2
+app_container_name = u'app%s' % session_1
+pgft_container_name = u'pgft%s' % session_1
+
+class ApplicantUITest(FunctionalTestCase):
+    """Perform some browser tests.
+    """
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(ApplicantUITest, self).setUp()
+        # Setup a sample site for each test
+        app = University()
+        self.dc_root = tempfile.mkdtemp()
+        app['datacenter'].setStoragePath(self.dc_root)
+
+        # Prepopulate the ZODB...
+        self.getRootFolder()['app'] = app
+        # we add the site immediately after creation to the
+        # ZODB. Catalogs and other local utilities are not setup
+        # before that step.
+        self.app = self.getRootFolder()['app']
+        # Set site here. Some of the following setup code might need
+        # to access grok.getSite() and should get our new app then
+        setSite(app)
+
+        # Add an two different applicants containers
+        self.pgcontainer = ApplicantsContainer()
+        self.pgcontainer.code = pgft_container_name
+        self.pgcontainer.prefix = u'pgft'
+        self.pgcontainer.application_category = u'pg_ft'
+        self.pgcontainer.year = session_1
+        self.pgcontainer.application_fee = 300.0
+        self.pgcontainer.title = u'This is the %s container' % pgft_container_name
+        self.app['applicants'][pgft_container_name] = self.pgcontainer
+        self.ugcontainer = ApplicantsContainer()
+        self.ugcontainer.code = app_container_name
+        self.ugcontainer.prefix = u'app'
+        self.ugcontainer.application_category = u'basic'
+        self.ugcontainer.year = session_1
+        self.ugcontainer.application_fee = 200.0
+        self.ugcontainer.title = u'This is the %s container' % app_container_name
+        self.app['applicants'][app_container_name] = self.ugcontainer
+
+        self.ugcontainer.mode = 'update'
+        delta = datetime.timedelta(days=10)
+        self.ugcontainer.startdate = datetime.datetime.now(pytz.utc) - delta
+        self.ugcontainer.enddate = datetime.datetime.now(pytz.utc) + delta
+
+        # Populate university
+        self.certificate = createObject('waeup.Certificate')
+        self.certificate.code = 'CERT1'
+        self.certificate.application_category = 'basic'
+        self.certificate.start_level = 100
+        self.certificate.end_level = 500
+        self.certificate.study_mode = u'ug_ft'
+        self.app['faculties']['fac1'] = Faculty()
+        self.app['faculties']['fac1']['dep1'] = Department()
+        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
+            self.certificate)
+        self.certificate2 = createObject('waeup.Certificate')
+        self.certificate2.code = 'CERT2'
+        self.certificate2.application_category = 'pg_ft'
+        self.certificate2.start_level = 100
+        self.certificate2.end_level = 500
+        self.certificate.study_mode = u'pg_ft'
+        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
+            self.certificate2)
+
+        # Add (customized) applicants
+        pgapplicant = createObject(u'waeup.Applicant')
+        pgapplicant.firstname = u'Anna'
+        pgapplicant.lastname = u'Post'
+        self.app['applicants'][pgft_container_name].addApplicant(pgapplicant)
+        self.pgapplication_number = pgapplicant.application_number
+        self.pgapplicant = self.app['applicants'][pgft_container_name][
+            self.pgapplication_number]
+
+        ugapplicant = createObject(u'waeup.Applicant')
+        ugapplicant.firstname = u'Klaus'
+        ugapplicant.lastname = u'Under'
+        self.app['applicants'][app_container_name].addApplicant(ugapplicant)
+        self.ugapplication_number = ugapplicant.application_number
+        self.ugapplicant = self.app['applicants'][app_container_name][
+            self.ugapplication_number]
+        self.pgapplicant_path = ('http://localhost/app/applicants/%s/%s'
+            % (pgft_container_name, self.pgapplication_number))
+        self.ugapplicant_path = ('http://localhost/app/applicants/%s/%s'
+            % (app_container_name, self.ugapplication_number))
+
+        self.browser = Browser()
+        self.browser.handleErrors = False
+
+        configuration = SessionConfiguration()
+        configuration.academic_session = session_1
+        configuration.application_fee = 200.0
+        self.app['configuration'].addSessionConfiguration(configuration)
+
+    def tearDown(self):
+        super(ApplicantUITest, self).tearDown()
+        shutil.rmtree(self.dc_root)
+        clearSite()
+        return
+
+    def fill_correct_values(self):
+        self.browser.getControl(name="form.reg_number").value = '1234'
+        self.browser.getControl(name="form.firstname").value = 'John'
+        self.browser.getControl(name="form.lastname").value = 'Tester'
+        self.browser.getControl(name="form.date_of_birth").value = '09/09/1988'
+        self.browser.getControl(name="form.lga").value = ['foreigner']
+        self.browser.getControl(name="form.nationality").value = ['NG']
+        self.browser.getControl(name="form.sex").value = ['m']
+        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
+
+    def test_manage_and_view_applicant(self):
+        # Managers can manage pg applicants.
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        # The IPGApplicant interface is really used in all pages.
+        self.browser.open(self.pgapplicant_path)
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertTrue('Employer' in self.browser.contents)
+        self.browser.open(self.pgapplicant_path + '/manage')
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertTrue('Employer' in self.browser.contents)
+        self.browser.open(self.pgapplicant_path + '/edit')
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertTrue('Employer' in self.browser.contents)
+        self.browser.open(self.pgapplicant_path + '/application_slip.pdf')
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        # If we view the applicant in the ug container,
+        # the employer field doesn't appear.
+        self.browser.open(self.ugapplicant_path)
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertFalse('Employer' in self.browser.contents)
+        self.browser.open(self.ugapplicant_path + '/manage')
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        # We can save the applicant.
+        self.fill_correct_values()
+        self.browser.getControl(name="form.course1").value = ['CERT1']
+        self.browser.getControl("Save").click()
+        self.assertMatches('...Form has been saved...', self.browser.contents)
+        self.assertFalse('Employer' in self.browser.contents)
+        self.browser.open(self.ugapplicant_path + '/edit')
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertFalse('Employer' in self.browser.contents)
+        self.browser.open(self.ugapplicant_path + '/application_slip.pdf')
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        return
+
+    def test_set_wrong_course1(self):
+        self.ugapplicant.course1 = self.certificate
+        self.assertRaises(
+            ConstraintNotSatisfied,
+            setattr, self.ugapplicant, 'course1', self.certificate2)
+        self.pgapplicant.course1 = self.certificate2
+        self.assertRaises(
+            ConstraintNotSatisfied,
+            setattr, self.pgapplicant, 'course1', self.certificate)
+        return
+
+    def test_application_payment(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+
+        # UG (UTME) applicant
+        self.browser.open(self.ugapplicant_path)
+        self.browser.open(self.ugapplicant_path + '/manage')
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.fill_correct_values()
+        self.browser.getControl(name="form.course1").value = ['CERT1']
+        self.browser.getControl("Save").click()
+        self.assertMatches('...Form has been saved...', self.browser.contents)
+        self.browser.getControl("Add online payment ticket").click()
+        self.assertMatches('...Payment ticket created...',
+                           self.browser.contents)
+        self.assertMatches('...Amount Authorized...',
+                           self.browser.contents)
+        payment_id = self.ugapplicant.keys()[0]
+        payment = self.ugapplicant[payment_id]
+        self.assertEqual(payment.p_item,'This is the %s container' % app_container_name)
+        self.assertEqual(payment.p_session,session_1)
+        self.assertEqual(payment.p_category,'application')
+        self.assertEqual(payment.amount_auth, 200.0)
+
+        # PG applicants pay more
+        self.browser.open(self.pgapplicant_path)
+        self.browser.open(self.pgapplicant_path + '/manage')
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.fill_correct_values()
+        self.browser.getControl(name="form.course1").value = ['CERT2']
+        self.browser.getControl(name="form.reg_number").value = '2345'
+        self.browser.getControl(name="form.firstname").value = 'Anna'
+        self.browser.getControl("Save").click()
+        self.assertMatches('...Form has been saved...', self.browser.contents)
+        self.browser.getControl("Add online payment ticket").click()
+        self.assertMatches('...Payment ticket created...',
+                           self.browser.contents)
+        self.assertMatches('...Amount Authorized...',
+                           self.browser.contents)
+        payment_id = self.pgapplicant.keys()[0]
+        payment = self.pgapplicant[payment_id]
+        self.assertEqual(payment.p_item,'This is the %s container' % pgft_container_name)
+        self.assertEqual(payment.p_session,session_1)
+        self.assertEqual(payment.p_category,'application')
+        self.assertEqual(payment.amount_auth, 300.0)
+        return
+
+    def test_hide_screening_data(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.ugapplicant_path + '/manage')
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.fill_correct_values()
+        self.browser.getControl(name="form.screening_venue").value = 'Mensa'
+        self.browser.getControl(name="form.screening_date").value = 'Easter'
+        self.browser.getControl(name="form.course1").value = ['CERT1']
+        self.browser.getControl("Save").click()
+        self.assertMatches('...Form has been saved...', self.browser.contents)
+        self.browser.getControl("Save").click()
+        # Venue and date are not shown
+        self.browser.open(self.ugapplicant_path)
+        self.assertFalse('Screening' in self.browser.contents)
+        IWorkflowState(self.ugapplicant).setState('paid')
+        # Venue and date are shown if applicant has paid
+        self.browser.open(self.ugapplicant_path)
+        self.assertTrue('Screening' in self.browser.contents)
+        return
+
+    def test_register_applicant_update(self):
+        # An applicant can register himself.
+        self.ugapplicant.reg_number = u'1234'
+        notify(grok.ObjectModifiedEvent(self.ugapplicant))
+        self.browser.open('http://localhost/app/applicants/%s/' % app_container_name)
+        self.browser.getLink("Register for application").click()
+        # Fill the edit form with suitable values
+        self.browser.getControl(name="form.firstname").value = 'Klaus'
+        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
+        self.browser.getControl(name="form.reg_number").value = '1234'
+        self.browser.getControl("Send login credentials").click()
+        self.assertMatches('...Your registration was successful...',
+            self.browser.contents)
+        self.assertFalse('...<td>Password:</td>...' in self.browser.contents)
+        # The new applicant can be found in the catalog via the email address
+        cat = getUtility(ICatalog, name='applicants_catalog')
+        results = list(
+            cat.searchResults(email=('xx@yy.zz', 'xx@yy.zz')))
+        applicant = results[0]
+        self.assertEqual(applicant.lastname,'Under')
+        # The applicant can be found in the catalog via the reg_number
+        results = list(
+            cat.searchResults(
+            reg_number=(applicant.reg_number, applicant.reg_number)))
+        self.assertEqual(applicant,results[0])
+        return
+
+    def test_create_ugstudent(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        manage_path = 'http://localhost/app/applicants/%s/%s/%s' % (
+            app_container_name, self.ugapplicant.application_number, 'manage')
+        self.browser.open(manage_path)
+        self.fill_correct_values()
+        self.browser.getControl("Save").click()
+        IWorkflowState(self.ugapplicant).setState('admitted')
+        self.browser.getControl(name="form.course1").value = ['CERT1']
+        self.browser.getControl(name="form.course_admitted").value = ['CERT1']
+        self.browser.getControl("Save").click()
+        self.browser.getLink("Create student").click()
+        student_id =  self.app['students'].keys()[0]
+        self.assertTrue(('Student %s created' % student_id)
+            in self.browser.contents)
+        student = self.app['students'][student_id]
+        self.assertEqual(student.email, 'xx@yy.zz')
+        self.assertEqual(student.firstname, 'John')
+        self.assertEqual(student.lastname, 'Tester')
+        # Also additional attributes have been copied.
+        self.assertEqual(student.lga, 'foreigner')
+        self.assertEqual(student.nationality, 'NG')
+        return
+
+class ApplicantsExporterTest(ApplicantImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(ApplicantsExporterTest, self).setUp()
+        self.outfile = os.path.join(self.workdir, 'myoutput.csv')
+        self.cat = getUtility(ICatalog, name='applicants_catalog')
+        self.intids = getUtility(IIntIds)
+        return
+
+    def setup_applicant(self, applicant):
+        # set predictable values for `applicant`
+        applicant.reg_number = u'123456'
+        applicant.applicant_id = u'dp2011_654321'
+        applicant.firstname = u'Anna'
+        applicant.lastname = u'Tester'
+        applicant.middlename = u'M.'
+        applicant.nationality = u'NG'
+        applicant.date_of_birth = datetime.date(1981, 2, 4)
+        applicant.sex = 'f'
+        applicant.email = 'anna@sample.com'
+        applicant.phone = u'+234-123-12345'
+        applicant.course1 = self.certificate
+        applicant.course2 = self.certificate
+        applicant.course_admitted = self.certificate
+        applicant.notice = u'Some notice\nin lines.'
+        applicant.screening_score = 98
+        applicant.screening_venue = u'Exam Room'
+        applicant.screening_date = u'Saturday, 16th June 2012 2:00:00 PM'
+        applicant.password = 'any password'
+        return applicant
+
+    def test_export_reimport_all(self):
+        # we can export all applicants in a portal
+        # set values we can expect in export file
+        self.applicant = self.setup_applicant(self.applicant)
+        exporter = NigeriaApplicantsExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertMatches(result,
+            'aggregate,applicant_id,application_date,application_number,'
+            'course1,course2,course_admitted,date_of_birth,display_fullname,'
+            'email,emp2_end,emp2_position,emp2_reason,emp2_start,emp_end,'
+            'emp_position,emp_reason,emp_start,employer,employer2,'
+            'firstname,history,hq_degree,hq_disc,hq_matric_no,hq_school,'
+            'hq_session,hq_type,jamb_score,jamb_subjects,lastname,lga,'
+            'locked,middlename,nationality,notice,nysc_lga,nysc_year,'
+            'password,phone,pp_school,presently_inst,reg_number,'
+            'result_uploaded,screening_date,screening_score,'
+            'screening_venue,sex,special_application,'
+            'state,student_id,suspended,container_code\r\n'
+            ',dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,'
+            'Anna M. Tester,anna@sample.com,,,,,,,,,,,Anna,'
+            '[u\'2012-10-28 21:27:52 WAT - Application initialized by system\']'
+            ',,,,,,,,,Tester,,0,M.,NG,"Some notice\nin lines.",,,'
+            'any password,+234-123-12345#,,,123456,,'
+            '"Saturday, 16th June 2012 2:00:00 PM",98,Exam Room,f,,initialized,,'
+            '0,dp2011\r\n')
+        # We can import the same file if we ignore some columns.
+        # Since the applicants_catalog hasn't been notified, the same
+        # record with same reg_number can be imported twice.
+        processor = NigeriaApplicantProcessor()
+        result = processor.doImport(
+            self.outfile,
+            ['aggreagate','ignore_applicant_id','application_date',
+            'ignore_application_number','course1','course2',
+            'course_admitted','date_of_birth','ignore3','email','emp2_end',
+            'emp2_position','emp2_reason','emp2_start','emp_end','emp_position',
+            'emp_reason','emp_start','employer','employer2','firstname','ignore4',
+            'hq_degree','hq_disc','hq_matric_no','hq_school','hq_session','hq_type',
+            'jamb_score','jamb_subjects','lastname','lga','locked','middlename',
+            'nationality','notice','nysc_lga',
+            'nysc_year','password','phone','pp_school','presently_inst',
+            'reg_number','result_uploaded',
+            'screening_date','screening_score','screening_venue','sex',
+            'special_application',
+            'state','student_id','suspended','container_code'],
+            mode='create')
+        num_succ, num_fail, finished_path, failed_path = result
+        #content = open(failed_path).read()
+        self.assertEqual(num_succ,1)
+        self.assertEqual(num_fail,0)
+        # Now we ignore also the container_code and import the same file 
+        # in update mode which means that INigeriaApplicantUpdateByRegNo
+        # is used for field conversion. applicant_id must be ignored
+        # too since the previous import has notified the applicants_catalog
+        # so that the portal 'knows' that reg_number is in use.
+        processor = NigeriaApplicantProcessor()
+        result = processor.doImport(
+            self.outfile,
+            ['aggregate','ignore_applicant_id','application_date',
+            'ignore_application_number','course1','course2',
+            'course_admitted','date_of_birth','ignore3','email','emp2_end',
+            'emp2_position','emp2_reason','emp2_start','emp_end','emp_position',
+            'emp_reason','emp_start','employer','employer2','firstname','ignore4',
+            'hq_degree','hq_disc','hq_matric_no','hq_school','hq_session','hq_type',
+            'jamb_score','jamb_subjects','lastname','lga','locked','middlename',
+            'nationality','notice','nysc_lga',
+            'nysc_year','password','phone','pp_school','presently_inst',
+            'reg_number','result_uploaded','screening_date','screening_score',
+            'screening_venue','sex','special_application',
+            'state','student_id','suspended','ignore_container_code'],
+            mode='update')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_succ,1)
+        self.assertEqual(num_fail,0)
+        return
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/utils.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/utils.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/applicants/utils.py	(revision 11268)
@@ -0,0 +1,56 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""General helper functions and utilities for the application section.
+"""
+
+import grok
+from waeup.kofa.applicants.utils import ApplicantsUtils
+from kofacustom.nigeria.interfaces import MessageFactory as _
+
+
+class NigeriaApplicantsUtils(ApplicantsUtils):
+    """A collection of parameters and methods subject to customization.
+    """
+
+    APP_TYPES_DICT = {
+        'pude': ['Post-UDE Screening', 'PUDE'],
+        'prence': ['Pre-NCE Programme', 'PRE'],
+        'sandwich': ['Part-Time Degree in Education', 'SAND'],
+        'pt': ['Part-Time Degree Programmes', 'PTP'],
+        'putme': ['Post-UTME Screening Exercise', 'PUTME'],
+        'app': ['General Studies', 'APP'],
+        'cest': ['Common Entry Screening Test', 'CEST'],
+        'ct': ['Certificate Programmes', 'CTP'],
+        'dp': ['Diploma Programmes', 'DPP'],
+        'pce': ['PCE Screening', 'PCE'],
+        'pgft': ['Postgraduate Full-Time Programmes', 'PG'],
+        'pgpt': ['Postgraduate Part-Time Programmes', 'PG'],
+        }
+
+    SEPARATORS_DICT = {
+        'form.applicant_id': _(u'Base Data'),
+        'form.course1': _(u'Programmes/Courses Desired'),
+        'form.hq_type': _(u'Higher Education Record'),
+        'form.presently': _(u'Course or Programme Presently Attending'),
+        'form.nysc_year': _(u'NYSC Information'),
+        'form.employer': _(u'Employment History'),
+        'form.jamb_subjects': _(u'JAMB Data'),
+        'form.notice': _(u'Application Process Information'),
+        'form.pp_school': _(u'Post Primary School Qualification'),
+        'form.presently_inst': _(u'Presently attending a course or programme'),
+        }
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/configure.zcml
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/configure.zcml	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/configure.zcml	(revision 11268)
@@ -0,0 +1,20 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:grok="http://namespaces.zope.org/grok">
+
+  <!-- Loading waeup.kofa also configures a lot of other needed
+       packages correctly.
+  -->
+  <include package="waeup.kofa" />
+  <include package="kofacustom.nigeria" file="locales.zcml" />
+  <grok:grok package="." />
+
+  <!-- Register edit widget for PhoneNumbers -->
+  <adapter
+      for="waeup.kofa.schema.interfaces.IPhoneNumber
+           zope.publisher.interfaces.browser.IBrowserRequest"
+      provides="zope.formlib.interfaces.ISimpleInputWidget"
+      factory="kofacustom.nigeria.widgets.phonewidget.NigeriaPhoneWidget"
+      permission="zope.Public"
+      />
+
+</configure>
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/ftesting.zcml
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/ftesting.zcml	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/ftesting.zcml	(revision 11268)
@@ -0,0 +1,91 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:kofa="http://namespaces.waeup.org/kofa"
+   i18n_domain="kofacustom.nigeria"
+   package="kofacustom.nigeria"
+   >
+
+  <include package="grok" />
+  <includeOverrides package="kofacustom.nigeria" />
+  <include package="kofacustom.nigeria" file="mail.zcml" />
+
+  <!-- Where should the datacenter reside by default?
+
+       The path is relative to the `package` defined in top
+       `configure` directive.
+  -->
+  <kofa:datacenter
+      path="../../../parts/test/datacenter" />
+
+
+  <!-- Typical functional testing security setup -->
+  <securityPolicy
+      component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
+      />
+
+
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User"
+      />
+  <unauthenticatedGroup
+      id="zope.Anybody"
+      title="Unauthenticated Users"
+      />
+  <authenticatedGroup
+      id="zope.Authenticated"
+      title="Authenticated Users"
+      />
+  <everybodyGroup
+      id="zope.Everybody"
+      title="All Users"
+      />
+
+
+  <!-- grant
+      permission="zope.View"
+      principal="zope.Anybody"
+      / -->
+
+  <grant
+      permission="zope.app.dublincore.view"
+      principal="zope.Anybody" />
+  <grant
+      permission="zope.View"
+      principal="zope.Authenticated"
+      />
+  <grant
+      permission="zope.app.dublincore.view"
+      principal="zope.Authenticated"
+      />
+  <grant
+      permission="waeup.Public"
+      principal="zope.Everybody"
+      />
+  <grant
+      permission="waeup.Anonymous"
+      principal="zope.Anybody"
+      />
+
+  <principal
+      id="zope.mgr"
+      title="Manager"
+      login="mgr"
+      password="mgrpw"
+      />
+
+  <role
+      id="zope.Manager"
+      title="Site Manager"
+      />
+
+  <grantAll
+      role="zope.Manager"
+      />
+
+  <grant
+      role="zope.Manager"
+      principal="zope.mgr"
+      />
+
+</configure>
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interfaces.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interfaces.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interfaces.py	(revision 11268)
@@ -0,0 +1,92 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+
+import zope.i18nmessageid
+from zope import schema
+from zc.sourcefactory.basic import BasicSourceFactory
+from waeup.kofa.interfaces import (SimpleKofaVocabulary,
+    ISessionConfiguration, academic_sessions_vocab)
+from kofacustom.nigeria.utils.lgas import LGAS
+
+_ = MessageFactory = zope.i18nmessageid.MessageFactory('kofacustom.nigeria')
+
+high_qual = SimpleKofaVocabulary(
+    ('National Certificate of Education','nce'),
+    ('Pre Degree Programme','pre'),
+    ('Diploma Programme','dip'),
+    ('Ordinary National Diploma','ond'),
+    ('Bachelors Degree','bd'),
+    ('Masters Degree','md'),
+    ('Professional Qualification','pq'),
+    ('Other Certification','oc'),
+    ('Higher National Diploma','hnd'),
+    ('Post Graduate Diploma','pgd'),
+    ('NCE AL OTH','nce_al_oth'),
+    ('National Defence Academy','nda'),
+    ('Awaiting Results','a_rslt'),
+    ('RMC','rmc'),
+    ('Ph.D.(Doctor of Philosophy)','phd'),
+    ('M.Phil (Master of Philosophy)','mphil'),
+    )
+
+high_grade = SimpleKofaVocabulary(
+    ('Upper Credit','upper_credit'),
+    ('Distinction','distinction'),
+    ('Credit','credit'),
+    ('Merit','merit'),
+    ('Lower Credit','lower_credit'),
+    ('First Class','first_class'),
+    ('Second Class Upper','second_class_upper'),
+    ('Second Class Lower','second_class_lower'),
+    ('Third Class','third_class'),
+    ('Pass','pass'),
+    ('Awaiting Results','a_rslt'),
+    ('A Levels','al'),
+    ('Unclassified Certificate', 'uc'),
+    )
+
+exam_types = SimpleKofaVocabulary(
+    ('SSCE','ssce'),
+    ('WAEC','waec'),
+    ('GCE O\' LEVEL','gce_o_level'),
+    ('TC II','tc_ii'),
+    ('RSA','rsa'),
+    ('NABTEB','nabteb'),
+    ('NECO','neco'),
+    ('ACE','ace'),
+    ('GCE A\' LEVEL','gce_a_level'),
+    ('IGCSE','igcse'),
+    )
+
+#lgas_vocab = SimpleKofaVocabulary(
+#    *sorted([(x[1],x[0]) for x in LGAS]))
+
+class LGASource(BasicSourceFactory):
+    """A source for school subjects used in exam documentation.
+    """
+    lga_dict = dict(LGAS)
+
+    def getValues(self):
+        return sorted(self.lga_dict.keys())
+
+    def getToken(self, value):
+        return str(value)
+
+    def getTitle(self, value):
+        return self.lga_dict.get(value,
+            _('Invalid key: ${a}', mapping = {'a':value}))
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interswitch/__init__.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interswitch/__init__.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interswitch/__init__.py	(revision 11268)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interswitch/browser.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interswitch/browser.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interswitch/browser.py	(revision 11268)
@@ -0,0 +1,133 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import grok
+from waeup.kofa.browser.layout import UtilityView
+from waeup.kofa.browser.viewlets import ManageActionButton
+from waeup.kofa.students.browser import OnlinePaymentDisplayFormPage as OPDPStudent
+from waeup.kofa.applicants.browser import OnlinePaymentDisplayFormPage as OPDPApplicant
+from kofacustom.nigeria.interswitch.helpers import (
+    query_interswitch, write_payments_log)
+from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment
+from kofacustom.nigeria.students.interfaces import INigeriaStudentOnlinePayment
+from kofacustom.nigeria.applicants.interfaces import INigeriaApplicantOnlinePayment
+from kofacustom.nigeria.interfaces import MessageFactory as _
+
+class InterswitchActionButtonStudent(ManageActionButton):
+    grok.order(1)
+    grok.context(INigeriaOnlinePayment)
+    grok.view(OPDPStudent)
+    grok.require('waeup.payStudent')
+    icon = 'actionicon_pay.png'
+    text = _('CollegePAY')
+    target = 'goto_interswitch'
+
+    @property
+    def target_url(self):
+        if self.context.p_state != 'unpaid':
+            return ''
+        return self.view.url(self.view.context, self.target)
+
+class InterswitchActionButtonApplicant(InterswitchActionButtonStudent):
+    grok.view(OPDPApplicant)
+    grok.require('waeup.payApplicant')
+
+class InterswitchRequestWebserviceActionButtonStudent(ManageActionButton):
+    grok.order(2)
+    grok.context(INigeriaOnlinePayment)
+    grok.view(OPDPStudent)
+    grok.require('waeup.payStudent')
+    icon = 'actionicon_call.png'
+    text = _('Requery CollegePAY')
+    target = 'request_webservice'
+
+    @property
+    def target_url(self):
+        if self.context.p_state == 'paid':
+            return ''
+        return self.view.url(self.view.context, self.target)
+
+class InterswitchRequestWebserviceActionButtonApplicant(
+    InterswitchRequestWebserviceActionButtonStudent):
+    grok.view(OPDPApplicant)
+    grok.require('waeup.payApplicant')
+
+class InterswitchPaymentRequestWebservicePageStudent(UtilityView, grok.View):
+    """ Request webservice view for the CollegePAY gateway
+    """
+    grok.context(INigeriaStudentOnlinePayment)
+    grok.name('request_webservice')
+    grok.require('waeup.payStudent')
+
+    product_id = None
+    gateway_host = None
+    gateway_url = None
+
+    def update(self):
+        if self.context.p_state == 'paid':
+            self.flash(_('This ticket has already been paid.'))
+            return
+        student = self.context.student
+        success, msg, log = query_interswitch(
+            self.context, self.product_id, self.gateway_host, self.gateway_url)
+        student.writeLogMessage(self, log)
+        if not success:
+            self.flash(msg)
+            return
+        write_payments_log(student.student_id, self.context)
+        success, msg, log = self.context.doAfterStudentPayment()
+        if log is not None:
+            student.writeLogMessage(self, log)
+        self.flash(msg)
+        return
+
+    def render(self):
+        self.redirect(self.url(self.context, '@@index'))
+        return
+
+class InterswitchPaymentRequestWebservicePageApplicant(UtilityView, grok.View):
+    """ Request webservice view for the CollegePAY gateway
+    """
+    grok.context(INigeriaApplicantOnlinePayment)
+    grok.name('request_webservice')
+    grok.require('waeup.payApplicant')
+
+    product_id = None
+    gateway_host = None
+    gateway_url = None
+
+    def update(self):
+        if self.context.p_state == 'paid':
+            self.flash(_('This ticket has already been paid.'))
+            return
+        applicant = self.context.__parent__
+        success, msg, log = query_interswitch(
+            self.context, self.product_id, self.gateway_host, self.gateway_url)
+        applicant.writeLogMessage(self, log)
+        if not success:
+            self.flash(msg)
+            return
+        write_payments_log(applicant.applicant_id, self.context)
+        success, msg, log = self.context.doAfterApplicantPayment()
+        if log is not None:
+            applicant.writeLogMessage(self, log)
+        self.flash(msg)
+        return
+
+    def render(self):
+        self.redirect(self.url(self.context, '@@index'))
+        return
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interswitch/helpers.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interswitch/helpers.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/interswitch/helpers.py	(revision 11268)
@@ -0,0 +1,115 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""General helper functions for the interswitch module in custom packages.
+"""
+from datetime import datetime
+import httplib
+import grok
+from xml.dom.minidom import parseString
+from zope.event import notify
+from kofacustom.nigeria.interfaces import MessageFactory as _
+
+def SOAP_post(soap_action, xml, host, url):
+    """Handles making the SOAP request.
+
+    Further reading:
+    http://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryWs.asmx?op=getTransactionData
+    """
+    h = httplib.HTTPConnection(host)
+    headers={
+        'Host':host,
+        'Content-Type':'text/xml; charset=utf-8',
+        'Content-Length':len(xml),
+        'SOAPAction':'"%s"' % soap_action,
+    }
+    h.request('POST', url, body=xml,headers=headers)
+    response = h.getresponse()
+    return response
+
+def get_SOAP_response(product_id, transref, host, url):
+    xml="""\
+<?xml version="1.0" encoding="utf-8"?>
+<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+  <soap:Body>
+    <getTransactionData xmlns="http://tempuri.org/">
+      <product_id>%s</product_id>
+      <trans_ref>%s</trans_ref>
+    </getTransactionData>
+  </soap:Body>
+</soap:Envelope>""" % (product_id, transref)
+    response=SOAP_post("http://tempuri.org/getTransactionData",xml, host, url)
+    if response.status!=200:
+        return 'Connection error (%s, %s)' % (response.status, response.reason)
+    result_xml = response.read()
+    doc=parseString(result_xml)
+    response=doc.getElementsByTagName('getTransactionDataResult')[0].firstChild.data
+    return response
+
+def query_interswitch(payment, product_id, host, url):
+    sr = get_SOAP_response(product_id, payment.p_id, host, url)
+    if sr.startswith('Connection error'):
+        msg = _('Connection error')
+        log = sr
+        return False, msg, log
+    wlist = sr.split(':')
+    if len(wlist) != 7:
+        msg = _('Invalid callback: ${a}', mapping = {'a': sr})
+        log = 'invalid callback for payment %s: %s' % (payment.p_id, sr)
+        return False, msg, log
+    payment.r_code = wlist[0]
+    payment.r_desc = wlist[1]
+    payment.r_amount_approved = float(wlist[2]) / 100
+    payment.r_card_num = wlist[3]
+    payment.r_pay_reference = wlist[5]
+    payment.r_company = u'interswitch'
+    if payment.r_code != '00':
+        msg = _('Unsuccessful callback: ${a}', mapping = {'a': sr})
+        log = 'unsuccessful callback for %s payment %s: %s' % (
+            payment.p_category, payment.p_id, sr)
+        payment.p_state = 'failed'
+        notify(grok.ObjectModifiedEvent(payment))
+        return False, msg, log
+    if round(payment.r_amount_approved, 2) != round(payment.amount_auth, 2):
+        msg = _('Callback amount does not match.')
+        log = 'wrong callback for %s payment %s: %s' % (
+            payment.p_category, payment.p_id, sr)
+        payment.p_state = 'failed'
+        notify(grok.ObjectModifiedEvent(payment))
+        return False, msg, log
+    if wlist[4] != payment.p_id:
+        msg = _('Callback transaction id does not match.')
+        log = 'wrong callback for %s payment %s: %s' % (
+            payment.p_category, payment.p_id, sr)
+        payment.p_state = 'failed'
+        notify(grok.ObjectModifiedEvent(payment))
+        return False, msg, log
+    payment.p_state = 'paid'
+    payment.payment_date = datetime.utcnow()
+    msg = _('Successful callback received')
+    log = 'valid callback for %s payment %s: %s' % (
+        payment.p_category, payment.p_id, sr)
+    notify(grok.ObjectModifiedEvent(payment))
+    return True, msg, log
+
+def write_payments_log(id, payment):
+    payment.logger.info(
+        '%s,%s,%s,%s,%s,%s,%s,%s,,,' % (
+        id, payment.p_id, payment.p_category,
+        payment.amount_auth, payment.r_code,
+        payment.provider_amt, payment.gateway_amt,
+        payment.thirdparty_amt))
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/locales.zcml
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/locales.zcml	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/locales.zcml	(revision 11268)
@@ -0,0 +1,8 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:i18n="http://namespaces.zope.org/i18n">
+
+  <include package="zope.i18n" file="meta.zcml" />
+  <i18n:registerTranslations directory="locales" />
+  <include package="waeup.kofa" file="locales.zcml" />
+
+</configure>
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/locales/kofacustom.nigeria.pot
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/locales/kofacustom.nigeria.pot	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/locales/kofacustom.nigeria.pot	(revision 11268)
@@ -0,0 +1,680 @@
+##############################################################################
+#
+# Copyright (c) 2003-2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+msgid ""
+msgstr ""
+"Project-Id-Version: Development/Unknown\n"
+"POT-Creation-Date: Wed Jan  9 11:19:17 2013\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Zope 3 Developers <zope3-dev@zope.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: zope/app/locales/extract.py\n"
+
+#: kofacustom/nigeria/applicants/browser.py:73
+msgid "Download result slip"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/browser.py:74
+msgid "Download application slip"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:105
+#: kofacustom/nigeria/applicants/interfaces.py:217
+#: kofacustom/nigeria/students/interfaces.py:90
+msgid "Nationality"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:110
+#: kofacustom/nigeria/applicants/interfaces.py:222
+#: kofacustom/nigeria/students/interfaces.py:96
+msgid "State/LGA (Nigerians only)"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:118
+#: kofacustom/nigeria/applicants/interfaces.py:230
+msgid "1st Choice Course of Study"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:123
+#: kofacustom/nigeria/applicants/interfaces.py:235
+msgid "2nd Choice Course of Study"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:128
+#: kofacustom/nigeria/applicants/interfaces.py:240
+#: kofacustom/nigeria/applicants/interfaces.py:272
+#: kofacustom/nigeria/students/interfaces.py:199
+#: kofacustom/nigeria/students/interfaces.py:249
+msgid "Qualification Obtained"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:134
+#: kofacustom/nigeria/applicants/interfaces.py:246
+#: kofacustom/nigeria/students/interfaces.py:212
+#: kofacustom/nigeria/students/interfaces.py:256
+msgid "Former Matric Number"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:139
+#: kofacustom/nigeria/applicants/interfaces.py:251
+#: kofacustom/nigeria/students/interfaces.py:218
+#: kofacustom/nigeria/students/interfaces.py:262
+msgid "Class of Degree"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:145
+#: kofacustom/nigeria/applicants/interfaces.py:257
+#: kofacustom/nigeria/students/interfaces.py:225
+#: kofacustom/nigeria/students/interfaces.py:269
+msgid "Institution Attended"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:150
+#: kofacustom/nigeria/applicants/interfaces.py:262
+#: kofacustom/nigeria/students/interfaces.py:231
+#: kofacustom/nigeria/students/interfaces.py:275
+msgid "Years Attended"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:155
+#: kofacustom/nigeria/applicants/interfaces.py:267
+#: kofacustom/nigeria/students/interfaces.py:237
+#: kofacustom/nigeria/students/interfaces.py:281
+msgid "Discipline"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:160
+msgid "Subjects and Scores"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:164
+msgid "Total JAMB Score"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:168
+#: kofacustom/nigeria/applicants/interfaces.py:347
+msgid "Notice"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:172
+#: kofacustom/nigeria/applicants/interfaces.py:352
+msgid "Screening Venue"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:176
+#: kofacustom/nigeria/applicants/interfaces.py:356
+msgid "Screening Date"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:180
+#: kofacustom/nigeria/applicants/interfaces.py:360
+msgid "Screening Score (%)"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:184
+msgid "Aggregate Score (%)"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:185
+msgid "(average of relative JAMB and PUTME scores)"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:189
+msgid "Result uploaded"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:193
+#: kofacustom/nigeria/applicants/interfaces.py:364
+msgid "Student Id"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:198
+#: kofacustom/nigeria/applicants/interfaces.py:369
+msgid "Admitted Course of Study"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:203
+#: kofacustom/nigeria/applicants/interfaces.py:375
+msgid "Form locked"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:278
+msgid "If yes, name of institution"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:283
+#: kofacustom/nigeria/students/interfaces.py:287
+msgid "Nysc Year"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:289
+#: kofacustom/nigeria/students/interfaces.py:293
+msgid "Nysc Location"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:293
+#: kofacustom/nigeria/students/interfaces.py:304
+msgid "Employer"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:298
+#: kofacustom/nigeria/students/interfaces.py:310
+msgid "Employer Position"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:303
+#: kofacustom/nigeria/applicants/interfaces.py:330
+#: kofacustom/nigeria/students/interfaces.py:316
+#: kofacustom/nigeria/students/interfaces.py:348
+msgid "Start Date"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:309
+#: kofacustom/nigeria/applicants/interfaces.py:336
+#: kofacustom/nigeria/students/interfaces.py:323
+#: kofacustom/nigeria/students/interfaces.py:354
+msgid "End Date"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:315
+#: kofacustom/nigeria/applicants/interfaces.py:342
+#: kofacustom/nigeria/students/interfaces.py:330
+#: kofacustom/nigeria/students/interfaces.py:361
+msgid "Reason for Leaving"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:320
+#: kofacustom/nigeria/students/interfaces.py:336
+msgid "2nd Employer"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:325
+#: kofacustom/nigeria/students/interfaces.py:342
+msgid "2nd Employer Position"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:411
+#: kofacustom/nigeria/applicants/interfaces.py:439
+#: kofacustom/nigeria/applicants/interfaces.py:471
+msgid "Email Address"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/interfaces.py:416
+#: kofacustom/nigeria/applicants/interfaces.py:444
+#: kofacustom/nigeria/applicants/interfaces.py:476
+#: kofacustom/nigeria/students/interfaces.py:83
+msgid "Date of Birth"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/utils.py:46
+msgid "Base Data"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/utils.py:47
+msgid "Programmes/Courses Desired"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/utils.py:48
+#: kofacustom/nigeria/students/utils.py:61
+msgid "Higher Education Record"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/utils.py:49
+msgid "Course or Programme Presently Attending"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/utils.py:50
+#: kofacustom/nigeria/students/utils.py:63
+msgid "NYSC Information"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/utils.py:51
+#: kofacustom/nigeria/students/utils.py:64
+msgid "Employment History"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/utils.py:52
+msgid "JAMB Data"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/utils.py:53
+msgid "Application Process Information"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/utils.py:54
+msgid "Post Primary School Qualification"
+msgstr ""
+
+#: kofacustom/nigeria/applicants/utils.py:55
+msgid "Presently attending a course or programme"
+msgstr ""
+
+#: kofacustom/nigeria/interfaces.py:89
+#. Default: ""
+msgid "Invalid key: ${a}"
+msgstr ""
+
+#: kofacustom/nigeria/interswitch/helpers.py:103
+msgid "Successful callback received"
+msgstr ""
+
+#: kofacustom/nigeria/interswitch/helpers.py:66
+msgid "Connection error"
+msgstr ""
+
+#: kofacustom/nigeria/interswitch/helpers.py:71
+#. Default: ""
+msgid "Invalid callback: ${a}"
+msgstr ""
+
+#: kofacustom/nigeria/interswitch/helpers.py:81
+#. Default: ""
+msgid "Unsuccessful callback: ${a}"
+msgstr ""
+
+#: kofacustom/nigeria/interswitch/helpers.py:88
+msgid "Callback amount does not match."
+msgstr ""
+
+#: kofacustom/nigeria/interswitch/helpers.py:95
+msgid "Callback transaction id does not match."
+msgstr ""
+
+#: kofacustom/nigeria/payments/interfaces.py:30
+msgid "Activation Code"
+msgstr ""
+
+#: kofacustom/nigeria/payments/interfaces.py:37
+msgid "Response Amount Approved"
+msgstr ""
+
+#: kofacustom/nigeria/payments/interfaces.py:44
+msgid "Response Code"
+msgstr ""
+
+#: kofacustom/nigeria/payments/interfaces.py:51
+msgid "Response Description"
+msgstr ""
+
+#: kofacustom/nigeria/payments/interfaces.py:60
+msgid "Response Payment Reference"
+msgstr ""
+
+#: kofacustom/nigeria/payments/interfaces.py:67
+msgid "Response Card Number"
+msgstr ""
+
+#: kofacustom/nigeria/payments/interfaces.py:74
+msgid "Payment Gateway"
+msgstr ""
+
+#: kofacustom/nigeria/payments/interfaces.py:79
+msgid "Interswitch"
+msgstr ""
+
+#: kofacustom/nigeria/payments/interfaces.py:80
+msgid "eTranzact"
+msgstr ""
+
+#: kofacustom/nigeria/payments/interfaces.py:81
+msgid "Scratch Card"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:101
+msgid "Deferent of Admission"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:107
+#: kofacustom/nigeria/students/interfaces.py:140
+#: kofacustom/nigeria/students/interfaces.py:173
+#: kofacustom/nigeria/students/interfaces.py:206
+msgid "Full Name"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:112
+#: kofacustom/nigeria/students/interfaces.py:145
+#: kofacustom/nigeria/students/interfaces.py:178
+msgid "Exam Number"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:118
+#: kofacustom/nigeria/students/interfaces.py:151
+#: kofacustom/nigeria/students/interfaces.py:184
+msgid "Exam Date"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:125
+#: kofacustom/nigeria/students/interfaces.py:158
+msgid "Exam Type"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:132
+#: kofacustom/nigeria/students/interfaces.py:165
+#: kofacustom/nigeria/students/interfaces.py:191
+msgid "Exam Results"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:299
+msgid "Nysc LGA"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:367
+msgid "If yes, matric number"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:380
+#: kofacustom/nigeria/students/interfaces.py:450
+msgid "Next of Kin Name"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:386
+#: kofacustom/nigeria/students/interfaces.py:456
+msgid "Next of Kin Relationship"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:392
+#: kofacustom/nigeria/students/interfaces.py:462
+msgid "Next of Kin Address"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:398
+#: kofacustom/nigeria/students/interfaces.py:468
+msgid "Next of Kin Phone"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:409
+msgid "Unmarried"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:410
+msgid "Married"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:418
+msgid "Muslim"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:419
+msgid "Christian"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:420
+msgid "Others"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:421
+msgid "Prefer not to say"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:44
+#: kofacustom/nigeria/students/interfaces.py:526
+msgid "Registration Number"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:445
+msgid "Permanent Address"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:503
+msgid "Current Session Payment"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:509
+msgid "Payment Level"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:51
+msgid "Staff Member"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:535
+msgid "Matriculation Number"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:66
+msgid "Officer's Comment"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:71
+msgid "Clearance form locked"
+msgstr ""
+
+#: kofacustom/nigeria/students/interfaces.py:77
+msgid "CLR Activation Code"
+msgstr ""
+
+#: kofacustom/nigeria/students/utils.py:58
+msgid "First Sitting Record"
+msgstr ""
+
+#: kofacustom/nigeria/students/utils.py:59
+msgid "Second Sitting Record"
+msgstr ""
+
+#: kofacustom/nigeria/students/utils.py:60
+msgid "Advanced Level Record"
+msgstr ""
+
+#: kofacustom/nigeria/students/utils.py:62
+msgid "Second Higher Education Record"
+msgstr ""
+
+#: kofacustom/nigeria/students/utils.py:65
+msgid "Former Student"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:101
+msgid "First Sitting Result Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:117
+#: kofacustom/nigeria/students/viewlets.py:118
+#: kofacustom/nigeria/students/viewlets.py:128
+msgid "Second Sitting Result"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:129
+msgid "Second Sitting Result Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:145
+#: kofacustom/nigeria/students/viewlets.py:146
+#: kofacustom/nigeria/students/viewlets.py:156
+msgid "Higher Qualification Result"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:157
+msgid "Higher Qualification Result Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:173
+#: kofacustom/nigeria/students/viewlets.py:174
+#: kofacustom/nigeria/students/viewlets.py:184
+msgid "Second Higher Qualification Result"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:185
+msgid "Second Higher Qualification Result Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:208
+#: kofacustom/nigeria/students/viewlets.py:209
+#: kofacustom/nigeria/students/viewlets.py:219
+msgid "Advanced Level Result"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:220
+msgid "Advanced Level Result Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:236
+#: kofacustom/nigeria/students/viewlets.py:237
+#: kofacustom/nigeria/students/viewlets.py:247
+msgid "Certificate"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:248
+msgid "Certificate Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:264
+#: kofacustom/nigeria/students/viewlets.py:265
+#: kofacustom/nigeria/students/viewlets.py:275
+msgid "Second Certificate"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:276
+msgid "Second Certificate Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:299
+#: kofacustom/nigeria/students/viewlets.py:300
+#: kofacustom/nigeria/students/viewlets.py:310
+msgid "Third Certificate"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:311
+msgid "Third Certificate Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:32
+#: kofacustom/nigeria/students/viewlets.py:43
+msgid "Acceptance Letter"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:33
+#: kofacustom/nigeria/students/viewlets.py:44
+msgid "Acceptance Letter Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:334
+#: kofacustom/nigeria/students/viewlets.py:335
+#: kofacustom/nigeria/students/viewlets.py:345
+msgid "Evidence of Name"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:346
+msgid "Evidence of Name Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:362
+#: kofacustom/nigeria/students/viewlets.py:363
+#: kofacustom/nigeria/students/viewlets.py:373
+msgid "Result Statement"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:374
+msgid "Result Statement Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:390
+#: kofacustom/nigeria/students/viewlets.py:391
+#: kofacustom/nigeria/students/viewlets.py:401
+msgid "Guarantor/Referee Letter"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:402
+msgid "Guarantor/Referee Letter Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:418
+#: kofacustom/nigeria/students/viewlets.py:419
+#: kofacustom/nigeria/students/viewlets.py:429
+msgid "Second Referee Letter"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:430
+msgid "Second Referee Letter Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:453
+#: kofacustom/nigeria/students/viewlets.py:454
+#: kofacustom/nigeria/students/viewlets.py:464
+msgid "Third Referee Letter"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:465
+msgid "Third Referee Letter Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:488
+#: kofacustom/nigeria/students/viewlets.py:489
+#: kofacustom/nigeria/students/viewlets.py:499
+msgid "Affidavit of Good Conduct"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:500
+msgid "Affidavit of Good Conduct Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:516
+#: kofacustom/nigeria/students/viewlets.py:517
+#: kofacustom/nigeria/students/viewlets.py:527
+msgid "Letter of Admission"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:528
+msgid "Letter of Admission Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:61
+#: kofacustom/nigeria/students/viewlets.py:72
+msgid "LGA Identification"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:62
+#: kofacustom/nigeria/students/viewlets.py:73
+msgid "LGA Identification Scan"
+msgstr ""
+
+#: kofacustom/nigeria/students/viewlets.py:89
+#: kofacustom/nigeria/students/viewlets.py:90
+#: kofacustom/nigeria/students/viewlets.py:100
+msgid "First Sitting Result"
+msgstr ""
+
+#: kofacustom/nigeria/utils/utils.py:26
+msgid "Nigeria"
+msgstr ""
+
+#: kofacustom/nigeria/utils/utils.py:27
+msgid "Germany"
+msgstr ""
+
+#: kofacustom/nigeria/utils/utils.py:28
+msgid "United States"
+msgstr ""
+
+#: kofacustom/nigeria/utils/utils.py:29
+msgid "Niger"
+msgstr ""
+
+#: kofacustom/nigeria/utils/utils.py:30
+msgid "Benin"
+msgstr ""
+
+#: kofacustom/nigeria/utils/utils.py:31
+msgid "Cameroon"
+msgstr ""
+
+#: kofacustom/nigeria/utils/utils.py:32
+msgid "United Kingdom"
+msgstr ""
+
+#: kofacustom/nigeria/utils/utils.py:33
+msgid "France"
+msgstr ""
+
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/mail.zcml
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/mail.zcml	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/mail.zcml	(revision 11268)
@@ -0,0 +1,82 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:mail="http://namespaces.zope.org/mail">
+  <!--
+
+   SMTP Settings
+   *************
+
+   In here we define the mailers and mail deliveries we want to be
+   used by the portal.
+
+   They are set here (and not dynamically in the portal) to increase
+   security. Even portal users with all permissions cannot change mail
+   server credentials and related. You need filesystem access to
+   change/override the settings in here.
+
+   In the portal you can pick one of the deliveries for use with all
+   SMTP (aka mail) related functionality.
+
+   Each delivery (direct or queued) is bound to a certain mailer,
+   defined by a 'mail:smtpMailer' directive.
+
+   The smtpMailer directives define real mail hosts (local or remote)
+   where mail from the portal should be processed.
+
+   The 'mail:directDelivery' and 'mail:queuedDelivery' directives send
+   local mail to the mailer set in their 'mailer' attribute. While
+   directDelivery sends mail immediately when a request is finished
+   (see zope.sendmail for more info), queuedDelivery handles mail in a
+   background thread and sends mail independently from requests.
+
+   By default in KOFA we have a fake mailer activated, that does not
+   send real mail to the outside world.
+  -->
+
+  <!-- A mail server on localhost -->
+  <!-- Mail server definitions require the following attributes:
+
+        - name: (string) name to be used by deliveries
+
+       Mail server definitions allow the following additional attribs:
+
+        - hostname   (string) hostname or IP(?) of mail server to use
+                              ('localhost' by default)
+        - port       (int number) port to connect to SMTP mailer
+                              (25 by default)
+        - username   (string) Username to log in to mail server
+        - password   (string) Password to log in to mail server
+
+  -->
+  <mail:smtpMailer
+      name="smtp.localhost"
+      hostname="localhost"
+      port="25"
+      />
+
+  <!-- The mail deliveries -->
+  <!-- Mail deliveries require the following attributes:
+
+        - name:       (string) this string will appear in portal select
+                               boxes
+        - permission: (string) zope default perms only
+        - mailer:     (string) name of some mailer registered above or
+                               'smtp'
+        - queuePath:  (string) must exist and contain cur/, new/, and
+                               tmp/ dirs. Relative paths are relative
+                               to the directory this files lives in.
+
+   -->
+  <mail:queuedDelivery
+      name="Queued SMTP on localhost"
+      permission="zope.Public"
+      mailer="smtp.localhost"
+      queuePath="../../../var/mailqueue"
+      />
+
+  <mail:directDelivery
+      name="Direct SMTP on localhost"
+      permission="zope.Public"
+      mailer="smtp.localhost"
+      />
+
+</configure>
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/payments/__init__.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/payments/__init__.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/payments/__init__.py	(revision 11268)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/payments/interfaces.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/payments/interfaces.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/payments/interfaces.py	(revision 11268)
@@ -0,0 +1,104 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+from zope.interface import Attribute
+from zope import schema
+from waeup.kofa.interfaces import SimpleKofaVocabulary
+from waeup.kofa.payments.interfaces import IPayment
+from kofacustom.nigeria.interfaces import MessageFactory as _
+
+class INigeriaOnlinePayment(IPayment):
+    """A payment via payment gateways.
+
+    """
+
+    ac = schema.TextLine(
+        title = _(u'Activation Code'),
+        default = None,
+        required = False,
+        readonly = False,
+        )
+
+    r_amount_approved = schema.Float(
+        title = _(u'Response Amount Approved'),
+        default = 0.0,
+        required = False,
+        readonly = False,
+        )
+
+    r_code = schema.TextLine(
+        title = _(u'Response Code'),
+        default = None,
+        required = False,
+        readonly = False,
+        )
+
+    r_desc = schema.TextLine(
+        title = _(u'Response Description'),
+        default = None,
+        required = False,
+        readonly = False,
+        )
+
+    # Only defined in kofacustom.nigeria package
+
+    r_pay_reference = schema.TextLine(
+        title = _(u'Response Payment Reference'),
+        default = None,
+        required = False,
+        readonly = False,
+        )
+
+    r_card_num = schema.TextLine(
+        title = _(u'Response Card Number'),
+        default = None,
+        required = False,
+        readonly = False,
+        )
+
+    r_company = schema.Choice(
+        title = _(u'Payment Gateway'),
+        default = None,
+        required = False,
+        readonly = False,
+        vocabulary = SimpleKofaVocabulary(
+            (_('Interswitch'), 'interswitch'),
+            (_('eTranzact'), 'etranzact'),
+            (_('Scratch Card'), 'sc'),)
+        )
+
+    provider_amt = schema.Float(
+        title = _(u'BT Amount'),
+        default = 0.0,
+        required = False,
+        readonly = False,
+        )
+
+    gateway_amt = schema.Float(
+        title = _(u'Gateway Amount'),
+        default = 0.0,
+        required = False,
+        readonly = False,
+        )
+
+    thirdparty_amt = schema.Float(
+        title = _(u'Third Party Amount'),
+        default = 0.0,
+        required = False,
+        readonly = False,
+        )
+
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/__init__.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/__init__.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/__init__.py	(revision 11268)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/batching.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/batching.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/batching.py	(revision 11268)
@@ -0,0 +1,37 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Batch processing components for student objects.
+
+Batch processors eat CSV files to add, update or remove large numbers
+of certain kinds of objects at once.
+
+Here we define the processors for students specific objects like
+students, studycourses, payment tickets and accommodation tickets.
+"""
+from kofacustom.nigeria.students.interfaces import (
+    INigeriaStudent, INigeriaStudentUpdateByRegNo,
+    INigeriaStudentUpdateByMatricNo
+    )
+from waeup.kofa.students.batching import StudentProcessor
+
+class NigeriaStudentProcessor(StudentProcessor):
+    """A batch processor for IStudent objects.
+    """
+    iface = INigeriaStudent
+    iface_byregnumber = INigeriaStudentUpdateByRegNo
+    iface_bymatricnumber = INigeriaStudentUpdateByMatricNo
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/browser.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/browser.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/browser.py	(revision 11268)
@@ -0,0 +1,244 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import grok
+from zope.formlib.textwidgets import BytesDisplayWidget
+from zope.component import getUtility
+from zope.i18n import translate
+from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
+from waeup.kofa.interfaces import IExtFileStore
+from waeup.kofa.browser.layout import action
+from waeup.kofa.students.browser import (
+    StudentPersonalDisplayFormPage, StudentPersonalManageFormPage,
+    StudentClearanceManageFormPage, StudentClearanceEditFormPage,
+    StudentClearanceDisplayFormPage, OnlinePaymentFakeApprovePage,
+    ExportPDFClearanceSlipPage, StudentBaseManageFormPage,
+    StudentBaseDisplayFormPage,
+    StudentBaseEditFormPage, StudentPersonalEditFormPage,
+    OnlinePaymentDisplayFormPage, OnlinePaymentAddFormPage,
+    OnlinePaymentBreadcrumb, ExportPDFPaymentSlipPage,
+    ExportPDFCourseRegistrationSlipPage,
+    ExportPDFBedTicketSlipPage,
+    StudentFilesUploadPage, emit_lock_message)
+from waeup.kofa.students.interfaces import IStudentsUtils
+from waeup.kofa.students.viewlets import (
+    PaymentReceiptActionButton, StudentPassportActionButton)
+from kofacustom.nigeria.students.interfaces import (
+    INigeriaStudentBase, INigeriaStudent, INigeriaStudentPersonal,
+    INigeriaStudentPersonalEdit,
+    INigeriaUGStudentClearance,INigeriaPGStudentClearance,
+    INigeriaStudentOnlinePayment
+    )
+from waeup.kofa.students.workflow import ADMITTED
+from kofacustom.nigeria.interfaces import MessageFactory as _
+
+class NigeriaOnlinePaymentBreadcrumb(OnlinePaymentBreadcrumb):
+    """A breadcrumb for payments.
+    """
+    grok.context(INigeriaStudentOnlinePayment)
+
+class PaymentReceiptActionButton(PaymentReceiptActionButton):
+    grok.order(4)
+    grok.context(INigeriaStudentOnlinePayment)
+
+class NigeriaStudentBaseDisplayFormPage(StudentBaseDisplayFormPage):
+    """ Page to display student base data
+    """
+    form_fields = grok.AutoFields(INigeriaStudentBase).omit(
+        'password', 'suspended', 'suspended_comment')
+
+class NigeriaStudentBaseManageFormPage(StudentBaseManageFormPage):
+    """ View to manage student base data
+    """
+    form_fields = grok.AutoFields(INigeriaStudentBase).omit(
+        'student_id', 'adm_code', 'suspended')
+
+class NigeriaStudentBaseEditFormPage(StudentBaseEditFormPage):
+    """ View to edit student base data
+    """
+    form_fields = grok.AutoFields(INigeriaStudentBase).select(
+        'email', 'phone')
+
+class NigeriaStudentPersonalDisplayFormPage(StudentPersonalDisplayFormPage):
+    """ Page to display student personal data
+    """
+    form_fields = grok.AutoFields(INigeriaStudentPersonal)
+    form_fields['perm_address'].custom_widget = BytesDisplayWidget
+    form_fields['next_kin_address'].custom_widget = BytesDisplayWidget
+    form_fields[
+        'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+
+class NigeriaStudentPersonalEditFormPage(StudentPersonalEditFormPage):
+    """ Page to edit personal data
+    """
+    form_fields = grok.AutoFields(INigeriaStudentPersonalEdit).omit('personal_updated')
+
+class NigeriaStudentPersonalManageFormPage(StudentPersonalManageFormPage):
+    """ Page to edit personal data
+    """
+    form_fields = grok.AutoFields(INigeriaStudentPersonal)
+    form_fields['personal_updated'].for_display = True
+    form_fields[
+        'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+
+class NigeriaStudentClearanceDisplayFormPage(StudentClearanceDisplayFormPage):
+    """ Page to display student clearance data
+    """
+
+    @property
+    def form_fields(self):
+        if self.context.is_postgrad:
+            form_fields = grok.AutoFields(
+                INigeriaPGStudentClearance).omit('clearance_locked')
+        else:
+            form_fields = grok.AutoFields(
+                INigeriaUGStudentClearance).omit('clearance_locked')
+        if not getattr(self.context, 'officer_comment'):
+            form_fields = form_fields.omit('officer_comment')
+        else:
+            form_fields['officer_comment'].custom_widget = BytesDisplayWidget
+        return form_fields
+
+class NigeriaExportPDFClearanceSlipPage(ExportPDFClearanceSlipPage):
+    """Deliver a PDF slip of the context.
+    """
+    omit_fields = ('password', 'suspended', 'suspended_comment',
+        'phone', 'adm_code', 'email', 'date_of_birth')
+
+    @property
+    def form_fields(self):
+        if self.context.is_postgrad:
+            form_fields = grok.AutoFields(
+                INigeriaPGStudentClearance).omit('clearance_locked')
+        else:
+            form_fields = grok.AutoFields(
+                INigeriaUGStudentClearance).omit('clearance_locked')
+        if not getattr(self.context, 'officer_comment'):
+            form_fields = form_fields.omit('officer_comment')
+        return form_fields
+
+class NigeriaStudentClearanceManageFormPage(StudentClearanceManageFormPage):
+    """ Page to edit student clearance data
+    """
+
+    @property
+    def form_fields(self):
+        if self.context.is_postgrad:
+            form_fields = grok.AutoFields(
+                INigeriaPGStudentClearance).omit('clr_code')
+        else:
+            form_fields = grok.AutoFields(
+                INigeriaUGStudentClearance).omit('clr_code')
+        return form_fields
+
+class NigeriaStudentClearanceEditFormPage(StudentClearanceEditFormPage):
+    """ View to edit student clearance data by student
+    """
+
+    @property
+    def form_fields(self):
+        if self.context.is_postgrad:
+            form_fields = grok.AutoFields(INigeriaPGStudentClearance).omit(
+            'clearance_locked', 'nysc_location', 'clr_code', 'officer_comment')
+        else:
+            form_fields = grok.AutoFields(INigeriaUGStudentClearance).omit(
+            'clearance_locked', 'clr_code', 'officer_comment')
+        return form_fields
+
+class NigeriaExportPDFCourseRegistrationSlipPage(ExportPDFCourseRegistrationSlipPage):
+    """Deliver a PDF slip of the context.
+    """
+    omit_fields = ('password', 'suspended', 'suspended_comment',
+        'phone', 'adm_code', 'sex', 'email', 'date_of_birth')
+
+class NigeriaOnlinePaymentDisplayFormPage(OnlinePaymentDisplayFormPage):
+    """ Page to view an online payment ticket
+    """
+    grok.context(INigeriaStudentOnlinePayment)
+    form_fields = grok.AutoFields(INigeriaStudentOnlinePayment).omit(
+        'provider_amt', 'gateway_amt', 'thirdparty_amt', 'p_item')
+    form_fields[
+        'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+    form_fields[
+        'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+
+class NigeriaOnlinePaymentAddFormPage(OnlinePaymentAddFormPage):
+    """ Page to add an online payment ticket
+    """
+    form_fields = grok.AutoFields(INigeriaStudentOnlinePayment).select(
+        'p_category')
+
+class NigeriaOnlinePaymentFakeApprovePage(OnlinePaymentFakeApprovePage):
+    """ Disable payment approval view for students.
+
+    This view is used for browser tests only and
+    has to be neutralized here!
+    """
+    grok.name('fake_approve')
+    grok.require('waeup.managePortal')
+
+    def update(self):
+        return
+
+class NigeriaExportPDFPaymentSlipPage(ExportPDFPaymentSlipPage):
+    """Deliver a PDF slip of the context.
+    """
+    grok.context(INigeriaStudentOnlinePayment)
+    form_fields = grok.AutoFields(INigeriaStudentOnlinePayment).omit(
+        'provider_amt', 'gateway_amt', 'thirdparty_amt', 'p_item')
+    form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+    form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+    omit_fields = ('password', 'suspended', 'suspended_comment', 'phone',
+        'adm_code', 'sex', 'email', 'date_of_birth')
+
+class NigeriaExportPDFBedTicketSlipPage(ExportPDFBedTicketSlipPage):
+    """Deliver a PDF slip of the context.
+    """
+    omit_fields = ('password', 'suspended', 'suspended_comment',
+        'phone', 'adm_code', 'email', 'date_of_birth')
+
+class StudentPassportActionButton(StudentPassportActionButton):
+
+    @property
+    def target_url(self):
+        # Passport pictures must not be editable if application slip
+        # exists.
+        slip = getUtility(IExtFileStore).getFileByContext(
+            self.context, 'application_slip')
+        PWCHANGE_STATES = getUtility(IStudentsUtils).PWCHANGE_STATES
+        if self.context.state not in PWCHANGE_STATES or slip is not None:
+            return ''
+        return self.view.url(self.view.context, self.target)
+
+class NigeriaStudentFilesUploadPage(StudentFilesUploadPage):
+    """ View to upload passport picture.
+
+    Students are not allowed to change the picture if they
+    passed the regular Kofa application.
+    """
+
+    def update(self):
+        # Passport pictures must not be editable if application slip
+        # exists.
+        slip = getUtility(IExtFileStore).getFileByContext(
+            self.context, 'application_slip')
+        PWCHANGE_STATES = getUtility(IStudentsUtils).PWCHANGE_STATES
+        if self.context.state not in PWCHANGE_STATES or slip is not None:
+            emit_lock_message(self)
+            return
+        super(StudentFilesUploadPage, self).update()
+        return
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/export.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/export.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/export.py	(revision 11268)
@@ -0,0 +1,71 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Exporters for student related stuff.
+"""
+from kofacustom.nigeria.students.interfaces import (
+    INigeriaStudent, INigeriaStudentStudyCourse, INigeriaCourseTicket,
+    INigeriaStudentOnlinePayment)
+from waeup.kofa.students.export import (
+    StudentsExporter, StudentStudyCourseExporter, CourseTicketExporter,
+    StudentPaymentsExporter)
+from waeup.kofa.utils.helpers import iface_names
+
+class NigeriaStudentsExporter(StudentsExporter):
+    """Exporter for Students.
+    """
+
+    #: Fieldnames considered by this exporter
+    fields = tuple(sorted(iface_names(
+        INigeriaStudent, omit=['loggerInfo']))) + (
+        'password', 'state', 'history', 'certcode', 'is_postgrad',
+        'current_level', 'current_session')
+
+    def mangle_value(self, value, name, context=None):
+        if '_result' in name and value:
+            value = [eval(entry.to_string()) for entry in value]
+        return super(
+            NigeriaStudentsExporter, self).mangle_value(
+            value, name, context=context)
+
+class NigeriaStudentStudyCourseExporter(StudentStudyCourseExporter):
+    """Exporter for StudentStudyCourses.
+    """
+
+    #: Fieldnames considered by this exporter
+    fields = tuple(
+        sorted(iface_names(INigeriaStudentStudyCourse))) + ('student_id',)
+
+
+class NigeriaCourseTicketExporter(CourseTicketExporter):
+    """Exporter for CourseTickets.
+    """
+
+    #: Fieldnames considered by this exporter
+    fields = tuple(sorted(iface_names(INigeriaCourseTicket) +
+        ['level', 'code', 'level_session'])) + ('student_id', 'certcode')
+
+class NigeriaStudentPaymentsExporter(StudentPaymentsExporter):
+    """Exporter for OnlinePayment instances.
+    """
+
+    #: Fieldnames considered by this exporter
+    fields = tuple(
+        sorted(iface_names(
+            INigeriaStudentOnlinePayment, exclude_attribs=False,
+            omit=['display_item']))) + (
+            'student_id','state','current_session')
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/interfaces.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/interfaces.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/interfaces.py	(revision 11268)
@@ -0,0 +1,537 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+from zope import schema
+from zope.interface import Attribute
+from waeup.kofa.schema import TextLineChoice
+from waeup.kofa.interfaces import SimpleKofaVocabulary, academic_sessions_vocab
+from waeup.kofa.schema import FormattedDate, PhoneNumber
+from waeup.kofa.schoolgrades import ResultEntryField
+from waeup.kofa.students.vocabularies import nats_vocab
+from waeup.kofa.students.interfaces import (
+    IStudentBase, IUGStudentClearance, IPGStudentClearance,
+    IStudentPersonal, IStudentNavigation, IStudentStudyLevel,
+    IStudentStudyCourse, ICourseTicket
+    )
+from waeup.kofa.students.vocabularies import (
+    nats_vocab, contextual_reg_num_source)
+from kofacustom.nigeria.interfaces import (
+    high_qual, high_grade, exam_types, LGASource)
+from kofacustom.nigeria.interfaces import MessageFactory as _
+from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment
+
+
+class INigeriaStudentBase(IStudentBase):
+    """Representation of student base data.
+
+    """
+
+    reg_number = TextLineChoice(
+        title = _(u'Registration Number'),
+        required = False,
+        readonly = False,
+        source = contextual_reg_num_source,
+        )
+
+    is_staff = schema.Bool(
+        title = _(u'Staff Member'),
+        required = False,
+        readonly = False,
+        default = False,
+        )
+
+INigeriaStudentBase['reg_number'].order = IStudentBase[
+    'reg_number'].order
+
+
+class INigeriaUGStudentClearance(IUGStudentClearance):
+    """Representation of ug student clearance data.
+
+    """
+    officer_comment = schema.Text(
+        title = _(u"Officer's Comment"),
+        required = False,
+        )
+
+    clearance_locked = schema.Bool(
+        title = _(u'Clearance form locked'),
+        default = False,
+        required = False,
+        )
+
+    clr_code = schema.TextLine(
+        title = _(u'CLR Activation Code'),
+        required = False,
+        readonly = False,
+        )
+
+    date_of_birth = FormattedDate(
+        title = _(u'Date of Birth'),
+        required = False,
+        show_year = True,
+        )
+
+    nationality = schema.Choice(
+        source = nats_vocab,
+        title = _(u'Nationality'),
+        required = True,
+        )
+
+    lga = schema.Choice(
+        source = LGASource(),
+        title = _(u'State / LGA'),
+        required = False,
+        )
+
+    def_adm = schema.Bool(
+        title = _(u'Deferent of Admission'),
+        required = False,
+        readonly = False,
+        )
+
+    fst_sit_fname = schema.TextLine(
+        title = _(u'Full Name'),
+        required = False,
+        readonly = False,
+        )
+    fst_sit_no = schema.TextLine(
+        title = _(u'Exam Number'),
+        required = False,
+        readonly = False,
+        )
+
+    fst_sit_date = FormattedDate(
+        title = _(u'Exam Date'),
+        required = False,
+        readonly = False,
+        show_year = True,
+        )
+
+    fst_sit_type = schema.Choice(
+        title = _(u'Exam Type'),
+        required = False,
+        readonly = False,
+        vocabulary = exam_types,
+        )
+
+    fst_sit_results = schema.List(
+        title = _(u'Exam Results'),
+        value_type = ResultEntryField(),
+        required = False,
+        readonly = False,
+        default = [],
+        )
+
+    scd_sit_fname = schema.TextLine(
+        title = _(u'Full Name'),
+        required = False,
+        readonly = False,
+        )
+    scd_sit_no = schema.TextLine(
+        title = _(u'Exam Number'),
+        required = False,
+        readonly = False,
+        )
+
+    scd_sit_date = FormattedDate(
+        title = _(u'Exam Date'),
+        required = False,
+        readonly = False,
+        show_year = True,
+        )
+
+    scd_sit_type = schema.Choice(
+        title = _(u'Exam Type'),
+        required = False,
+        readonly = False,
+        vocabulary = exam_types,
+        )
+
+    scd_sit_results = schema.List(
+        title = _(u'Exam Results'),
+        value_type = ResultEntryField(),
+        required = False,
+        readonly = False,
+        default = [],
+        )
+
+    alr_fname = schema.TextLine(
+        title = _(u'Full Name'),
+        required = False,
+        readonly = False,
+        )
+    alr_no = schema.TextLine(
+        title = _(u'Exam Number'),
+        required = False,
+        readonly = False,
+        )
+
+    alr_date = FormattedDate(
+        title = _(u'Exam Date'),
+        required = False,
+        readonly = False,
+        show_year = True,
+        )
+
+    alr_results = schema.List(
+        title = _(u'Exam Results'),
+        value_type = ResultEntryField(),
+        required = False,
+        readonly = False,
+        default = [],
+        )
+
+    hq_type = schema.Choice(
+        title = _(u'Qualification Obtained'),
+        required = False,
+        readonly = False,
+        vocabulary = high_qual,
+        )
+
+    hq_fname = schema.TextLine(
+        title = _(u'Full Name'),
+        required = False,
+        readonly = False,
+        )
+
+    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,
+        )
+
+
+class INigeriaPGStudentClearance(INigeriaUGStudentClearance):
+    """Representation of pg student clearance data.
+
+    """
+
+    hq2_type = schema.Choice(
+        title = _(u'Qualification Obtained'),
+        required = False,
+        readonly = False,
+        vocabulary = high_qual,
+        )
+
+    hq2_matric_no = schema.TextLine(
+        title = _(u'Former Matric Number'),
+        required = False,
+        readonly = False,
+        )
+
+    hq2_degree = schema.Choice(
+        title = _(u'Class of Degree'),
+        required = False,
+        readonly = False,
+        vocabulary = high_grade,
+        )
+
+    hq2_school = schema.TextLine(
+        title = _(u'Institution Attended'),
+        required = False,
+        readonly = False,
+        )
+
+    hq2_session = schema.TextLine(
+        title = _(u'Years Attended'),
+        required = False,
+        readonly = False,
+        )
+
+    hq2_disc = schema.TextLine(
+        title = _(u'Discipline'),
+        required = False,
+        readonly = False,
+        )
+
+    nysc_year = schema.Int(
+        title = _(u'Nysc Year'),
+        required = False,
+        readonly = False,
+        )
+
+    nysc_location = schema.TextLine(
+        title = _(u'Nysc Location'),
+        required = False,
+        )
+
+    nysc_lga = schema.Choice(
+        source = LGASource(),
+        title = _(u'Nysc LGA'),
+        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,
+        )
+
+    former_matric = schema.TextLine(
+        title = _(u'If yes, matric number'),
+        required = False,
+        readonly = False,
+        )
+
+class INigeriaStudentPersonal(IStudentPersonal):
+    """Student personal data.
+
+    """
+
+    is_foreigner = Attribute('True if student is non-Nigerian')
+
+    next_kin_name = schema.TextLine(
+        title = _(u'Next of Kin Name'),
+        required = False,
+        readonly = False,
+        )
+
+    next_kin_relation = schema.TextLine(
+        title = _(u'Next of Kin Relationship'),
+        required = False,
+        readonly = False,
+        )
+
+    next_kin_address = schema.Text(
+        title = _(u'Next of Kin Address'),
+        required = False,
+        readonly = False,
+        )
+
+    next_kin_phone = PhoneNumber(
+        title = _(u'Next of Kin Phone'),
+        description = u'',
+        required = False,
+        readonly = False,
+        )
+
+    marit_stat = schema.Choice(
+        title = u'Maritual Status',
+        default = 'unmarried',
+        required = False,
+        vocabulary = SimpleKofaVocabulary(
+            (_('Unmarried'), 'unmarried'),
+            (_('Married'), 'married'),)
+        )
+
+    religion = schema.Choice(
+        title = u'Religion',
+        default = 'no_say',
+        required = False,
+        vocabulary = SimpleKofaVocabulary(
+            (_('Muslim'), 'muslim'),
+            (_('Christian'), 'christian'),
+            (_('Others'), 'others'),
+            (_('Prefer not to say'), 'no_say'),)
+        )
+
+    disabled = schema.Bool(
+        title = u'Disabled',
+        default = False,
+        required = False,
+        )
+
+
+class INigeriaStudent(INigeriaStudentBase,INigeriaUGStudentClearance,
+    INigeriaPGStudentClearance,INigeriaStudentPersonal):
+    """Representation of a student.
+
+    """
+
+class INigeriaStudentPersonalEdit(INigeriaStudentPersonal):
+    """Interface for editing personal data by students.
+
+    Here we can repeat the fields from IStudentPersonal and set the
+    `required` if necessary.
+    """
+
+    perm_address = schema.Text(
+        title = _(u'Permanent Address'),
+        required = True,
+        )
+
+    next_kin_name = schema.TextLine(
+        title = _(u'Next of Kin Name'),
+        required = True,
+        readonly = False,
+        )
+
+    next_kin_relation = schema.TextLine(
+        title = _(u'Next of Kin Relationship'),
+        required = True,
+        readonly = False,
+        )
+
+    next_kin_address = schema.Text(
+        title = _(u'Next of Kin Address'),
+        required = True,
+        readonly = False,
+        )
+
+    next_kin_phone = PhoneNumber(
+        title = _(u'Next of Kin Phone'),
+        description = u'',
+        required = True,
+        readonly = False,
+        )
+
+INigeriaStudentPersonalEdit['perm_address'].order = INigeriaStudentPersonal[
+    'perm_address'].order
+INigeriaStudentPersonalEdit['next_kin_name'].order = INigeriaStudentPersonal[
+    'next_kin_name'].order
+INigeriaStudentPersonalEdit['next_kin_relation'].order = INigeriaStudentPersonal[
+    'next_kin_relation'].order
+INigeriaStudentPersonalEdit['next_kin_address'].order = INigeriaStudentPersonal[
+    'next_kin_address'].order
+INigeriaStudentPersonalEdit['next_kin_phone'].order = INigeriaStudentPersonal[
+    'next_kin_phone'].order
+
+class INigeriaStudentStudyCourse(IStudentStudyCourse):
+    """A container for student study levels.
+
+    """
+
+class INigeriaStudentStudyLevel(IStudentStudyLevel):
+    """A container for course tickets.
+
+    """
+
+class INigeriaStudentOnlinePayment(INigeriaOnlinePayment):
+    """A student payment via payment gateways.
+
+    This Interface does not inherit from IStudentOnlinePayment.
+    Thus all fields from IStudentOnlinePayment have to be repeated here.
+    """
+
+    p_current = schema.Bool(
+        title = _(u'Current Session Payment'),
+        default = True,
+        required = False,
+        )
+
+    p_level = schema.Int(
+        title = _(u'Payment Level'),
+        required = False,
+        )
+
+INigeriaStudentOnlinePayment['p_level'].order = INigeriaStudentOnlinePayment[
+    'p_session'].order
+
+class INigeriaCourseTicket(ICourseTicket):
+    """A course ticket.
+
+    """
+
+class INigeriaStudentUpdateByRegNo(INigeriaStudent):
+    """Representation of a student. Skip regular reg_number validation.
+
+    """
+    reg_number = schema.TextLine(
+        title = _(u'Registration Number'),
+        required = False,
+        )
+
+class INigeriaStudentUpdateByMatricNo(INigeriaStudent):
+    """Representation of a student. Skip regular matric_number validation.
+
+    """
+    matric_number = schema.TextLine(
+        title = _(u'Matriculation Number'),
+        required = False,
+        )
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/payments.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/payments.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/payments.py	(revision 11268)
@@ -0,0 +1,59 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Student payment components.
+"""
+import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
+from waeup.kofa.students.interfaces import IStudentNavigation
+from waeup.kofa.students.payments import (
+    StudentOnlinePayment, StudentOnlinePaymentFactory)
+from waeup.kofa.utils.helpers import attrs_to_fields
+from kofacustom.nigeria.students.interfaces import INigeriaStudentOnlinePayment
+
+class NigeriaStudentOnlinePayment(StudentOnlinePayment):
+    """This is a custom online payment for students.
+
+    Since this class inherits from StudentOnlinePayment, it automatically
+    implements the interfaces of the parent class which means
+    all viewlets and views meant for StudentOnlinePayment
+    can also be accessed in the customized system.
+    """
+    grok.implements(INigeriaStudentOnlinePayment, IStudentNavigation)
+    grok.provides(INigeriaStudentOnlinePayment)
+
+    def __init__(self):
+        super(NigeriaStudentOnlinePayment, self).__init__()
+        return
+
+    @property
+    def student(self):
+        return self.__parent__.__parent__
+
+NigeriaStudentOnlinePayment = attrs_to_fields(NigeriaStudentOnlinePayment)
+
+class NigeriaStudentOnlinePaymentFactory(StudentOnlinePaymentFactory):
+    """A factory for student online payments.
+    """
+
+    def __call__(self, *args, **kw):
+        return NigeriaStudentOnlinePayment()
+
+    def getInterfaces(self):
+        return implementedBy(NigeriaStudentOnlinePayment)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/student.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/student.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/student.py	(revision 11268)
@@ -0,0 +1,59 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Container for the various objects owned by students.
+"""
+import grok
+from zope.interface import implementedBy
+from waeup.kofa.utils.helpers import attrs_to_fields
+from waeup.kofa.students.student import Student, StudentFactory
+from kofacustom.nigeria.students.interfaces import (
+    INigeriaStudent, IStudentNavigation, INigeriaStudentPersonalEdit)
+
+
+class NigeriaStudent(Student):
+    """This is a student container for the various objects
+    owned by students.
+    """
+    grok.implements(
+        INigeriaStudent, INigeriaStudentPersonalEdit, IStudentNavigation)
+    grok.provides(INigeriaStudent)
+
+    @property
+    def is_foreigner(self):
+        return getattr(self, 'nationality') != 'NG'
+
+    @property
+    def transcript_enabled(self):
+        return False
+
+# Set all attributes of Student required in IStudent as field
+# properties. Doing this, we do not have to set initial attributes
+# ourselves and as a bonus we get free validation when an attribute is
+# set.
+NigeriaStudent = attrs_to_fields(NigeriaStudent)
+
+class NigeriaStudentFactory(StudentFactory):
+    """A factory for students.
+    """
+
+    def __call__(self, *args, **kw):
+        return NigeriaStudent()
+
+    def getInterfaces(self):
+        return implementedBy(NigeriaStudent)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/studycourse.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/studycourse.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/studycourse.py	(revision 11268)
@@ -0,0 +1,73 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Container which holds the data of the student study courses
+and contains the (student) study level objects.
+"""
+import grok
+from zope.interface import implementedBy
+from waeup.kofa.students.studycourse import (
+    StudentStudyCourse, StudentStudyCourseFactory)
+from waeup.kofa.utils.helpers import attrs_to_fields
+from waeup.kofa.students.workflow import CLEARED, RETURNING, PAID
+from kofacustom.nigeria.students.interfaces import (
+    INigeriaStudentStudyCourse, IStudentNavigation)
+
+class NigeriaStudentStudyCourse(StudentStudyCourse):
+    """This is a container for study levels.
+    """
+
+    grok.implements(INigeriaStudentStudyCourse, IStudentNavigation)
+    grok.provides(INigeriaStudentStudyCourse)
+
+    @property
+    def next_session_allowed(self):
+        state = self.student.state
+        certificate = getattr(self, 'certificate', None)
+        if certificate == None:
+            return False
+        if state == CLEARED:
+            return True
+        cond0 = state == RETURNING
+        cond1 = self.current_verdict in (
+            'A','B','C','F','J','L','M','N','O','X','Z')
+        cond2 = self.current_level in (0, 100)
+        cond3 = certificate.study_mode.startswith('de') and \
+            self.current_level == 200
+        cond4 = certificate.study_mode.startswith('ph') and \
+            self.current_level == 300
+        if cond0 and (cond1 or cond2 or cond3 or cond4):
+            return True
+        cond5 = self.is_postgrad
+        cond6 = state == PAID
+        cond7 = self.is_special_postgrad
+        if  cond5 and cond6 and not cond7:
+            return True
+        return False
+
+NigeriaStudentStudyCourse = attrs_to_fields(NigeriaStudentStudyCourse)
+
+class NigeriaStudentStudyCourseFactory(StudentStudyCourseFactory):
+    """A factory for student study courses.
+    """
+
+    def __call__(self, *args, **kw):
+        return NigeriaStudentStudyCourse()
+
+    def getInterfaces(self):
+        return implementedBy(NigeriaStudentStudyCourse)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/studylevel.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/studylevel.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/studylevel.py	(revision 11268)
@@ -0,0 +1,75 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Container which holds the data of a student study level
+and contains the course tickets.
+"""
+import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
+from waeup.kofa.utils.helpers import attrs_to_fields
+from waeup.kofa.students.studylevel import (
+    StudentStudyLevel, CourseTicket,
+    CourseTicketFactory, StudentStudyLevelFactory)
+from kofacustom.nigeria.students.interfaces import (
+    INigeriaStudentStudyLevel, IStudentNavigation, INigeriaCourseTicket)
+
+
+class NigeriaStudentStudyLevel(StudentStudyLevel):
+    """This is a container for course tickets.
+    """
+    grok.implements(INigeriaStudentStudyLevel, IStudentNavigation)
+    grok.provides(INigeriaStudentStudyLevel)
+
+NigeriaStudentStudyLevel = attrs_to_fields(
+    NigeriaStudentStudyLevel, omit=['total_credits', 'gpa'])
+
+class NigeriaStudentStudyLevelFactory(StudentStudyLevelFactory):
+    """A factory for student study levels.
+    """
+
+    def __call__(self, *args, **kw):
+        return NigeriaStudentStudyLevel()
+
+    def getInterfaces(self):
+        return implementedBy(NigeriaStudentStudyLevel)
+
+class NigeriaCourseTicket(CourseTicket):
+    """This is a course ticket which allows the
+    student to attend the course. Lecturers will enter scores and more at
+    the end of the term.
+
+    A course ticket contains a copy of the original course and
+    course referrer data. If the courses and/or their referrers are removed, the
+    corresponding tickets remain unchanged. So we do not need any event
+    triggered actions on course tickets.
+    """
+    grok.implements(INigeriaCourseTicket, IStudentNavigation)
+    grok.provides(INigeriaCourseTicket)
+
+NigeriaCourseTicket = attrs_to_fields(NigeriaCourseTicket)
+
+class NigeriaCourseTicketFactory(CourseTicketFactory):
+    """A factory for student study levels.
+    """
+
+    def __call__(self, *args, **kw):
+        return NigeriaCourseTicket()
+
+    def getInterfaces(self):
+        return implementedBy(NigeriaCourseTicket)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/__init__.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/__init__.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/__init__.py	(revision 11268)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/sample_student_data.csv
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/sample_student_data.csv	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/sample_student_data.csv	(revision 11268)
@@ -0,0 +1,4 @@
+firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex,nationality,fst_sit_results
+Aaren,Pieri,1,,100000,aa@aa.ng,1234,m,DE,"[('visual_art','A1'),('applied_electricity','C6')]"
+Aaren,Finau,2,,100001,aa@aa.ng,1234,m,NG,[]
+Aaren,Berson,3,,100002,aa@aa.ng,1234,m,FR,[]
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/test_browser.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/test_browser.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/test_browser.py	(revision 11268)
@@ -0,0 +1,323 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import os
+import shutil
+import tempfile
+from datetime import datetime, timedelta
+from StringIO import StringIO
+from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo
+from zope.component.hooks import setSite, clearSite
+from zope.component import getUtility, createObject
+from zope.interface import verify
+from waeup.kofa.app import University
+from waeup.kofa.students.tests.test_browser import (
+    StudentsFullSetup, SAMPLE_IMAGE)
+from waeup.kofa.testing import FunctionalTestCase
+from waeup.kofa.interfaces import (
+    IExtFileStore, IFileStoreNameChooser)
+from waeup.kofa.students.batching import StudentProcessor
+from waeup.kofa.students.interfaces import IStudentsUtils
+from kofacustom.nigeria.students.batching import NigeriaStudentProcessor
+from kofacustom.nigeria.testing import FunctionalLayer
+from kofacustom.nigeria.students.interfaces import (
+    INigeriaStudentStudyCourse, INigeriaStudent,
+    INigeriaStudentStudyLevel, INigeriaCourseTicket)
+
+
+STUDENT_SAMPLE_DATA = open(
+    os.path.join(os.path.dirname(__file__), 'sample_student_data.csv'),
+    'rb').read()
+
+STUDENT_HEADER_FIELDS = STUDENT_SAMPLE_DATA.split(
+    '\n')[0].split(',')
+
+class StudentProcessorTest(FunctionalTestCase):
+    """Perform some batching tests.
+    """
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(StudentProcessorTest, self).setUp()
+        # Setup a sample site for each test
+        app = University()
+        self.dc_root = tempfile.mkdtemp()
+        app['datacenter'].setStoragePath(self.dc_root)
+
+        # Prepopulate the ZODB...
+        self.getRootFolder()['app'] = app
+        # we add the site immediately after creation to the
+        # ZODB. Catalogs and other local utilities are not setup
+        # before that step.
+        self.app = self.getRootFolder()['app']
+        # Set site here. Some of the following setup code might need
+        # to access grok.getSite() and should get our new app then
+        setSite(app)
+
+        self.processor_base = StudentProcessor()
+        self.processor = NigeriaStudentProcessor()
+        self.workdir = tempfile.mkdtemp()
+        self.csv_file = os.path.join(self.workdir, 'sample_student_data.csv')
+        open(self.csv_file, 'wb').write(STUDENT_SAMPLE_DATA)
+
+    def tearDown(self):
+        super(StudentProcessorTest, self).tearDown()
+        shutil.rmtree(self.workdir)
+        shutil.rmtree(self.dc_root)
+        clearSite()
+        return
+
+    def test_import(self):
+        # We have an empty column 'date_of_birth' in  the import file.
+        # The original processor will fail because 'date_of_birth' is required
+        # in the base package.
+        num, num_warns, fin_file, fail_file = self.processor_base.doImport(
+            self.csv_file, STUDENT_HEADER_FIELDS)
+        self.assertEqual(num_warns,3)
+        assert len(self.app['students'].keys()) == 0
+        # The customized processor does not complain since 'date_of_birth' is
+        # not required in the custom package.
+        num, num_warns, fin_file, fail_file = self.processor.doImport(
+            self.csv_file, STUDENT_HEADER_FIELDS)
+        #print open(fail_file).read()
+        self.assertEqual(num_warns,0)
+        assert len(self.app['students'].keys()) == 3
+        # Also fst_sit_results have been properly imported (tested only here!)
+        self.assertEqual(
+            self.app['students']['K1000000'].fst_sit_results[0].__dict__,
+            {'grade': 'A1', 'subject': 'visual_art'})
+        self.assertEqual(
+            self.app['students']['K1000000'].fst_sit_results[1].__dict__,
+            {'grade': 'C6', 'subject': 'applied_electricity'})
+        shutil.rmtree(os.path.dirname(fin_file))
+
+
+class StudentUITests(StudentsFullSetup):
+    """Tests for customized student class views and pages
+    """
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(StudentUITests, self).setUp()
+
+    def test_classes(self):
+        # Let's see if objects created in the customized
+        # portal really implement the customized interfaces
+        verify.verifyObject(INigeriaStudent, self.student)
+        verify.verifyObject(
+            INigeriaStudentStudyCourse, self.student['studycourse'])
+        studylevel = createObject(u'waeup.StudentStudyLevel')
+        verify.verifyObject(INigeriaStudentStudyLevel, studylevel)
+        ticket = createObject(u'waeup.CourseTicket')
+        verify.verifyObject(INigeriaCourseTicket, ticket)
+        IWorkflowState(self.student).setState('returning')
+        # Let's see if next_session_allowed works as expected
+        # A, ug_ft, 100
+        self.assertTrue(self.student['studycourse'].next_session_allowed)
+        # Zero, ug_ft, 100
+        self.student['studycourse'].current_verdict = '0' # Zero!
+        self.assertTrue(self.student['studycourse'].next_session_allowed)
+        # Zero, ug_ft, 200
+        self.student['studycourse'].current_level = 200
+        self.assertFalse(self.student['studycourse'].next_session_allowed)
+        # Zero, de_ft, 200
+        self.student['studycourse'].certificate.study_mode = 'de_ft'
+        self.assertTrue(self.student['studycourse'].next_session_allowed)
+        # Zero, ph_ft, 300
+        self.student['studycourse'].certificate.study_mode = 'ph_ft'
+        self.student['studycourse'].current_level = 300
+        self.assertTrue(self.student['studycourse'].next_session_allowed)
+        # Zero, ph_ft, 400
+        self.student['studycourse'].current_level = 400
+        self.assertFalse(self.student['studycourse'].next_session_allowed)
+
+        # Now we convert the certificate into a postgraduate certificate
+        IWorkflowState(self.student).setState('school fee paid')
+        self.certificate.study_mode = 'pg_ft'
+        # ... and voila next session registration is allowed
+        self.assertTrue(self.student['studycourse'].next_session_allowed)
+
+    def test_manage_access(self):
+        self.student.nationality = u'DE'
+        # Managers can access the pages of students
+        # and can perform actions
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        # The student created in the base package is an ug student
+        self.browser.open(self.student_path)
+        self.browser.getLink("Clearance Data").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.url, self.clearance_path)
+        self.browser.getLink("Manage").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.url, self.manage_clearance_path)
+        self.browser.getControl(name="form.date_of_birth").value = '09/10/1961'
+        self.browser.getControl("Save").click()
+        self.assertMatches('...Form has been saved...',
+                           self.browser.contents)
+        self.assertMatches('...First Sitting Record...',
+                           self.browser.contents)
+        # Managers can open clearance slip of ug students
+        self.browser.open(self.student_path + '/clearance_slip.pdf')
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
+        # There is no pg field in the clearance form
+        self.assertFalse('Second Higher Education Record'
+            in self.browser.contents)
+        # Now we change the study mode ...
+        self.certificate.study_mode = 'pg_ft'
+        self.browser.open(self.clearance_path)
+        # ... and additional pg clearance fields appear
+        self.assertMatches('...Second Higher Education Record...',
+                           self.browser.contents)
+        # But also fields from the ug form are displayed
+        self.assertMatches('...First Sitting Record...',
+                           self.browser.contents)
+        # Managers can open clearance slip of pg students
+        self.browser.open(self.student_path + '/clearance_slip.pdf')
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
+        # Managers can edit personal data. No fields are required.
+        self.browser.open(self.manage_personal_path)
+        self.browser.getControl("Save").click()
+        self.assertMatches('...Form has been saved...',
+                           self.browser.contents)
+
+    def test_student_access(self):
+        # Students can edit clearance data
+        IWorkflowState(self.student).setState('cleared')
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = self.student_id
+        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl("Login").click()
+        # Even in state admitted students can't change the portait if
+        # application slip exists.
+        IWorkflowState(self.student).setState('admitted')
+        self.browser.open(self.student_path)
+        self.assertTrue('Change portrait' in self.browser.contents)
+        file_store = getUtility(IExtFileStore)
+        applicant_slip = 'My application slip'
+        file_id = IFileStoreNameChooser(self.student).chooseName(
+            attr="application_slip.pdf")
+        file_store.createFile(file_id, StringIO(applicant_slip))
+        self.browser.open(self.student_path)
+        self.assertFalse('Change portrait' in self.browser.contents)
+        self.browser.open(self.student_path + '/change_portrait')
+        self.assertTrue('The requested form is locked' in self.browser.contents)
+
+        # Student can view and edit clearance data if clearance has started ...
+        IWorkflowInfo(self.student).fireTransition('start_clearance')
+        self.student.officer_comment = u'Fill properly'
+        self.browser.getLink("Clearance Data").click()
+        self.assertTrue("Officer's Comment" in self.browser.contents)
+        # Students can't edit officer's comment
+        self.browser.getLink("Edit").click()
+        self.assertFalse("Officer's Comment" in self.browser.contents)
+        self.assertTrue('Save' in self.browser.contents)
+        # ... and request clearance if nationality field has been filled.
+        self.browser.getControl("Save and request clearance").click()
+        self.assertMatches('...Required input is missing...',
+                           self.browser.contents)
+        self.student.nationality = u'DE'
+        self.browser.open(self.edit_clearance_path)
+        self.browser.getControl("Save and request clearance").click()
+        self.assertMatches('...Clearance has been requested...',
+                           self.browser.contents)
+
+        # Students can edit personal data. Some fields are required.
+        self.browser.open(self.personal_path)
+        self.assertTrue('Updated' in self.browser.contents)
+        self.browser.getLink("Edit").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.url, self.edit_personal_path)
+        self.browser.getControl("Save").click()
+        self.assertMatches('...Required input is missing...',
+                           self.browser.contents)
+        self.browser.getControl(name="form.perm_address").value = 'My address!'
+        self.browser.getControl("Save").click()
+        self.assertMatches('...Required input is missing...',
+                           self.browser.contents)
+        # Ok, let's give up and fill the rest.
+        self.browser.getControl(name="form.next_kin_name").value = 'My Mutti'
+        self.browser.getControl(name="form.next_kin_relation").value = 'mother'
+        self.browser.getControl(name="form.next_kin_address").value = 'sweet home'
+        self.browser.getControl(name="form.next_kin_phone.country").value = ['+234']
+        self.browser.getControl(name="form.next_kin_phone.ext").value = '45678'
+        self.browser.getControl("Save").click()
+        self.assertMatches('...Form has been saved...',
+                           self.browser.contents)
+
+    def test_manage_upload_file(self):
+        # Managers can upload a file via the StudentClearanceManageFormPage
+        # The image is stored even if form has errors
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.manage_clearance_path)
+        # Managers can add and delete a file
+        self.browser.open(self.manage_clearance_path)
+        image = open(SAMPLE_IMAGE, 'rb')
+        ctrl = self.browser.getControl(name='birthcertificateupload')
+        file_ctrl = ctrl.mech_control
+        file_ctrl.add_file(image, filename='my_acceptance_letter.jpg')
+        self.browser.getControl(
+            name='upload_acceptanceletterupload').click()
+        # Uups, we used the wrong 'Browse' field
+        self.assertFalse(
+            '<a target="image" href="acc_let">'
+            in self.browser.contents)
+        ctrl = self.browser.getControl(name='acceptanceletterupload')
+        file_ctrl = ctrl.mech_control
+        image.seek(0)
+        file_ctrl.add_file(image, filename='my_acceptance_letter.jpg')
+        self.browser.getControl(
+            name='upload_acceptanceletterupload').click()
+        self.assertTrue(
+            'http://localhost/app/students/K1000000/acc_let'
+            in self.browser.contents)
+        self.browser.getControl(
+            name='delete_acceptanceletterupload').click()
+        self.assertTrue(
+            'acc_let deleted'
+            in self.browser.contents)
+
+    def test_student_expired_personal_data(self):
+        # Login
+        IWorkflowState(self.student).setState('school fee paid')
+        delta = timedelta(days=180)
+        self.student.personal_updated = datetime.utcnow() - delta
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = self.student_id
+        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl("Login").click()
+        self.assertEqual(self.browser.url, self.student_path)
+        self.assertTrue(
+            'You logged in' in self.browser.contents)
+        # Students don't see personal_updated field in edit form
+        self.browser.open(self.edit_personal_path)
+        self.assertFalse('Updated' in self.browser.contents)
+        self.browser.open(self.personal_path)
+        self.assertTrue('Updated' in self.browser.contents)
+        self.browser.getLink("Logout").click()
+        delta = timedelta(days=181)
+        self.student.personal_updated = datetime.utcnow() - delta
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = self.student_id
+        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl("Login").click()
+        self.assertEqual(self.browser.url, self.edit_personal_path)
+        self.assertTrue(
+            'Your personal data record is outdated.' in self.browser.contents)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/test_export.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/test_export.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/test_export.py	(revision 11268)
@@ -0,0 +1,112 @@
+import datetime
+from zope.component import queryUtility
+from zope.interface.verify import verifyObject, verifyClass
+from waeup.kofa.interfaces import ICSVExporter
+from waeup.kofa.schoolgrades import ResultEntry
+from waeup.kofa.students.tests.test_batching import StudentImportExportSetup
+
+from kofacustom.nigeria.utils.utils import NigeriaKofaUtils
+from kofacustom.nigeria.students.export import (
+    NigeriaStudentsExporter, NigeriaStudentPaymentsExporter)
+from kofacustom.nigeria.testing import FunctionalLayer
+
+
+class NigeriaStudentsExporterTest(StudentImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(NigeriaStudentsExporterTest, self).setUp()
+        self.setup_for_export()
+        result_entry = ResultEntry(
+            NigeriaKofaUtils.EXAM_SUBJECTS_DICT.keys()[0],
+            NigeriaKofaUtils.EXAM_GRADES[0][0]
+            )
+        self.student.alr_results = [
+            result_entry]
+        self.student.fst_sit_results = [
+            result_entry]
+        self.student.scd_sit_results = [
+            result_entry]
+        return
+
+    def test_ifaces(self):
+        # make sure we fullfill interface contracts
+        obj = NigeriaStudentsExporter()
+        verifyObject(ICSVExporter, obj)
+        verifyClass(ICSVExporter, NigeriaStudentsExporter)
+        return
+
+
+    def test_export_all(self):
+        # we can really export students
+        # set values we can expect in export file
+        self.setup_student(self.student)
+        exporter = NigeriaStudentsExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertMatches(
+            'adm_code,alr_date,alr_fname,alr_no,alr_results,clearance_locked,'
+            'clr_code,date_of_birth,def_adm,disabled,email,emp2_end,'
+            'emp2_position,emp2_reason,emp2_start,emp_end,emp_position,'
+            'emp_reason,emp_start,employer,employer2,firstname,former_matric,'
+            'fst_sit_date,fst_sit_fname,fst_sit_no,fst_sit_results,'
+            'fst_sit_type,hq2_degree,hq2_disc,hq2_matric_no,hq2_school,'
+            'hq2_session,hq2_type,hq_degree,hq_disc,hq_fname,hq_matric_no,'
+            'hq_school,hq_session,hq_type,is_staff,lastname,lga,'
+            'marit_stat,matric_number,middlename,nationality,'
+            'next_kin_address,next_kin_name,next_kin_phone,next_kin_relation,'
+            'nysc_lga,nysc_location,nysc_year,officer_comment,'
+            'perm_address,personal_updated,phone,reg_number,'
+            'religion,scd_sit_date,scd_sit_fname,scd_sit_no,'
+            'scd_sit_results,scd_sit_type,sex,student_id,'
+            'suspended,suspended_comment,password,state,history,certcode,is_postgrad,'
+            'current_level,current_session\r\nmy adm code,,,,'
+            '"[(\'visual_art\', \'A1\')]",0,my clr code,1981-02-04#,,,'
+            'anna@sample.com,,,,,,,,,,,Anna,,,,,"[(\'visual_art\', \'A1\')]"'
+            ',,,,,,,,,,,,,,,,Tester,,,234,M.,NG,,,,,,,,,'
+            '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,123,,,,,'
+            '"[(\'visual_art\', \'A1\')]",,f,A111111,0,,,created,'
+            '[u\'2012-11-06 13:16:41 WAT - Record created by system\'],'
+            'CERT1,0,200,2012\r\n',
+            result
+            )
+        return
+
+class NigeriaStudentPaymentsExporterTest(StudentImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(NigeriaStudentPaymentsExporterTest, self).setUp()
+        self.setup_for_export()
+        return
+
+    def test_ifaces(self):
+        # make sure we fullfill interface contracts
+        obj = NigeriaStudentPaymentsExporter()
+        verifyObject(ICSVExporter, obj)
+        verifyClass(ICSVExporter, NigeriaStudentPaymentsExporter)
+        return
+
+    def test_export_all(self):
+        # we can really export students
+        # set values we can expect in export file
+        self.setup_student(self.student)
+        self.student['payments']['my-payment'].r_company = 'interswatch'
+        self.student['payments']['my-payment'].r_card_num = '789'
+        exporter = NigeriaStudentPaymentsExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertMatches(
+            'ac,amount_auth,creation_date,gateway_amt,p_category,p_current,'
+            'p_id,p_item,p_level,p_session,p_state,payment_date,provider_amt,'
+            'r_amount_approved,r_card_num,r_code,r_company,r_desc,'
+            'r_pay_reference,thirdparty_amt,student_id,state,'
+            'current_session\r\n'
+            '666,12.12,2012-04-01 13:12:01,,schoolfee,1,my-id,p-item,'
+            '100,2012,paid,2012-04-01 14:12:01,,12.12,'
+            '789,r-code,interswatch,,,,A111111,created,2012\r\n',
+            result
+            )
+        return
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/test_student.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/test_student.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/tests/test_student.py	(revision 11268)
@@ -0,0 +1,137 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Tests for students and related.
+"""
+from datetime import tzinfo
+from zope.component.interfaces import IFactory
+from zope.interface import verify
+from zope.schema.interfaces import ConstraintNotSatisfied
+from waeup.kofa.testing import FunctionalTestCase
+from kofacustom.nigeria.students.student import NigeriaStudent, NigeriaStudentFactory
+from kofacustom.nigeria.students.studycourse import (
+    NigeriaStudentStudyCourse, NigeriaStudentStudyCourseFactory)
+from kofacustom.nigeria.students.studylevel import (
+    NigeriaStudentStudyLevel, NigeriaCourseTicket,
+    NigeriaStudentStudyLevelFactory,
+    NigeriaCourseTicketFactory)
+from kofacustom.nigeria.students.interfaces import (
+    INigeriaStudent, INigeriaStudentStudyCourse,
+    INigeriaStudentStudyLevel, INigeriaCourseTicket)
+from kofacustom.nigeria.testing import FunctionalLayer
+
+
+class NigeriaStudentFactoryTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(NigeriaStudentFactoryTest, self).setUp()
+        self.factory = NigeriaStudentFactory()
+
+    def tearDown(self):
+        super(NigeriaStudentFactoryTest, self).tearDown()
+
+    def test_interfaces(self):
+        verify.verifyClass(IFactory, NigeriaStudentFactory)
+        verify.verifyObject(IFactory, self.factory)
+
+    def test_factory(self):
+        obj = self.factory()
+        assert isinstance(obj, NigeriaStudent)
+
+    def test_getInterfaces(self):
+        implemented_by = self.factory.getInterfaces()
+        assert implemented_by.isOrExtends(INigeriaStudent)
+
+    def test_is_foreigner(self):
+        student = self.factory()
+        self.assertRaises(
+            ConstraintNotSatisfied, setattr, student, 'nationality', 'XX')
+        student.nationality = 'NG'
+        self.assertFalse(student.is_foreigner)
+        student.nationality = 'DE'
+        self.assertTrue(student.is_foreigner)
+
+class NigeriaStudentStudyCourseFactoryTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(NigeriaStudentStudyCourseFactoryTest, self).setUp()
+        self.factory = NigeriaStudentStudyCourseFactory()
+
+    def tearDown(self):
+        super(NigeriaStudentStudyCourseFactoryTest, self).tearDown()
+
+    def test_interfaces(self):
+        verify.verifyClass(IFactory, NigeriaStudentStudyCourseFactory)
+        verify.verifyObject(IFactory, self.factory)
+
+    def test_factory(self):
+        obj = self.factory()
+        assert isinstance(obj, NigeriaStudentStudyCourse)
+
+    def test_getInterfaces(self):
+        implemented_by = self.factory.getInterfaces()
+        assert implemented_by.isOrExtends(INigeriaStudentStudyCourse)
+
+class NigeriaStudentStudyLevelFactoryTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(NigeriaStudentStudyLevelFactoryTest, self).setUp()
+        self.factory = NigeriaStudentStudyLevelFactory()
+
+    def tearDown(self):
+        super(NigeriaStudentStudyLevelFactoryTest, self).tearDown()
+
+    def test_interfaces(self):
+        verify.verifyClass(IFactory, NigeriaStudentStudyLevelFactory)
+        verify.verifyObject(IFactory, self.factory)
+
+    def test_factory(self):
+        obj = self.factory()
+        assert isinstance(obj, NigeriaStudentStudyLevel)
+
+    def test_getInterfaces(self):
+        implemented_by = self.factory.getInterfaces()
+        assert implemented_by.isOrExtends(INigeriaStudentStudyLevel)
+
+class NigeriaCourseTicketFactoryTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(NigeriaCourseTicketFactoryTest, self).setUp()
+        self.factory = NigeriaCourseTicketFactory()
+
+    def tearDown(self):
+        super(NigeriaCourseTicketFactoryTest, self).tearDown()
+
+    def test_interfaces(self):
+        verify.verifyClass(IFactory, NigeriaCourseTicketFactory)
+        verify.verifyObject(IFactory, self.factory)
+
+    def test_factory(self):
+        obj = self.factory()
+        assert isinstance(obj, NigeriaCourseTicket)
+
+    def test_getInterfaces(self):
+        implemented_by = self.factory.getInterfaces()
+        assert implemented_by.isOrExtends(INigeriaCourseTicket)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/utils.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/utils.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/utils.py	(revision 11268)
@@ -0,0 +1,66 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import grok
+from waeup.kofa.students.utils import StudentsUtils
+from kofacustom.nigeria.interfaces import MessageFactory as _
+
+class NigeriaStudentsUtils(StudentsUtils):
+    """A collection of customized methods.
+
+    """
+
+    VERDICTS_DICT = {
+        '0': 'not yet',
+        'A': 'Successful student',
+        'B': 'Student with carryover courses',
+        'C': 'Student on probation',
+        'D': 'Withdrawn from the faculty',
+        'E': 'Student who were previously on probation',
+        'F': 'Medical case',
+        'G': 'Absent from examination',
+        'H': 'Withheld results',
+        'I': 'Expelled/rusticated/suspended student',
+        'J': 'Temporary withdrawn from the university',
+        'K': 'Unregistered student',
+        'L': 'Referred student',
+        'M': 'Reinstatement',
+        'N': 'Student on transfer',
+        #'O': 'NCE-III repeater', # FCEOkene only
+        'Y': 'No previous verdict',
+        'X': 'New 300 level student (Uniben)',
+        'Z': 'Successful student (provisional)',
+        'A1': 'First Class',
+        'A2': 'Second Class Upper',
+        'A3': 'Second Class Lower',
+        'A4': 'Third Class',
+        'A5': 'Pass',
+        'A6': 'Distinction',
+        'A7': 'Credit',
+        'A8': 'Merit',
+        }
+
+    SEPARATORS_DICT = {
+        'form.fst_sit_fname': _(u'First Sitting Record'),
+        'form.scd_sit_fname': _(u'Second Sitting Record'),
+        'form.alr_fname': _(u'Advanced Level Record'),
+        'form.hq_type': _(u'Higher Education Record'),
+        'form.hq2_type': _(u'Second Higher Education Record'),
+        'form.nysc_year': _(u'NYSC Information'),
+        'form.employer': _(u'Employment History'),
+        'form.former_matric': _(u'Former Student'),
+        }
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/viewlets.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/viewlets.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/students/viewlets.py	(revision 11268)
@@ -0,0 +1,536 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+
+import grok
+from zope.component import getUtility
+from waeup.kofa.students.interfaces import IStudentsUtils
+from waeup.kofa.students.viewlets import (
+    FileDisplay, FileUpload, Image)
+from waeup.kofa.students.browser import ExportPDFClearanceSlipPage
+
+from kofacustom.nigeria.interfaces import MessageFactory as _
+
+def show_viewlet(viewlet):
+    students_utils = getUtility(IStudentsUtils)
+    if viewlet.__name__ in students_utils.SKIP_UPLOAD_VIEWLETS:
+        return False
+    cm = getattr(viewlet.context,'current_mode', None)
+    if cm is not None and cm.startswith('pg'):
+        return True
+    return False
+
+# Acceptance Letter
+
+class AcceptanceLetterDisplay(FileDisplay):
+    """Acceptance Letter display viewlet.
+    """
+    grok.order(2)
+    label = _(u'Acceptance Letter')
+    title = _(u'Acceptance Letter Scan')
+    download_name = u'acc_let'
+
+class AcceptanceLetterSlip(AcceptanceLetterDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class AcceptanceLetterUpload(FileUpload):
+    """AcceptanceLetter upload viewlet.
+    """
+    grok.order(2)
+    label = _(u'Acceptance Letter')
+    title = _(u'Acceptance Letter Scan')
+    mus = 1024 * 150
+    download_name = u'acc_let'
+    tab_redirect = '?tab2'
+
+class AcceptanceLetterImage(Image):
+    """Renders acceptance letter scan.
+    """
+    grok.name('acc_let')
+    download_name = u'acc_let'
+
+# LGA Identification
+
+class LGAIdentificationDisplay(FileDisplay):
+    """LGA Identification display viewlet.
+    """
+    grok.order(3)
+    label = _(u'LGA Identification')
+    title = _(u'LGA Identification Scan')
+    download_name = u'lga_ident'
+
+class LGAIdentificationSlip(LGAIdentificationDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class LGAIdentificationUpload(FileUpload):
+    """LGA Identification upload viewlet.
+    """
+    grok.order(3)
+    label = _(u'LGA Identification')
+    title = _(u'LGA Identification Scan')
+    mus = 1024 * 150
+    download_name = u'lga_ident'
+
+class LGAIdentificationImage(Image):
+    """Renders LGA Identification scan.
+    """
+    grok.name('lga_ident')
+    download_name = u'lga_ident'
+
+# First Sitting Result
+
+class FirstSittingResultDisplay(FileDisplay):
+    """First Sitting Result display viewlet.
+    """
+    grok.order(4)
+    label = _(u'First Sitting Result')
+    title = _(u'First Sitting Result')
+    download_name = u'fst_sit_scan'
+
+class FirstSittingResultSlip(FirstSittingResultDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class FirstSittingResultUpload(FileUpload):
+    """First Sitting Result upload viewlet.
+    """
+    grok.order(4)
+    label = _(u'First Sitting Result')
+    title = _(u'First Sitting Result Scan')
+    mus = 1024 * 150
+    download_name = u'fst_sit_scan'
+
+class FirstSittingResultImage(Image):
+    """Renders First Sitting Result scan.
+    """
+    grok.name('fst_sit_scan')
+    download_name = u'fst_sit_scan'
+
+# Second Sitting Result
+
+class SecondSittingResultDisplay(FileDisplay):
+    """Second Sitting Result display viewlet.
+    """
+    grok.order(5)
+    label = _(u'Second Sitting Result')
+    title = _(u'Second Sitting Result')
+    download_name = u'scd_sit_scan'
+
+class SecondSittingResultSlip(SecondSittingResultDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class SecondSittingResultUpload(FileUpload):
+    """Second Sitting Result upload viewlet.
+    """
+    grok.order(5)
+    label = _(u'Second Sitting Result')
+    title = _(u'Second Sitting Result Scan')
+    mus = 1024 * 150
+    download_name = u'scd_sit_scan'
+
+class SecondSittingResultImage(Image):
+    """Renders Second Sitting Result scan.
+    """
+    grok.name('scd_sit_scan')
+    download_name = u'scd_sit_scan'
+
+# Higher Qualification Result
+
+class HigherQualificationResultDisplay(FileDisplay):
+    """Higher Qualification Result display viewlet.
+    """
+    grok.order(6)
+    label = _(u'Higher Qualification Result')
+    title = _(u'Higher Qualification Result')
+    download_name = u'hq_scan'
+
+class HigherQualificationResultSlip(HigherQualificationResultDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class HigherQualificationResultUpload(FileUpload):
+    """Higher Qualification Result upload viewlet.
+    """
+    grok.order(6)
+    label = _(u'Higher Qualification Result')
+    title = _(u'Higher Qualification Result Scan')
+    mus = 1024 * 150
+    download_name = u'hq_scan'
+
+class HigherQualificationResultImage(Image):
+    """Renders Higher Qualification Result scan.
+    """
+    grok.name('hq_scan')
+    download_name = u'hq_scan'
+
+# 2nd Higher Qualification Result (PG Students only)
+
+class SecondHigherQualificationResultDisplay(FileDisplay):
+    """Second Higher Qualification Result display viewlet.
+    """
+    grok.order(7)
+    label = _(u'Second Higher Qualification Result')
+    title = _(u'Second Higher Qualification Result')
+    download_name = u'hq_scan2'
+
+class SecondHigherQualificationResultSlip(SecondHigherQualificationResultDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class SecondHigherQualificationResultUpload(FileUpload):
+    """Second Higher Qualification Result upload viewlet.
+    """
+    grok.order(7)
+    label = _(u'Second Higher Qualification Result')
+    title = _(u'Second Higher Qualification Result Scan')
+    mus = 1024 * 150
+    download_name = u'hq_scan2'
+
+    @property
+    def show_viewlet(self):
+        return show_viewlet(self)
+
+class SecondHigherQualificationResultImage(Image):
+    """Renders Second Higher Qualification Result scan.
+    """
+    grok.name('hq_scan2')
+    download_name = u'hq_scan2'
+
+# Advanced Level Result
+
+class AdvancedLevelResultDisplay(FileDisplay):
+    """Advanced Level Result display viewlet.
+    """
+    grok.order(8)
+    label = _(u'Advanced Level Result')
+    title = _(u'Advanced Level Result')
+    download_name = u'alr_scan'
+
+class AdvancedLevelResultSlip(AdvancedLevelResultDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class AdvancedLevelResultUpload(FileUpload):
+    """Advanced Level Result upload viewlet.
+    """
+    grok.order(8)
+    label = _(u'Advanced Level Result')
+    title = _(u'Advanced Level Result Scan')
+    mus = 1024 * 150
+    download_name = u'alr_scan'
+
+class AdvancedLevelResultImage(Image):
+    """Renders Advanced Level Result scan.
+    """
+    grok.name('alr_scan')
+    download_name = u'alr_scan'
+
+# Certificate
+
+class CertificateDisplay(FileDisplay):
+    """Certificate display viewlet.
+    """
+    grok.order(9)
+    label = _(u'Certificate')
+    title = _(u'Certificate')
+    download_name = u'cert'
+
+class CertificateSlip(CertificateDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class CertificateUpload(FileUpload):
+    """Certificate upload viewlet.
+    """
+    grok.order(9)
+    label = _(u'Certificate')
+    title = _(u'Certificate Scan')
+    mus = 1024 * 150
+    download_name = u'cert'
+
+class CertificateImage(Image):
+    """Renders Certificate scan.
+    """
+    grok.name('cert')
+    download_name = u'cert'
+
+# Second Certificate (PG Students only)
+
+class SecondCertificateDisplay(FileDisplay):
+    """ Second Certificate display viewlet.
+    """
+    grok.order(10)
+    label = _(u'Second Certificate')
+    title = _(u'Second Certificate')
+    download_name = u'cert2'
+
+class SecondCertificateSlip(SecondCertificateDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class SecondCertificateUpload(FileUpload):
+    """Second Certificate upload viewlet.
+    """
+    grok.order(10)
+    label = _(u'Second Certificate')
+    title = _(u'Second Certificate Scan')
+    mus = 1024 * 150
+    download_name = u'cert2'
+
+    @property
+    def show_viewlet(self):
+        return show_viewlet(self)
+
+class SecondCertificateImage(Image):
+    """Renders Second Certificate scan.
+    """
+    grok.name('cert2')
+    download_name = u'cert2'
+
+# Third Certificate (PG Students only)
+
+class ThirdCertificateDisplay(FileDisplay):
+    """ Third Certificate display viewlet.
+    """
+    grok.order(11)
+    label = _(u'Third Certificate')
+    title = _(u'Third Certificate')
+    download_name = u'cert3'
+
+class ThirdCertificateSlip(ThirdCertificateDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class ThirdCertificateUpload(FileUpload):
+    """Third Certificate upload viewlet.
+    """
+    grok.order(11)
+    label = _(u'Third Certificate')
+    title = _(u'Third Certificate Scan')
+    mus = 1024 * 150
+    download_name = u'cert3'
+
+    @property
+    def show_viewlet(self):
+        return show_viewlet(self)
+
+class ThirdCertificateImage(Image):
+    """Renders Third Certificate scan.
+    """
+    grok.name('cert3')
+    download_name = u'cert3'
+
+# Evidence of Name
+
+class EvidenceNameDisplay(FileDisplay):
+    """Evidence of Name display viewlet.
+    """
+    grok.order(12)
+    label = _(u'Evidence of Name')
+    title = _(u'Evidence of Name')
+    download_name = u'evid'
+
+class EvidenceNameSlip(EvidenceNameDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class EvidenceNameUpload(FileUpload):
+    """Evidence of Name upload viewlet.
+    """
+    grok.order(12)
+    label = _(u'Evidence of Name')
+    title = _(u'Evidence of Name Scan')
+    mus = 1024 * 150
+    download_name = u'evid'
+
+class EvidenceNameImage(Image):
+    """Renders Evidence of Name scan.
+    """
+    grok.name('evid')
+    download_name = u'evid'
+
+# Result Statement
+
+class ResultStatementDisplay(FileDisplay):
+    """Result Statement display viewlet.
+    """
+    grok.order(13)
+    label = _(u'Result Statement')
+    title = _(u'Result Statement')
+    download_name = u'res_stat'
+
+class ResultStatementSlip(ResultStatementDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class ResultStatementUpload(FileUpload):
+    """Result Statement upload viewlet.
+    """
+    grok.order(13)
+    label = _(u'Result Statement')
+    title = _(u'Result Statement Scan')
+    mus = 1024 * 150
+    download_name = u'res_stat'
+
+class ResultStatementImage(Image):
+    """Renders Result Statement scan.
+    """
+    grok.name('res_stat')
+    download_name = u'res_stat'
+
+# Referee Letter
+
+class RefereeLetterDisplay(FileDisplay):
+    """Referee Letter display viewlet.
+    """
+    grok.order(14)
+    label = _(u'Guarantor/Referee Letter')
+    title = _(u'Guarantor/Referee Letter')
+    download_name = u'ref_let'
+
+class RefereeLetterSlip(RefereeLetterDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class RefereeLetterUpload(FileUpload):
+    """Referee Letter upload viewlet.
+    """
+    grok.order(14)
+    label = _(u'Guarantor/Referee Letter')
+    title = _(u'Guarantor/Referee Letter Scan')
+    mus = 1024 * 150
+    download_name = u'ref_let'
+
+class RefereeLetterImage(Image):
+    """Renders Referee Letter scan.
+    """
+    grok.name('ref_let')
+    download_name = u'ref_let'
+
+# Second Referee Letter (PG Students only)
+
+class SecondRefereeLetterDisplay(FileDisplay):
+    """Second Referee Letter display viewlet.
+    """
+    grok.order(15)
+    label = _(u'Second Referee Letter')
+    title = _(u'Second Referee Letter')
+    download_name = u'ref_let2'
+
+class SecondRefereeLetterSlip(SecondRefereeLetterDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class SecondRefereeLetterUpload(FileUpload):
+    """Referee Letter upload viewlet.
+    """
+    grok.order(15)
+    label = _(u'Second Referee Letter')
+    title = _(u'Second Referee Letter Scan')
+    mus = 1024 * 150
+    download_name = u'ref_let2'
+
+    @property
+    def show_viewlet(self):
+        return show_viewlet(self)
+
+class SecondRefereeLetterImage(Image):
+    """Renders Referee Letter scan.
+    """
+    grok.name('ref_let2')
+    download_name = u'ref_let2'
+
+# Third Referee Letter (PG Students only)
+
+class ThirdRefereeLetterDisplay(FileDisplay):
+    """Third Referee Letter display viewlet.
+    """
+    grok.order(16)
+    label = _(u'Third Referee Letter')
+    title = _(u'Third Referee Letter')
+    download_name = u'ref_let3'
+
+class ThirdRefereeLetterSlip(ThirdRefereeLetterDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class ThirdRefereeLetterUpload(FileUpload):
+    """Referee Letter upload viewlet.
+    """
+    grok.order(16)
+    label = _(u'Third Referee Letter')
+    title = _(u'Third Referee Letter Scan')
+    mus = 1024 * 150
+    download_name = u'ref_let3'
+
+    @property
+    def show_viewlet(self):
+        return show_viewlet(self)
+
+class ThirdRefereeLetterImage(Image):
+    """Renders Referee Letter scan.
+    """
+    grok.name('ref_let3')
+    download_name = u'ref_let3'
+
+# Affidavit (former Statutory Declaration) of Good Conduct
+
+class StatutoryDeclarationDisplay(FileDisplay):
+    """Statutory Declaration of Good Conduct display viewlet.
+    """
+    grok.order(17)
+    label = _(u'Affidavit of Good Conduct')
+    title = _(u'Affidavit of Good Conduct')
+    download_name = u'stat_dec'
+
+class StatutoryDeclarationSlip(StatutoryDeclarationDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class StatutoryDeclarationUpload(FileUpload):
+    """Statutory Declaration of Good Conduct upload viewlet.
+    """
+    grok.order(17)
+    label = _(u'Affidavit of Good Conduct')
+    title = _(u'Affidavit of Good Conduct Scan')
+    mus = 1024 * 150
+    download_name = u'stat_dec'
+
+class StatutoryDeclarationImage(Image):
+    """Renders Affidavit of Good Conduct scan.
+    """
+    grok.name('stat_dec')
+    download_name = u'stat_dec'
+
+# Letter of Admission (PG Students only)
+
+class LetterAdmissionDisplay(FileDisplay):
+    """Letter of Admission display viewlet.
+    """
+    grok.order(18)
+    label = _(u'Letter of Admission')
+    title = _(u'Letter of Admission')
+    download_name = u'admission_let'
+
+class LetterAdmissionSlip(LetterAdmissionDisplay):
+    grok.view(ExportPDFClearanceSlipPage)
+
+class LetterAdmissionUpload(FileUpload):
+    """Letter of Admission upload viewlet.
+    """
+    grok.order(18)
+    label = _(u'Letter of Admission')
+    title = _(u'Letter of Admission Scan')
+    mus = 1024 * 150
+    download_name = u'admission_let'
+
+    @property
+    def show_viewlet(self):
+        return show_viewlet(self)
+
+class LetterAdmissionImage(Image):
+    """Renders Letter of Admission scan.
+    """
+    grok.name('admission_let')
+    download_name = u'admission_let'
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/testing.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/testing.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/testing.py	(revision 11268)
@@ -0,0 +1,29 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Testing support for :mod:`waeup.kofa`.
+"""
+import os.path
+import kofacustom.nigeria
+from zope.app.testing.functional import ZCMLLayer
+from waeup.kofa.testing import FunctionalTestCase
+
+# Some funcional layer that groks kofacustom.nigeria.
+ftesting_zcml = os.path.join(
+    os.path.dirname(kofacustom.nigeria.__file__), 'ftesting.zcml')
+FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer',
+                            allow_teardown=True)
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/tests/__init__.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/tests/__init__.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/tests/__init__.py	(revision 11268)
@@ -0,0 +1,1 @@
+# make this a package.
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/tests/test_foo.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/tests/test_foo.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/tests/test_foo.py	(revision 11268)
@@ -0,0 +1,27 @@
+# Make sure that test setup basically works.
+# THIS FILE CAN BE REMOVED.
+
+from kofacustom.nigeria.testing import FunctionalTestCase, FunctionalLayer
+
+class FooTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def test_foo(self):
+        # we can access registered components
+        from zope.component import getUtility
+        from waeup.kofa.applicants.interfaces import IApplicantsUtils
+        from kofacustom.nigeria.applicants.utils import NigeriaApplicantsUtils
+        result = getUtility(IApplicantsUtils)
+        self.assertTrue(isinstance(result, NigeriaApplicantsUtils))
+        return
+
+    def test_bar(self):
+        # we can access browser contents
+        from waeup.kofa.app import University
+        self.getRootFolder()['app'] = University()
+        from zope.testbrowser.testing import Browser
+        br = Browser()
+        br.open('http://localhost/app/')
+        self.assertTrue('WAeUP.Kofa' in br.contents)
+        return
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/utils/__init__.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/utils/__init__.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/utils/__init__.py	(revision 11268)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/utils/lgas.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/utils/lgas.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/utils/lgas.py	(revision 11268)
@@ -0,0 +1,878 @@
+LGAS = (
+    ('abia_aba_north','Abia / Aba North'),
+    ('abia_aba_south','Abia / Aba South'),
+    ('abia_arochukwu','Abia / Arochukwu'),
+    ('abia_bende','Abia / Bende'),
+    ('abia_ikawuno','Abia / Ikawuno'),
+    ('abia_ikwuano','Abia / Ikwuano'),
+    ('abia_isiala-ngwa-north','Abia / Isiala-Ngwa-North'),
+    ('abia_isiala-ngwa-south','Abia / Isiala-Ngwa-South'),
+    ('abia_isikwuato','Abia / Isikwuato'),
+    ('abia_isuikwuato','Abia / Isuikwuato'),
+    ('abia_nneochi','Abia / Nneochi'),
+    ('abia_obi_ngwa','Abia / Obi Ngwa'),
+    ('abia_obioma-ngwa','Abia / Obioma-Ngwa'),
+    ('abia_ohafia','Abia / Ohafia'),
+    ('abia_ohaozara','Abia / Ohaozara'),
+    ('abia_osisioma','Abia / Osisioma'),
+    ('abia_ugwunagbo','Abia / Ugwunagbo'),
+    ('abia_ukwa_west','Abia / Ukwa West'),
+    ('abia_ukwu_east','Abia / Ukwu East'),
+    ('abia_umuahia','Abia / Umuahia'),
+    ('abia_umuahia_south','Abia / Umuahia South'),
+    ('abia_umuahia-north','Abia / Umuahia-North'),
+    ('abuja_abaji','Abuja / Abaji'),
+    ('abuja_amac','Abuja / Amac'),
+    ('abuja_bwari','Abuja / Bwari'),
+    ('abuja_kuje','Abuja / Kuje'),
+    ('abuja_gwagwalada','Abuja / Gwagwalada'),
+    ('abuja_kwali','Abuja / Kwali'),
+    ('abuja_municipal','Abuja / Municipal'),
+    ('adamawa_demsa','Adamawa / Demsa'),
+    ('adamawa_fufore','Adamawa / Fufore'),
+    ('adamawa_ganye','Adamawa / Ganye'),
+    ('adamawa_girei','Adamawa / Girei'),
+    ('adamawa_gombi','Adamawa / Gombi'),
+    ('adamawa_guyuk','Adamawa / Guyuk'),
+    ('adamawa_hong','Adamawa / Hong'),
+    ('adamawa_jada','Adamawa / Jada'),
+    ('adamawa_jimeta','Adamawa / Jimeta'),
+    ('adamawa_lamurde','Adamawa / Lamurde'),
+    ('adamawa_madagali','Adamawa / Madagali'),
+    ('adamawa_maiha','Adamawa / Maiha'),
+    ('adamawa_mayo-belwa','Adamawa / Mayo-Belwa'),
+    ('adamawa_michika','Adamawa / Michika'),
+    ('adamawa_mubi-north','Adamawa / Mubi-North'),
+    ('adamawa_mubi-south','Adamawa / Mubi-South'),
+    ('adamawa_numan','Adamawa / Numan'),
+    ('adamawa_shelleng','Adamawa / Shelleng'),
+    ('adamawa_song','Adamawa / Song'),
+    ('adamawa_toungo','Adamawa / Toungo'),
+    ('adamawa_yola','Adamawa / Yola'),
+    ('akwa_ibom_abak','Akwa Ibom / Abak'),
+    ('akwa_ibom_eastern-obolo','Akwa Ibom / Eastern-Obolo'),
+    ('akwa_ibom_eket','Akwa Ibom / Eket'),
+    ('akwa_ibom_ekpe-atani','Akwa Ibom / Ekpe-Atani'),
+    ('akwa_ibom_esit_ekit','Akwa Ibom / Esit Ekit'),
+    ('akwa_ibom_essien-udim','Akwa Ibom / Essien-Udim'),
+    ('akwa_ibom_etim-ekpo','Akwa Ibom / Etim-Ekpo'),
+    ('akwa_ibom_etinam','Akwa Ibom / Etinam'),
+    ('akwa_ibom_ibeno','Akwa Ibom / Ibeno'),
+    ('akwa_ibom_ibesikpo-asutan','Akwa Ibom / Ibesikpo-Asutan'),
+    ('akwa_ibom_ibiono-ibom','Akwa Ibom / Ibiono-Ibom'),
+    ('akwa_ibom_ika','Akwa Ibom / Ika'),
+    ('akwa_ibom_ikono','Akwa Ibom / Ikono'),
+    ('akwa_ibom_ikot-abasi','Akwa Ibom / Ikot-Abasi'),
+    ('akwa_ibom_ikot-ekpene','Akwa Ibom / Ikot-Ekpene'),
+    ('akwa_ibom_ini','Akwa Ibom / Ini'),
+    ('akwa_ibom_itu','Akwa Ibom / Itu'),
+    ('akwa_ibom_mbo','Akwa Ibom / Mbo'),
+    ('akwa_ibom_mkpat-enin','Akwa Ibom / Mkpat-Enin'),
+    ('akwa_ibom_nsit-ibom','Akwa Ibom / Nsit-Ibom'),
+    ('akwa_ibom_nsit-ubium','Akwa Ibom / Nsit-Ubium'),
+    ('akwa_ibom_obot-akara','Akwa Ibom / Obot-Akara'),
+    ('akwa_ibom_okobo','Akwa Ibom / Okobo'),
+    ('akwa_ibom_onna','Akwa Ibom / Onna'),
+    ('akwa_ibom_oron','Akwa Ibom / Oron'),
+    ('akwa_ibom_oruk_anam','Akwa Ibom / Oruk-Anam'),
+    ('akwa_ibom_udung-uko','Akwa Ibom / Udung-Uko'),
+    ('akwa_ibom_ukanefun','Akwa Ibom / Ukanefun'),
+    ('akwa_ibom_uquo_ibeno','Akwa Ibom / Uquo Ibeno'),
+    ('akwa_ibom_urue-offong-oruko','Akwa Ibom / Urue-Offong-Oruko'),
+    ('akwa_ibom_uruan','Akwa Ibom / Uruan'),
+    ('akwa_ibom_uruk-anam','Akwa Ibom / Uruk-Anam'),
+    ('akwa_ibom_uyo','Akwa Ibom / Uyo'),
+    ('anambra_aguata','Anambra / Aguata'),
+    ('anambra_anambra-east','Anambra / Anambra-East'),
+    ('anambra_anambra-west','Anambra / Anambra-West'),
+    ('anambra_anaocha','Anambra / Anaocha'),
+    ('anambra_awka-north','Anambra / Awka-North'),
+    ('anambra_awka-south','Anambra / Awka-South'),
+    ('anambra_ayamelum','Anambra / Ayamelum'),
+    ('anambra_dunukofia','Anambra / Dunukofia'),
+    ('anambra_ekwusigo','Anambra / Ekwusigo'),
+    ('anambra_idemili','Anambra / Idemili'),
+    ('anambra_idemili-north','Anambra / Idemili-North'),
+    ('anambra_idemili-south','Anambra / Idemili-South'),
+    ('anambra_ihiala','Anambra / Ihiala'),
+    ('anambra_nibo','Anambra / Nibo'),
+    ('anambra_njikoka','Anambra / Njikoka'),
+    ('anambra_nnewi','Anambra / Nnewi'),
+    ('anambra_nnewi-north','Anambra / Nnewi-North'),
+    ('anambra_nnewi-south','Anambra / Nnewi-South'),
+    ('anambra_ogbaru','Anambra / Ogbaru'),
+    ('anambra_olumba','Anambra / Olumba'),
+    ('anambra_onitsha-north','Anambra / Onitsha-North'),
+    ('anambra_onitsha-south','Anambra / Onitsha-South'),
+    ('anambra_orumba-north','Anambra / Orumba-North'),
+    ('anambra_orumba-south','Anambra / Orumba-South'),
+    ('anambra_oti','Anambra / Oti'),
+    ('anambra_oyi','Anambra / Oyi'),
+    ('anambra_ubuluizor-ihiala','Anambra / Ubuluizor-Ihiala'),
+    ('anambra_uyi','Anambra / Uyi'),
+    ('bauchi_alkaleri','Bauchi / Alkaleri'),
+    ('bauchi_bauchi','Bauchi / Bauchi'),
+    ('bauchi_bogoro','Bauchi / Bogoro'),
+    ('bauchi_damban','Bauchi / Damban'),
+    ('bauchi_darazo','Bauchi / Darazo'),
+    ('bauchi_dass','Bauchi / Dass'),
+    ('bauchi_gamawa','Bauchi / Gamawa'),
+    ('bauchi_ganjuwa','Bauchi / Ganjuwa'),
+    ('bauchi_giade','Bauchi / Giade'),
+    ('bauchi_itas/gadau','Bauchi / Itas/Gadau'),
+    ('bauchi_jamaare','Bauchi / Jamaare'),
+    ('bauchi_katagum','Bauchi / Katagum'),
+    ('bauchi_kirfi','Bauchi / Kirfi'),
+    ('bauchi_misau','Bauchi / Misau'),
+    ('bauchi_ningi','Bauchi / Ningi'),
+    ('bauchi_shira','Bauchi / Shira'),
+    ('bauchi_tafawa-balewa','Bauchi / Tafawa-Balewa'),
+    ('bauchi_toro','Bauchi / Toro'),
+    ('bauchi_warji','Bauchi / Warji'),
+    ('bauchi_zaki','Bauchi / Zaki'),
+    ('bayelsa_brass','Bayelsa / Brass'),
+    ('bayelsa_ekeremor','Bayelsa / Ekeremor'),
+    ('bayelsa_kembe','Bayelsa / Kembe'),
+    ('bayelsa_kolokuma','Bayelsa / Kolokuma'),
+    ('bayelsa_kolokuma/opkuma','Bayelsa / Kolokuma/Opkuma'),
+    ('bayelsa_nembe','Bayelsa / Nembe'),
+    ('bayelsa_ogbia','Bayelsa / Ogbia'),
+    ('bayelsa_sagbama','Bayelsa / Sagbama'),
+    ('bayelsa_southern-ijaw','Bayelsa / Southern-Ijaw'),
+    ('bayelsa_toru-abubo','Bayelsa / Toru-Abubo'),
+    ('bayelsa_yenegoa','Bayelsa / Yenegoa'),
+    ('benue_ado','Benue / Ado'),
+    ('benue_agatu','Benue / Agatu'),
+    ('benue_apa','Benue / Apa'),
+    ('benue_buruku','Benue / Buruku'),
+    ('benue_gboko','Benue / Gboko'),
+    ('benue_guma','Benue / Guma'),
+    ('benue_gwer-east','Benue / Gwer-East'),
+    ('benue_gwer-west','Benue / Gwer-West'),
+    ('benue_katsina-ala','Benue / Katsina-Ala'),
+    ('benue_konshisha','Benue / Konshisha'),
+    ('benue_kwande','Benue / Kwande'),
+    ('benue_logo','Benue / Logo'),
+    ('benue_makurdi','Benue / Makurdi'),
+    ('benue_ogbadibo','Benue / Ogbadibo'),
+    ('benue_ohimini','Benue / Ohimini'),
+    ('benue_oju','Benue / Oju'),
+    ('benue_okpokwu','Benue / Okpokwu'),
+    ('benue_otukpo','Benue / Otukpo'),
+    ('benue_oturkpa','Benue / Oturkpa'),
+    ('benue_tarka','Benue / Tarka'),
+    ('benue_ukum','Benue / Ukum'),
+    ('benue_ushongo','Benue / Ushongo'),
+    ('benue_vandeikya','Benue / Vandeikya'),
+    ('borno_abadan','Borno / Abadan'),
+    ('borno_askira-uba','Borno / Askira-Uba'),
+    ('borno_bama','Borno / Bama'),
+    ('borno_bayo','Borno / Bayo'),
+    ('borno_biu','Borno / Biu'),
+    ('borno_chibok','Borno / Chibok'),
+    ('borno_damboa','Borno / Damboa'),
+    ('borno_dikwa','Borno / Dikwa'),
+    ('borno_gubio','Borno / Gubio'),
+    ('borno_guzamala','Borno / Guzamala'),
+    ('borno_gwoza','Borno / Gwoza'),
+    ('borno_hawul','Borno / Hawul'),
+    ('borno_jere','Borno / Jere'),
+    ('borno_kaga','Borno / Kaga'),
+    ('borno_kala/balge','Borno / Kala/Balge'),
+    ('borno_konduga','Borno / Konduga'),
+    ('borno_kukawa','Borno / Kukawa'),
+    ('borno_kwaya-kusar','Borno / Kwaya-Kusar'),
+    ('borno_mafa','Borno / Mafa'),
+    ('borno_magumeri','Borno / Magumeri'),
+    ('borno_maiduguri','Borno / Maiduguri'),
+    ('borno_marte','Borno / Marte'),
+    ('borno_mobbar','Borno / Mobbar'),
+    ('borno_mongunu','Borno / Mongunu'),
+    ('borno_ngala','Borno / Ngala'),
+    ('borno_nganzai','Borno / Nganzai'),
+    ('borno_shani','Borno / Shani'),
+    ('cross_river_abi','Cross River / Abi'),
+    ('cross_river_abuochichie','Cross River / Abuochichie'),
+    ('cross_river_akamkpa','Cross River / Akamkpa'),
+    ('cross_river_akpabuyo','Cross River / Akpabuyo'),
+    ('cross_river_bakassi','Cross River / Bakassi'),
+    ('cross_river_bekwara','Cross River / Bekwara'),
+    ('cross_river_biasi','Cross River / Biasi'),
+    ('cross_river_boki','Cross River / Boki'),
+    ('cross_river_calabar-municipal','Cross River / Calabar-Municipal'),
+    ('cross_river_calabar-south','Cross River / Calabar-South'),
+    ('cross_river_etunk','Cross River / Etunk'),
+    ('cross_river_ikom','Cross River / Ikom'),
+    ('cross_river_obanliku','Cross River / Obanliku'),
+    ('cross_river_obubra','Cross River / Obubra'),
+    ('cross_river_obudu','Cross River / Obudu'),
+    ('cross_river_odukpani','Cross River / Odukpani'),
+    ('cross_river_ogoja','Cross River / Ogoja'),
+    ('cross_river_ugep-north','Cross River / Ugep-North'),
+    ('cross_river_yakurr','Cross River / Yakurr'),
+    ('cross_river_yala','Cross River / Yala'),
+    ('delta_aniocha-north','Delta / Aniocha-North'),
+    ('delta_aniocha-south','Delta / Aniocha-South'),
+    ('delta_bomadi','Delta / Bomadi'),
+    ('delta_burutu','Delta / Burutu'),
+    ('delta_effurun','Delta / Effurun'),
+    ('delta_ethiope-east','Delta / Ethiope-East'),
+    ('delta_ethiope-west','Delta / Ethiope-West'),
+    ('delta_idu','Delta / Idu'),
+    ('delta_ika-ne','Delta / Ika-Ne'),
+    ('delta_ika-north-east','Delta / Ika-North-East'),
+    ('delta_ika-south','Delta / Ika-South'),
+    ('delta_idemili-south','Delta / Idemili-South'),
+    ('delta_isoko-north','Delta / Isoko-North'),
+    ('delta_isoko-south','Delta / Isoko-South'),
+    ('delta_ndokwa-east','Delta / Ndokwa-East'),
+    ('delta_ndokwa-north','Delta / Ndokwa-North'),
+    ('delta_ndokwa-south','Delta / Ndokwa-South'),
+    ('delta_ndokwa-west','Delta / Ndokwa-West'),
+    ('delta_okpe','Delta / Okpe'),
+    ('delta_okwuani','Delta / Okwuani'),
+    ('delta_oleh','Delta / Oleh'),
+    ('delta_oshielli-north','Delta / Oshielli-North'),
+    ('delta_oshimili','Delta / Oshimili'),
+    ('delta_oshimili-north','Delta / Oshimili-North'),
+    ('delta_oshimili-south','Delta / Oshimili-South'),
+    ('delta_patani','Delta / Patani'),
+    ('delta_sapele','Delta / Sapele'),
+    ('delta_udokwa','Delta / Udokwa'),
+    ('delta_udu','Delta / Udu'),
+    ('delta_ughelli-north','Delta / Ughelli-North'),
+    ('delta_ughelli-south','Delta / Ughelli-South'),
+    ('delta_ukwuani','Delta / Ukwuani'),
+    ('delta_urwie','Delta / Urwie'),
+    ('delta_uvie','Delta / Uvie'),
+    ('delta_uvwei','Delta / Uvwei'),
+    ('delta_uvwie','Delta / Uvwie'),
+    ('delta_warri-central','Delta / Warri-Central'),
+    ('delta_warri-north','Delta / Warri-North'),
+    ('delta_warri-south','Delta / Warri-South'),
+    ('delta_warri-south-west','Delta / Warri-South-West'),
+    ('ebonyi_abakaliki','Ebonyi / Abakaliki'),
+    ('ebonyi_afikpo-north','Ebonyi / Afikpo-North'),
+    ('ebonyi_afikpo-south','Ebonyi / Afikpo-South'),
+    ('ebonyi_bomadim','Ebonyi / Bomadim'),
+    ('ebonyi_ebonyi','Ebonyi / Ebonyi'),
+    ('ebonyi_ezza-north','Ebonyi / Ezza-North'),
+    ('ebonyi_ezza-south','Ebonyi / Ezza-South'),
+    ('ebonyi_ikwo','Ebonyi / Ikwo'),
+    ('ebonyi_ishielu','Ebonyi / Ishielu'),
+    ('ebonyi_ivo','Ebonyi / Ivo'),
+    ('ebonyi_izzi','Ebonyi / Izzi'),
+    ('ebonyi_obaukwu','Ebonyi / Obaukwu'),
+    ('ebonyi_ohakwu','Ebonyi / Ohakwu'),
+    ('ebonyi_ohaozara','Ebonyi / Ohaozara'),
+    ('ebonyi_onicha','Ebonyi / Onicha'),
+    ('ebonyi_ukaba','Ebonyi / Ukaba'),
+    ('edo_afokpella','Edo / Afokpella'),
+    ('edo_afuze','Edo / Afuze'),
+    ('edo_agbazilo','Edo / Agbazilo'),
+    ('edo_akoko-edo','Edo / Akoko-Edo'),
+    ('edo_egor','Edo / Egor'),
+    ('edo_esan-central','Edo / Esan-Central'),
+    ('edo_esan-north-east','Edo / Esan-North-East'),
+    ('edo_esan-north-west','Edo / Esan-North-West'),
+    ('edo_esan-south-east','Edo / Esan-South-East'),
+    ('edo_esan-west','Edo / Esan-West'),
+    ('edo_etsako-central','Edo / Etsako-Central'),
+    ('edo_etsako-east','Edo / Etsako-East'),
+    ('edo_etsako-west','Edo / Etsako-West'),
+    ('edo_igueben','Edo / Igueben'),
+    ('edo_ikpoba-okha','Edo / Ikpoba-Okha'),
+    ('edo_ohunmwode','Edo / Ohunmwode'),
+    ('edo_ologbo','Edo / Ologbo'),
+    ('edo_opoji_irrua','Edo / Opoji Irrua'),
+    ('edo_oredo','Edo / Oredo'),
+    ('edo_orhionmwon','Edo / Orhionmwon'),
+    ('edo_ovia-north-east','Edo / Ovia-North-East'),
+    ('edo_ovia-north-west','Edo / Ovia-North-West'),
+    ('edo_ovia-south-east','Edo / Ovia-South-East'),
+    ('edo_ovia-south-west','Edo / Ovia-South-West'),
+    ('edo_owan','Edo / Owan'),
+    ('edo_owan-east','Edo / Owan-East'),
+    ('edo_owan-west','Edo / Owan-West'),
+    ('edo_ubiaja','Edo / Ubiaja'), 
+    ('edo_uhunmwonde','Edo / Uhunmwonde'),
+    ('ekiti_ado-ekiti','Ekiti / Ado-Ekiti'),
+    ('ekiti_aiyekire','Ekiti / Aiyekire'),
+    ('ekiti_efon','Ekiti / Efon'),
+    ('ekiti_ekiti-east','Ekiti / Ekiti-East'),
+    ('ekiti_ekiti-south-west','Ekiti / Ekiti-South-West'),
+    ('ekiti_ekiti-west','Ekiti / Ekiti-West'),
+    ('ekiti_emure/ise/orun','Ekiti / Emure/Ise/Orun'),
+    ('ekiti_gbonyin','Ekiti / Gbonyin'),
+    ('ekiti_ido-osi','Ekiti / Ido-Osi'),
+    ('ekiti_ijero','Ekiti / Ijero'),
+    ('ekiti_ikare','Ekiti / Ikare'),
+    ('ekiti_ikere','Ekiti / Ikere'),
+    ('ekiti_ikole','Ekiti / Ikole'),
+    ('ekiti_ilejemeje','Ekiti / Ilejemeje'),
+    ('ekiti_irepodun/ifelodun','Ekiti / Irepodun/Ifelodun'),
+    ('ekiti_ise-orun','Ekiti / Ise-Orun'),
+    ('ekiti_moba','Ekiti / Moba'),
+    ('ekiti_oye','Ekiti / Oye'),
+    ('enugu_aninri','Enugu / Aninri'),
+    ('enugu_awgu','Enugu / Awgu'),
+    ('enugu_enugu-east','Enugu / Enugu-East'),
+    ('enugu_enugu-north','Enugu / Enugu-North'),
+    ('enugu_enugu-south','Enugu / Enugu-South'),
+    ('enugu_ezeagu','Enugu / Ezeagu'),
+    ('enugu_igbo-etiti','Enugu / Igbo-Etiti'),
+    ('enugu_igbo-eze-north','Enugu / Igbo-Eze-North'),
+    ('enugu_igbo-eze-south','Enugu / Igbo-Eze-South'),
+    ('enugu_isi-uzo','Enugu / Isi-Uzo'),
+    ('enugu_nkanu-east','Enugu / Nkanu-East'),
+    ('enugu_nkanu-central','Enugu / Nkanu-Central'),
+    ('enugu_nkanu-west','Enugu / Nkanu-West'),
+    ('enugu_nsukka','Enugu / Nsukka'),
+    ('enugu_nukanu_east','Enugu / Nukanu East'),
+    ('enugu_oji-river','Enugu / Oji-River'),
+    ('enugu_udenu','Enugu / Udenu'),
+    ('enugu_udi','Enugu / Udi'),
+    ('enugu_uzo-uwani','Enugu / Uzo-Uwani'),
+    ('gombe_akko','Gombe / Akko'),
+    ('gombe_balanga','Gombe / Balanga'),
+    ('gombe_billiri','Gombe / Billiri'),
+    ('gombe_dukku','Gombe / Dukku'),
+    ('gombe_funakaye','Gombe / Funakaye'),
+    ('gombe_gombe','Gombe / Gombe'),
+    ('gombe_kaltungo','Gombe / Kaltungo'),
+    ('gombe_kwami','Gombe / Kwami'),
+    ('gombe_nafada/bajoga','Gombe / Nafada/Bajoga'),
+    ('gombe_shomgom','Gombe / Shomgom'),
+    ('gombe_yamaltu/deba','Gombe / Yamaltu/Deba'),
+    ('imo_aboh-mbaise','Imo / Aboh-Mbaise'),
+    ('imo_ahiazu-mbaise','Imo / Ahiazu-Mbaise'),
+    ('imo_dral-esat','Imo / Dral-Esat'),
+    ('imo_ehime-mbano','Imo / Ehime-Mbano'),
+    ('imo_ezinihitte','Imo / Ezinihitte'),
+    ('imo_ideato','Imo / Ideato'),
+    ('imo_ideato-north','Imo / Ideato-North'),
+    ('imo_ideato-south','Imo / Ideato-South'),
+    ('imo_ihitte/uboma','Imo / Ihitte/Uboma'),
+    ('imo_ikeduru','Imo / Ikeduru'),
+    ('imo_isiala-mbano','Imo / Isiala-Mbano'),
+    ('imo_isu','Imo / Isu'),
+    ('imo_mbaitoli','Imo / Mbaitoli'),
+    ('imo_mbano','Imo / Mbano'),
+    ('imo_ngor-okpala','Imo / Ngor-Okpala'),
+    ('imo_njaba','Imo / Njaba'),
+    ('imo_nkwerre','Imo / Nkwerre'),
+    ('imo_nwangele','Imo / Nwangele'),
+    ('imo_obowo','Imo / Obowo'),
+    ('imo_oguta','Imo / Oguta'),
+    ('imo_ohaji-egbema','Imo / Ohaji-Egbema'),
+    ('imo_okigwe','Imo / Okigwe'),
+    ('imo_onuimo','Imo / Onuimo'),
+    ('imo_orlu','Imo / Orlu'),
+    ('imo_orsu','Imo / Orsu'),
+    ('imo_oru-east','Imo / Oru-East'),
+    ('imo_oru-west','Imo / Oru-West'),
+    ('imo_owerri-municipal','Imo / Owerri-Municipal'),
+    ('imo_owerri-north','Imo / Owerri-North'),
+    ('imo_owerri-west','Imo / Owerri-West'),
+    ('imo_ugiri-ike_ikeduru','Imo / Ugiri-Ike Ikeduru'),
+    ('imo_ugiri-ikedikeduru','Imo / Ugiri-Ikedikeduru'),
+    ('imo_unbano','Imo / Unbano'),
+    ('imo_zinihitte','Imo / Zinihitte'),
+    ('jigawa_auyo','Jigawa / Auyo'),
+    ('jigawa_babura','Jigawa / Babura'),
+    ('jigawa_biriniwa','Jigawa / Biriniwa'),
+    ('jigawa_birnin-kudu','Jigawa / Birnin-Kudu'),
+    ('jigawa_bosuwa','Jigawa / Bosuwa'),
+    ('jigawa_buji','Jigawa / Buji'),
+    ('jigawa_dutse','Jigawa / Dutse'),
+    ('jigawa_gagarawa','Jigawa / Gagarawa'),
+    ('jigawa_garki','Jigawa / Garki'),
+    ('jigawa_gumel','Jigawa / Gumel'),
+    ('jigawa_guri','Jigawa / Guri'),
+    ('jigawa_gwaram','Jigawa / Gwaram'),
+    ('jigawa_gwiwa','Jigawa / Gwiwa'),
+    ('jigawa_hadejia','Jigawa / Hadejia'),
+    ('jigawa_jahun','Jigawa / Jahun'),
+    ('jigawa_kafin-hausa','Jigawa / Kafin-Hausa'),
+    ('jigawa_kaugama','Jigawa / Kaugama'),
+    ('jigawa_kazaure','Jigawa / Kazaure'),
+    ('jigawa_kirkasamma','Jigawa / Kirkasamma'),
+    ('jigawa_maigatari','Jigawa / Maigatari'),
+    ('jigawa_malam-maduri','Jigawa / Malam-Maduri'),
+    ('jigawa_miga','Jigawa / Miga'),
+    ('jigawa_ringim','Jigawa / Ringim'),
+    ('jigawa_roni','Jigawa / Roni'),
+    ('jigawa_sule-tankarkar','Jigawa / Sule-Tankarkar'),
+    ('jigawa_taura','Jigawa / Taura'),
+    ('jigawa_yankwashi','Jigawa / Yankwashi'),
+    ('kaduna_birnin-gwari','Kaduna / Birnin-Gwari'),
+    ('kaduna_chikun','Kaduna / Chikun'),
+    ('kaduna_giwa','Kaduna / Giwa'),
+    ('kaduna_gwagwada','Kaduna / Gwagwada'),
+    ('kaduna_igabi','Kaduna / Igabi'),
+    ('kaduna_ikara','Kaduna / Ikara'),
+    ('kaduna_jaba','Kaduna / Jaba'),
+    ('kaduna_jemaa','Kaduna / Jemaa'),
+    ('kaduna_kachia','Kaduna / Kachia'),
+    ('kaduna_kaduna-north','Kaduna / Kaduna-North'),
+    ('kaduna_kagarko','Kaduna / Kagarko'),
+    ('kaduna_kajuru','Kaduna / Kajuru'),
+    ('kaduna_kaura','Kaduna / Kaura'),
+    ('kaduna_kauru','Kaduna / Kauru'),
+    ('kaduna_koka/kawo','Kaduna / Koka/Kawo'),
+    ('kaduna_kubah','Kaduna / Kubah'),
+    ('kaduna_kudan','Kaduna / Kudan'),
+    ('kaduna_lere','Kaduna / Lere'),
+    ('kaduna_makarfi','Kaduna / Makarfi'),
+    ('kaduna_sabon-gari','Kaduna / Sabon-Gari'),
+    ('kaduna_sanga','Kaduna / Sanga'),
+    ('kaduna_soba','Kaduna / Soba'),
+    ('kaduna_tudun-wada/makera','Kaduna / Tudun-Wada/Makera'),
+    ('kaduna_zango-kataf','Kaduna / Zango-Kataf'),
+    ('kaduna_zaria','Kaduna / Zaria'),
+    ('kano_ajingi','Kano / Ajingi'),
+    ('kano_albasu','Kano / Albasu'),
+    ('kano_bagwai','Kano / Bagwai'),
+    ('kano_bebeji','Kano / Bebeji'),
+    ('kano_bichi','Kano / Bichi'),
+    ('kano_bunkure','Kano / Bunkure'),
+    ('kano_dala','Kano / Dala'),
+    ('kano_dambatta','Kano / Dambatta'),
+    ('kano_dawakin-kudu','Kano / Dawakin-Kudu'),
+    ('kano_dawakin-tofa','Kano / Dawakin-Tofa'),
+    ('kano_doguwa','Kano / Doguwa'),
+    ('kano_fagge','Kano / Fagge'),
+    ('kano_gabasawa','Kano / Gabasawa'),
+    ('kano_garko','Kano / Garko'),
+    ('kano_garun-mallam','Kano / Garun-Mallam'),
+    ('kano_gaya','Kano / Gaya'),
+    ('kano_gezawa','Kano / Gezawa'),
+    ('kano_gwale','Kano / Gwale'),
+    ('kano_gwarzo','Kano / Gwarzo'),
+    ('kano_kano-municipal','Kano / Kano-Municipal'),
+    ('kano_karaye','Kano / Karaye'),
+    ('kano_kibiya','Kano / Kibiya'),
+    ('kano_kiru','Kano / Kiru'),
+    ('kano_kumbotso','Kano / Kumbotso'),
+    ('kano_kunchi','Kano / Kunchi'),
+    ('kano_kura','Kano / Kura'),
+    ('kano_madobi','Kano / Madobi'),
+    ('kano_makoda','Kano / Makoda'),
+    ('kano_minjibir','Kano / Minjibir'),
+    ('kano_nasarawa','Kano / Nasarawa'),
+    ('kano_rano','Kano / Rano'),
+    ('kano_rimin-gado','Kano / Rimin-Gado'),
+    ('kano_rogo','Kano / Rogo'),
+    ('kano_shanono','Kano / Shanono'),
+    ('kano_sumaila','Kano / Sumaila'),
+    ('kano_takai','Kano / Takai'),
+    ('kano_tarauni','Kano / Tarauni'),
+    ('kano_tofa','Kano / Tofa'),
+    ('kano_tsanyawa','Kano / Tsanyawa'),
+    ('kano_tudun-wada','Kano / Tudun-Wada'),
+    ('kano_ungogo','Kano / Ungogo'),
+    ('kano_warawa','Kano / Warawa'),
+    ('kano_wudil','Kano / Wudil'),
+    ('katsina_bakori','Katsina / Bakori'),
+    ('katsina_batagarawa','Katsina / Batagarawa'),
+    ('katsina_batsari','Katsina / Batsari'),
+    ('katsina_baure','Katsina / Baure'),
+    ('katsina_bindawa','Katsina / Bindawa'),
+    ('katsina_charanchi','Katsina / Charanchi'),
+    ('katsina_dan-musa','Katsina / Dan-Musa'),
+    ('katsina_dandume','Katsina / Dandume'),
+    ('katsina_danji','Katsina / Danji'),
+    ('katsina_daura','Katsina / Daura'),
+    ('katsina_dutsi','Katsina / Dutsi'),
+    ('katsina_dutsinma','Katsina / Dutsinma'),
+    ('katsina_faskari','Katsina / Faskari'),
+    ('katsina_funtua','Katsina / Funtua'),
+    ('katsina_ingawa','Katsina / Ingawa'),
+    ('katsina_jibia','Katsina / Jibia'),
+    ('katsina_kafur','Katsina / Kafur'),
+    ('katsina_kaita','Katsina / Kaita'),
+    ('katsina_kankara','Katsina / Kankara'),
+    ('katsina_kankia','Katsina / Kankia'),
+    ('katsina_katsina','Katsina / Katsina'),
+    ('katsina_kurfi','Katsina / Kurfi'),
+    ('katsina_kusada','Katsina / Kusada'),
+    ('katsina_mai-adua','Katsina / Mai-Adua'),
+    ('katsina_malumfashi','Katsina / Malumfashi'),
+    ('katsina_mani','Katsina / Mani'),
+    ('katsina_mashi','Katsina / Mashi'),
+    ('katsina_matazu','Katsina / Matazu'),
+    ('katsina_musawa','Katsina / Musawa'),
+    ('katsina_rimi','Katsina / Rimi'),
+    ('katsina_sabuwa','Katsina / Sabuwa'),
+    ('katsina_safana','Katsina / Safana'),
+    ('katsina_sandamu','Katsina / Sandamu'),
+    ('katsina_zango','Katsina / Zango'),
+    ('kebbi_aleiro','Kebbi / Aleiro'),
+    ('kebbi_arewa-dandi','Kebbi / Arewa-Dandi'),
+    ('kebbi_argungu','Kebbi / Argungu'),
+    ('kebbi_augie','Kebbi / Augie'),
+    ('kebbi_bagudo','Kebbi / Bagudo'),
+    ('kebbi_birnin-kebbi','Kebbi / Birnin-Kebbi'),
+    ('kebbi_bumza','Kebbi / Bumza'),
+    ('kebbi_dandi','Kebbi / Dandi'),
+    ('kebbi_danko','Kebbi / Danko'),
+    ('kebbi_fakai','Kebbi / Fakai'),
+    ('kebbi_gwandu','Kebbi / Gwandu'),
+    ('kebbi_jega','Kebbi / Jega'),
+    ('kebbi_kalgo','Kebbi / Kalgo'),
+    ('kebbi_koko-besse','Kebbi / Koko-Besse'),
+    ('kebbi_maiyama','Kebbi / Maiyama'),
+    ('kebbi_ngaski','Kebbi / Ngaski'),
+    ('kebbi_sakaba','Kebbi / Sakaba'),
+    ('kebbi_shanga','Kebbi / Shanga'),
+    ('kebbi_suru','Kebbi / Suru'),
+    ('kebbi_wasagu','Kebbi / Wasagu'),
+    ('kebbi_yauri','Kebbi / Yauri'),
+    ('kebbi_zuru','Kebbi / Zuru'),
+    ('kogi_adavi','Kogi / Adavi'),
+    ('kogi_ajaokuta','Kogi / Ajaokuta'),
+    ('kogi_ankpa','Kogi / Ankpa'),
+    ('kogi_bassa','Kogi / Bassa'),
+    ('kogi_dekina','Kogi / Dekina'),
+    ('kogi_ibaji','Kogi / Ibaji'),
+    ('kogi_idah','Kogi / Idah'),
+    ('kogi_igalamela','Kogi / Igalamela'),
+    ('kogi_ijumu','Kogi / Ijumu'),
+    ('kogi_ikoyi-ijumu','Kogi / Ikoyi-Ijumu'),
+    ('kogi_kabba/bunu','Kogi / Kabba/Bunu'),
+    ('kogi_kogi','Kogi / Kogi'),
+    ('kogi_lokoja','Kogi / Lokoja'),
+    ('kogi_mopa-muro','Kogi / Mopa-Muro'),
+    ('kogi_obaji','Kogi / Obaji'),
+    ('kogi_ofu','Kogi / Ofu'),
+    ('kogi_ogori/magongo','Kogi / Ogori/Magongo'),
+    ('kogi_okehi','Kogi / Okehi'),
+    ('kogi_okene','Kogi / Okene'),
+    ('kogi_olamaboro','Kogi / Olamaboro'),
+    ('kogi_omala','Kogi / Omala'),
+    ('kogi_oru','Kogi / Oru'),
+    ('kogi_oyi','Kogi / Oyi'),
+    ('kogi_yagba-east','Kogi / Yagba-East'),
+    ('kogi_yagba-west','Kogi / Yagba-West'),
+    ('kwara_asa','Kwara / Asa'),
+    ('kwara_baruten','Kwara / Baruten'),
+    ('kwara_edu','Kwara / Edu'),
+    ('kwara_ekiti','Kwara / Ekiti'),
+    ('kwara_ilorin-east','Kwara / Ilorin-East'),
+    ('kwara_ilorin-south','Kwara / Ilorin-South'),
+    ('kwara_ilorin-west','Kwara / Ilorin-West'),
+    ('kwara_isin','Kwara / Isin'),
+    ('kwara_kaiama','Kwara / Kaiama'),
+    ('kwara_moro','Kwara / Moro'),
+    ('kwara_offa','Kwara / Offa'),
+    ('kwara_oke-ero','Kwara / Oke-Ero'),
+    ('kwara_oyun','Kwara / Oyun'),
+    ('kwara_pategi','Kwara / Pategi'),
+    ('kwara_ifelodun','Kwara / Ifelodun'),
+    ('kwara_irepodun','Kwara / Irepodun'),
+    ('lagos_agege','Lagos / Agege'),
+    ('lagos_ajeromi-ifelodun','Lagos / Ajeromi-Ifelodun'),
+    ('lagos_alimosho','Lagos / Alimosho'),
+    ('lagos_amuwo-odofin','Lagos / Amuwo-Odofin'),
+    ('lagos_apapa','Lagos / Apapa'),
+    ('lagos_badagry','Lagos / Badagry'),
+    ('lagos_epe','Lagos / Epe'),
+    ('lagos_eti-osa','Lagos / Eti-Osa'),
+    ('lagos_ibeju-lekki','Lagos / Ibeju-Lekki'),
+    ('lagos_ifako-ijaiye','Lagos / Ifako-Ijaiye'),
+    ('lagos_ikeja','Lagos / Ikeja'),
+    ('lagos_ikorodu','Lagos / Ikorodu'),
+    ('lagos_island','Lagos / Island'),
+    ('lagos_kosofe','Lagos / Kosofe'),
+    ('lagos_lagos-island','Lagos / Lagos-Island'),
+    ('lagos_lagos-mainland','Lagos / Lagos-Mainland'),
+    ('lagos_mushin','Lagos / Mushin'),
+    ('lagos_ojo','Lagos / Ojo'),
+    ('lagos_oshodi-isolo','Lagos / Oshodi-Isolo'),
+    ('lagos_shomolu','Lagos / Shomolu'),
+    ('lagos_somolu','Lagos / Somolu'),
+    ('lagos_suru-lere','Lagos / Suru-Lere'),
+    ('nassarawa_akwanga','Nassarawa / Akwanga'),
+    ('nassarawa_awe','Nassarawa / Awe'),
+    ('nassarawa_doma','Nassarawa / Doma'),
+    ('nassarawa_karu','Nassarawa / Karu'),
+    ('nassarawa_keana','Nassarawa / Keana'),
+    ('nassarawa_keffi','Nassarawa / Keffi'),
+    ('nassarawa_kokona','Nassarawa / Kokona'),
+    ('nassarawa_lafia','Nassarawa / Lafia'),
+    ('nassarawa_nassawara','Nassarawa / Nassawara'),
+    ('nassarawa_nassawara_eggon','Nassarawa / Nassawara Eggon'),
+    ('nassarawa_obi','Nassarawa / Obi'),
+    ('nassarawa_toto','Nassarawa / Toto'),
+    ('nassarawa_wambu','Nassarawa / Wambu'),
+    ('niger_agaie','Niger / Agaie'),
+    ('niger_agwara','Niger / Agwara'),
+    ('niger_bida','Niger / Bida'),
+    ('niger_borgu','Niger / Borgu'),
+    ('niger_bosso','Niger / Bosso'),
+    ('niger_chanchaga','Niger / Chanchaga'),
+    ('niger_edati','Niger / Edati'),
+    ('niger_gbako','Niger / Gbako'),
+    ('niger_gurara','Niger / Gurara'),
+    ('niger_katcha','Niger / Katcha'),
+    ('niger_kontagora','Niger / Kontagora'),
+    ('niger_lapai','Niger / Lapai'),
+    ('niger_lavun','Niger / Lavun'),
+    ('niger_magama','Niger / Magama'),
+    ('niger_mariga','Niger / Mariga'),
+    ('niger_mashegu','Niger / Mashegu'),
+    ('niger_mokwa','Niger / Mokwa'),
+    ('niger_muya','Niger / Muya'),
+    ('niger_paikoro','Niger / Paikoro'),
+    ('niger_rafi','Niger / Rafi'),
+    ('niger_rijau','Niger / Rijau'),
+    ('niger_shiroro','Niger / Shiroro'),
+    ('niger_suleja','Niger / Suleja'),
+    ('niger_tafa','Niger / Tafa'),
+    ('niger_wushishi','Niger / Wushishi'),
+    ('ogun_abeokuta-north','Ogun / Abeokuta-North'),
+    ('ogun_abeokuta-south','Ogun / Abeokuta-South'),
+    ('ogun_ado-odo/ota','Ogun / Ado-Odo/Ota'),
+    ('ogun_adoodo-ota','Ogun / Adoodo-Ota'),
+    ('ogun_ewekoro','Ogun / Ewekoro'),
+    ('ogun_idarapo','Ogun / Idarapo'),
+    ('ogun_iffo-otta','Ogun / Iffo-Otta'),
+    ('ogun_ifo','Ogun / Ifo'),
+    ('ogun_igbado-north','Ogun / Igbado-North'),
+    ('ogun_igbado-south','Ogun / Igbado-South'),
+    ('ogun_ijebu-east','Ogun / Ijebu-East'),
+    ('ogun_ijebu-north','Ogun / Ijebu-North'),
+    ('ogun_ijebu-north-east','Ogun / Ijebu-North-East'),
+    ('ogun_ijebu-ode','Ogun / Ijebu-Ode'),
+    ('ogun_ikenne','Ogun / Ikenne'),
+    ('ogun_ilishan_remo','Ogun / Ilishan Remo'),
+    ('ogun_ilugun-alaro','Ogun / Ilugun-Alaro'),
+    ('ogun_imeko-afon','Ogun / Imeko-Afon'),
+    ('ogun_ipokia','Ogun / Ipokia'),
+    ('ogun_lgayekpe_','Ogun / Lgayekpe'),
+    ('ogun_obafemi-owode','Ogun / Obafemi-Owode'),
+    ('ogun_odedah','Ogun / Odedah'),
+    ('ogun_odogbolu','Ogun / Odogbolu'),
+    ('ogun_ogun-waterside','Ogun / Ogun-Waterside'),
+    ('ogun_remo-north','Ogun / Remo-North'),
+    ('ogun_sagamu','Ogun / Sagamu'),
+    ('ogun_yewa','Ogun / Yewa'),
+    ('ondo_akoko','Ondo / Akoko'),
+    ('ondo_akoko-north','Ondo / Akoko-North'),
+    ('ondo_akoko-north-east','Ondo / Akoko-North-East'),
+    ('ondo_akoko-north-west','Ondo / Akoko-North-West'),
+    ('ondo_akoko-south','Ondo / Akoko-South'),
+    ('ondo_akoko-south-east','Ondo / Akoko-South-East'),
+    ('ondo_akoko-south-west','Ondo / Akoko-South-West'),
+    ('ondo_akure','Ondo / Akure'),
+    ('ondo_akure-north','Ondo / Akure-North'),
+    ('ondo_akure-south','Ondo / Akure-South'),
+    ('ondo_ese-odo','Ondo / Ese-Odo'),
+    ('ondo_idanre','Ondo / Idanre'),
+    ('ondo_ifedore','Ondo / Ifedore'),
+    ('ondo_ikale','Ondo / Ikale'),
+    ('ondo_ilaje','Ondo / Ilaje'),
+    ('ondo_ilaje-west','Ondo / Ilaje-West'),
+    ('ondo_ile-oluji-okeigbo','Ondo / Ile-Oluji-Okeigbo'),
+    ('ondo_irele','Ondo / Irele'),
+    ('ondo_odigbo','Ondo / Odigbo'),
+    ('ondo_okiti-pupa','Ondo / Okiti-Pupa'),
+    ('ondo_ondo','Ondo / Ondo'),
+    ('ondo_ondo-east','Ondo / Ondo-East'),
+    ('ondo_ondo-west','Ondo / Ondo-West'),
+    ('ondo_ose','Ondo / Ose'),
+    ('ondo_owo','Ondo / Owo'),
+    ('osun_atakumosa','Osun / Atakumosa'),
+    ('osun_atakumosa_east','Osun / Atakumosa East'),
+    ('osun_ayeda-ade','Osun / Ayeda-Ade'),
+    ('osun_ayedire','Osun / Ayedire'),
+    ('osun_boluwaduro','Osun / Boluwaduro'),
+    ('osun_boripe','Osun / Boripe'),
+    ('osun_ede','Osun / Ede'),
+    ('osun_ede-north','Osun / Ede North'),
+    ('osun_egbedore','Osun / Egbedore'),
+    ('osun_ejigbo','Osun / Ejigbo'),
+    ('osun_ife','Osun / Ife'),
+    ('osun_ife-north','Osun / Ife-North'),
+    ('osun_ife-south','Osun / Ife-South'),
+    ('osun_ife-central','Osun / Ife-Central'),
+    ('osun_ife-east','Osun / Ife-East'),
+    ('osun_ifelodun','Osun / Ifelodun'),
+    ('osun_ila','Osun / Ila'),
+    ('osun_ilesa-east','Osun / Ilesa-East'),
+    ('osun_ilesa-west','Osun / Ilesa-West'),
+    ('osun_ilesha','Osun / Ilesha'),
+    ('osun_ilesha_west','Osun / Ilesha West'),
+    ('osun_irepodun','Osun / Irepodun'),
+    ('osun_irewole','Osun / Irewole'),
+    ('osun_isokan','Osun / Isokan'),
+    ('osun_iwo','Osun / Iwo'),
+    ('osun_obokun','Osun / Obokun'),
+    ('osun_odo-otin','Osun / Odo-Otin'),
+    ('osun_ola_oluwa','Osun / Ola Oluwa'),
+    ('osun_olorunda','Osun / Olorunda'),
+    ('osun_ori-ade','Osun / Ori-Ade'),
+    ('osun_orolu','Osun / Orolu'),
+    ('osun_osogbo','Osun / Osogbo'),
+    ('oyo_afijio','Oyo / Afijio'),
+    ('oyo_akinyele','Oyo / Akinyele'),
+    ('oyo_atiba','Oyo / Atiba'),
+    ('oyo_atigbo','Oyo / Atigbo'),
+    ('oyo_egbeda','Oyo / Egbeda'),
+    ('oyo_ibadan-central','Oyo / Ibadan-Central'),
+    ('oyo_ibadan-north-east','Oyo / Ibadan-North-East'),
+    ('oyo_ibadan-north-west','Oyo / Ibadan-North-West'),
+    ('oyo_ibadan-south-east','Oyo / Ibadan-South-East'),
+    ('oyo_ibadan-south-west','Oyo / Ibadan-South-West'),
+    ('oyo_ibarapa-central','Oyo / Ibarapa-Central'),
+    ('oyo_ibarapa-east','Oyo / Ibarapa-East'),
+    ('oyo_ibarapa-north','Oyo / Ibarapa-North'),
+    ('oyo_ido','Oyo / Ido'),
+    ('oyo_ifedayo','Oyo / Ifedayo'),
+    ('oyo_ifeloju','Oyo / Ifeloju'),
+    ('oyo_irepo','Oyo / Irepo'),
+    ('oyo_iseyin','Oyo / Iseyin'),
+    ('oyo_itseiwaju','Oyo / Itseiwaju'),
+    ('oyo_iwajowa','Oyo / Iwajowa'),
+    ('oyo_kajola','Oyo / Kajola'),
+    ('oyo_lagelu','Oyo / Lagelu'),
+    ('oyo_odo-oluwa','Oyo / Odo-Oluwa'),
+    ('oyo_ogbomosho-north','Oyo / Ogbomosho-North'),
+    ('oyo_ogbomosho-south','Oyo / Ogbomosho-South'),
+    ('oyo_olorunsogo','Oyo / Olorunsogo'),
+    ('oyo_oluyole','Oyo / Oluyole'),
+    ('oyo_ona-ara','Oyo / Ona-Ara'),
+    ('oyo_orelope','Oyo / Orelope'),
+    ('oyo_ori-ire','Oyo / Ori-Ire'),
+    ('oyo_oyo-west','Oyo / Oyo-West'),
+    ('oyo_saki-east','Oyo / Saki-East'),
+    ('oyo_saki-west','Oyo / Saki-West'),
+    ('oyo_surulere','Oyo / Surulere'),
+    ('plateau_barkin-ladi','Plateau / Barkin-Ladi'),
+    ('plateau_bassa','Plateau / Bassa'),
+    ('plateau_bokkos','Plateau / Bokkos'),
+    ('plateau_jos-east','Plateau / Jos-East'),
+    ('plateau_jos-north','Plateau / Jos-North'),
+    ('plateau_jos-south','Plateau / Jos-South'),
+    ('plateau_kanam','Plateau / Kanam'),
+    ('plateau_kanke','Plateau / Kanke'),
+    ('plateau_langtang-north','Plateau / Langtang-North'),
+    ('plateau_langtang-south','Plateau / Langtang-South'),
+    ('plateau_mangu','Plateau / Mangu'),
+    ('plateau_mikang','Plateau / Mikang'),
+    ('plateau_pankshin','Plateau / Pankshin'),
+    ('plateau_quananpan','Plateau / Quananpan'),
+    ('plateau_riyom','Plateau / Riyom'),
+    ('plateau_shendam','Plateau / Shendam'),
+    ('plateau_wase','Plateau / Wase'),
+    ('rivers_aboa/odual','Rivers / Aboa/Odual'),
+    ('rivers_ahoada-east','Rivers / Ahoada-East'),
+    ('rivers_ahoada-west','Rivers / Ahoada-West'),
+    ('rivers_akukutoru','Rivers / Akukutoru'),
+    ('rivers_andoni','Rivers / Andoni'),
+    ('rivers_asari-toru','Rivers / Asari-Toru'),
+    ('rivers_bonny','Rivers / Bonny'),
+    ('rivers_buguma','Rivers / Buguma'),
+    ('rivers_degema','Rivers / Degema'),
+    ('rivers_eleme','Rivers / Eleme'),
+    ('rivers_elfane','Rivers / Elfane'),
+    ('rivers_emuoha','Rivers / Emuoha'),
+    ('rivers_etche','Rivers / Etche'),
+    ('rivers_gokana','Rivers / Gokana'),
+    ('rivers_ikwerre','Rivers / Ikwerre'),
+    ('rivers_khana','Rivers / Khana'),
+    ('rivers_obia/akpor','Rivers / Obia/Akpor'),
+    ('rivers_ogba-egbema-ndoni','Rivers / Ogba-Egbema-Ndoni'),
+    ('rivers_ogu/bolo','Rivers / Ogu/Bolo'),
+    ('rivers_okirika','Rivers / Okirika'),
+    ('rivers_omuma','Rivers / Omuma'),
+    ('rivers_opobo/nkoro','Rivers / Opobo/Nkoro'),
+    ('rivers_oyigbo','Rivers / Oyigbo'),
+    ('rivers_port-harcourt','Rivers / Port-Harcourt'),
+    ('rivers_tai','Rivers / Tai'),
+    ('sokoto_binji','Sokoto / Binji'),
+    ('sokoto_bodinga','Sokoto / Bodinga'),
+    ('sokoto_dange-shuni','Sokoto / Dange-Shuni'),
+    ('sokoto_gada','Sokoto / Gada'),
+    ('sokoto_goronyo','Sokoto / Goronyo'),
+    ('sokoto_gudu','Sokoto / Gudu'),
+    ('sokoto_gwadabawa','Sokoto / Gwadabawa'),
+    ('sokoto_illela','Sokoto / Illela'),
+    ('sokoto_kebbe','Sokoto / Kebbe'),
+    ('sokoto_kware','Sokoto / Kware'),
+    ('sokoto_raba','Sokoto / Raba'),
+    ('sokoto_sabo-birni','Sokoto / Sabo-Birni'),
+    ('sokoto_shagari','Sokoto / Shagari'),
+    ('sokoto_silame','Sokoto / Silame'),
+    ('sokoto_sokoto-north','Sokoto / Sokoto-North'),
+    ('sokoto_sokoto-south','Sokoto / Sokoto-South'),
+    ('sokoto_tambuwal','Sokoto / Tambuwal'),
+    ('sokoto_tangaza','Sokoto / Tangaza'),
+    ('sokoto_tureta','Sokoto / Tureta'),
+    ('sokoto_wamakko','Sokoto / Wamakko'),
+    ('sokoto_wurno','Sokoto / Wurno'),
+    ('sokoto_yabo','Sokoto / Yabo'),
+    ('taraba_ardo-kola','Taraba / Ardo-Kola'),
+    ('taraba_bali','Taraba / Bali'),
+    ('taraba_donga','Taraba / Donga'),
+    ('taraba_gashaka','Taraba / Gashaka'),
+    ('taraba_gassol','Taraba / Gassol'),
+    ('taraba_ibi','Taraba / Ibi'),
+    ('taraba_jalingo','Taraba / Jalingo'),
+    ('taraba_karim-lamido','Taraba / Karim-Lamido'),
+    ('taraba_kurmi','Taraba / Kurmi'),
+    ('taraba_lau','Taraba / Lau'),
+    ('taraba_oilingo','Taraba / Oilingo'),
+    ('taraba_sardauna','Taraba / Sardauna'),
+    ('taraba_takum','Taraba / Takum'),
+    ('taraba_ussa','Taraba / Ussa'),
+    ('taraba_wukari','Taraba / Wukari'),
+    ('taraba_yorro','Taraba / Yorro'),
+    ('taraba_zing','Taraba / Zing'),
+    ('yobe_bade','Yobe / Bade'),
+    ('yobe_borsali','Yobe / Borsali'),
+    ('yobe_damaturu','Yobe / Damaturu'),
+    ('yobe_fika','Yobe / Fika'),
+    ('yobe_fune','Yobe / Fune'),
+    ('yobe_geidam','Yobe / Geidam'),
+    ('yobe_gogaram','Yobe / Gogaram'),
+    ('yobe_gujba','Yobe / Gujba'),
+    ('yobe_gulani','Yobe / Gulani'),
+    ('yobe_jakusko','Yobe / Jakusko'),
+    ('yobe_karasuwa','Yobe / Karasuwa'),
+    ('yobe_machina','Yobe / Machina'),
+    ('yobe_nangere','Yobe / Nangere'),
+    ('yobe_nguru','Yobe / Nguru'),
+    ('yobe_potiskum','Yobe / Potiskum'),
+    ('yobe_tarmua','Yobe / Tarmua'),
+    ('yobe_yunusari','Yobe / Yunusari'),
+    ('zamfara_anka','Zamfara / Anka'),
+    ('zamfara_bakura','Zamfara / Bakura'),
+    ('zamfara_bukkuyum','Zamfara / Bukkuyum'),
+    ('zamfara_bungudu','Zamfara / Bungudu'),
+    ('zamfara_gumi','Zamfara / Gumi'),
+    ('zamfara_gusau','Zamfara / Gusau'),
+    ('zamfara_isa','Zamfara / Isa'),
+    ('zamfara_kaura-namoda','Zamfara / Kaura-Namoda'),
+    ('zamfara_kiyawa','Zamfara / Kiyawa'),
+    ('zamfara_maradun','Zamfara / Maradun'),
+    ('zamfara_maru','Zamfara / Maru'),
+    ('zamfara_shinkafi','Zamfara / Shinkafi'),
+    ('zamfara_talata-mafara','Zamfara / Talata-Mafara'),
+    ('zamfara_tsafe','Zamfara / Tsafe'),
+    ('zamfara_zurmi','Zamfara / Zurmi'),
+    ('osun_aiyedire','Osun / Aiyedire'),
+    ('cross_river_biase','Cross River / Biase'),
+    ('ogun_egbado-north','Ogun / Egbado-North'),
+    ('ogun_egbado-south','Ogun / Egbado-South'),
+    ('oyo_itesiwaju','Oyo / Itesiwaju'),
+    ('oyo_ogo-oluwa','Oyo / Ogo-Oluwa'),
+    ('ebonyi_ohaukwu','Ebonyi / Ohaukwu'),
+    ('ondo_okitipupa','Ondo / Okitipupa'),
+    ('osun_oriade','Osun / Oriade'),
+    ('benue_oturkpo','Benue / Oturkpo'),
+    ('oyo_oyo-east','Oyo / Oyo-East'),
+    ('abia_ukwa-east','Abia / Ukwa-East'),
+    ('akwa_ibom_urue-ffong-oruko','Akwa Ibom / Urue-Offong-Oruko'),
+    ('foreigner','Foreigner')
+    )
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/utils/utils.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/utils/utils.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/utils/utils.py	(revision 11268)
@@ -0,0 +1,230 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Customize general helper utilities for Kofa.
+"""
+import os
+import pytz
+from waeup.kofa.utils.utils import KofaUtils, sorted_phone_prefixes
+from kofacustom.nigeria.interfaces import MessageFactory as _
+
+INT_PHONE_PREFIXES = [
+    (1, _('Nigeria'), '234'),
+    (99, _('Germany'), '49'),
+    (99, _('United States'), '1'),
+    (99, _('Niger'), '227'),
+    (99, _('Benin'), '229'),
+    (99, _('Cameroon'), '237'),
+    (99, _('United Kingdom'), '44'),
+    (99, _('France'), '33'),
+    ]
+
+class NigeriaKofaUtils(KofaUtils):
+    """A collection of methods subject to customization.
+    """
+    PORTAL_LANGUAGE = 'en'
+
+    PREFERRED_LANGUAGES_DICT = {
+        'en':(1, u'English'),
+        'fr':(2, u'Fran&ccedil;ais'),
+        'de':(3, u'Deutsch'),
+        'ha':(4, u'Hausa'),
+        'yo':(5, u'Yoruba'),
+        'ig':(6, u'Igbo'),
+        }
+
+    #: A function to return
+    @classmethod
+    def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None):
+        return sorted_phone_prefixes(data, request)
+
+    EXAM_SUBJECTS_DICT = {
+        'accounts': 'Accounts',
+        'add_general_science': 'Add General Science',
+        'add_maths': 'Add Maths',
+        'adv_elect_install_maint': 'Adv. Electrical Installation and Maintenance',
+        'agricultural_science': 'Agricultural Science',
+        'applied_electricity': 'Applied Electricity',
+        'arabi': 'Arabic',
+        'arithmetics': 'Arithmetics',
+        'art': 'Art',
+        'auto_mechanics': 'Auto Mechanics',
+        'awaiting_results': 'Awaiting Results',
+        'basic_electricity': 'Basic Electricity',
+        'bible_knowledge': 'Bible Knowledge',
+        'biology': 'Biology',
+        'biology_alt_syl': 'Biology (Alt.Syl)',
+        'book_keeping': 'Book Keeping',
+        'building_construction': 'Building Construction',
+        'business_management': 'Business Management',
+        'business_construction_management': 'Business/Construction Management (Adv)',
+        'chemistry': 'Chemistry',
+        'chemistry_alt_syl': 'Chemistry (Alt.Syl)',
+        'christian_religious_studies': 'Christian Religious Studies',
+        'class_teaching': 'Class Teaching',
+        'clerical_office_duties': 'Clerical Office Duties',
+        'clothing_and_textiles': 'Clothing and Textiles',
+        'commerce': 'Commerce',
+        'economics': 'Economics',
+        'education': 'Education',
+        'efik': 'Efik',
+        'electronics': 'Electronics',
+        'elementary_surveying': 'Elementary Surveying',
+        'english_language': 'English Language',
+        'engineering_science': 'Engineering Science',
+        'financial_accounting': 'Financial Accounting',
+        'food_and_nutrition': 'Food and Nutrition',
+        'french': 'French',
+        'further_mathematics': 'Further Mathematics',
+        'general_science': 'General Science',
+        'geography': 'Geography',
+        'german': 'German',
+        'government': 'Government',
+        'hausa': 'Hausa',
+        'hausa_literature': 'Hausa Literature',
+        'health_science': 'Health Science',
+        'history': 'History',
+        'home_management': 'Home Management',
+        'human_biology': 'Human Biology',
+        'industrial_electrical_installation': 'Industrial Elect Installation (Adv)',
+        'intergrated_science': 'Intergrated Science',
+        'islamic_studies': 'Islamic Studies',
+        'literature_in_english': 'Literature in English',
+        'literature_in_nigerian_languages': 'Literature in Nigerian Languages',
+        'igbo': 'Igbo',
+        'igbo_literature': 'Igbo Literature',
+        'yoruba': 'Yoruba',
+        'yoruba_literature': 'Yoruba Literature',
+        'management_in_living': 'Management in Living',
+        'mathematics': 'Mathematics',
+        'metalwork': 'Metalwork',
+        'music': 'Music',
+        'nigerian_language': 'Nigerian Language',
+        'office_practice': 'Office Practice',
+        'physical_education': 'Physical Education',
+        'physical_health_education': 'Physical and Health Education',
+        'physics': 'Physics',
+        'physics_alt_syl': 'Physics (Alt.Syl)',
+        'principles_and_practice_of_education': 'Principles and Practice of Education',
+        'principles_of_cost_accounting': 'Principles of Cost Accounting',
+        'rural_science': 'Rural Science',
+        'science': 'Science',
+        'secretarial_duties': 'Secretarial Duties',
+        'shorthand': 'Shorthand',
+        'sierra_leone_studies': 'Sierra Leone Studies',
+        'sierra_leone_languages': 'Sierra Leone Languages',
+        'social_studies': 'Social Studies',
+        'statistics': 'Statistics',
+        'teaching_practice': 'Teaching Practice',
+        'technical_drawing': 'Technical Drawing',
+        'typewriting': 'Typewriting',
+        'visual_art': 'Visual Art',
+        'woodwork': 'Woodwork',
+        'winding_elect_machines': 'Winding of Elect Machines and Elect Eng Sc'
+        }
+
+    EXAM_GRADES = (
+        ('A1', 'Excellent (A1)'),
+        ('A2', 'Very Good (A2)'),
+        ('A3', 'Good (A3)'),
+        ('B2', 'Very Good (B2)'),
+        ('B3', 'Good (B3)'),
+        ('C4', 'Credit (C4)'),
+        ('C5', 'Credit (C5)'),
+        ('C6', 'Credit (C6)'),
+        ('A', 'Pass (A)'),
+        ('B', 'Pass (B)'),
+        ('C', 'Pass (C)'),
+        ('U', 'Pass (U)'),
+        ('D7', 'Pass (D7)'),
+        ('P7', 'Pass (P7)'),
+        ('P8', 'Pass (P8)'),
+        ('E8', 'Pass (E8)'),
+        ('F9', 'Fail (F9)'),
+        ('Aa', 'A (a)'),
+        ('Bb', 'B (b)'),
+        ('Cc', 'C (c)'),
+        ('Dd', 'D (d)'),
+        ('Ee', 'E (e)'),
+        ('Ff', 'F (f)'),
+        ('Gg', 'G (g)'),
+        ('AR', 'Awaiting Results'),
+        )
+
+    INST_TYPES_DICT = {
+        'none': '',
+        'faculty': 'Faculty of',
+        'department': 'Department of',
+        'school': 'School of',
+        'office': 'Office for',
+        'centre': 'Centre for',
+        'institute': 'Institute of',
+        'school_for': 'School for',
+        'college': 'College of',
+        'directorate': 'Directorate of',
+        }
+
+    STUDY_MODES_DICT = {
+        'ume_ft': 'UME Full Time',
+        'ug_ft': 'Undergraduate Full Time',
+        'ug_pt': 'Undergraduate Part Time',
+        'dp_pt': 'Diploma Part Time',
+        'ct_ft': 'Certificate Full Time',
+        'dp_ft': 'Diploma Full Time',
+        'de_ft': 'Direct Entry Full Time',
+        'de_pt': 'Direct Entry Part Time',
+        'nd_ft': 'National Diploma Full Time',
+        'nd_pt': 'National Diploma Part Time',
+        'hnd_ft': 'Higher National Diploma Full Time',
+        'hnd_pt': 'Higher National Diploma Part Time',
+        'pg_ft': 'Postgraduate Full Time',
+        'pg_pt': 'Postgraduate Part Time',
+        'pgd_ft': 'Postgraduate Diploma Full Time',
+        'pgd_pt': 'Postgraduate Diploma Part Time',
+        'special_pg_pt': 'Special Postgraduate Part Time',
+        'nce_ft': 'NCE Full Time',
+        'nce_pt': 'NCE Part Time',
+        'ug_sw': 'Undergraduate Sandwich',
+        'nce_sw': 'NCE Sandwich',
+        'jm_ft': 'Joint Matriculation Full Time',
+        'ph_ft': 'Post Higher Education Full Time',
+        'transfer_pt': 'Transfer Part Time',
+        'transfer_ft': 'Transfer Full Time',
+        'ct_pt': 'Certificate Part Time',
+        'rmd_ft': 'Remedial with deficiencies',
+        'rm_ft': 'Remedial',
+        'transfer': 'Transfer',
+        'prence': 'Pre-NCE',
+        'prend': 'Pre-ND',
+        'pce': 'PCE',
+        'pd_ft': 'Professional Diploma in Education',
+        'found': 'Foundation',
+        'no': 'no application',
+        }
+
+    APP_CATS_DICT = {
+        'basic': 'PUTME, PUDE, PCE, PRENCE',
+        'no': 'No Application',
+        'pg_ft': 'Postgraduate Full-Time',
+        'pg_pt': 'Postgraduate Part-Time',
+        'sandwich': 'Sandwich',
+        'cest': 'Part-Time, Diploma, Certificate',
+        }
+
+    @property
+    def tzinfo(self):
+        return pytz.timezone('Africa/Lagos')
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/widgets/__init__.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/widgets/__init__.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/widgets/__init__.py	(revision 11268)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/widgets/phonewidget.py
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/widgets/phonewidget.py	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/src/kofacustom/nigeria/widgets/phonewidget.py	(revision 11268)
@@ -0,0 +1,28 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+A customized phone widget
+"""
+
+from waeup.kofa.widgets.phonewidget import PhoneWidget
+
+class NigeriaPhoneWidget(PhoneWidget):
+    """A phone widget without area prefix.
+    """
+    subwidget_names = ('country', 'ext')
+    bootstrap_span = 'span3'
Index: /main/kofacustom.nigeria/tags/1.0/versions.cfg
===================================================================
--- /main/kofacustom.nigeria/tags/1.0/versions.cfg	(revision 11268)
+++ /main/kofacustom.nigeria/tags/1.0/versions.cfg	(revision 11268)
@@ -0,0 +1,148 @@
+# Versions of packages used by kofacustom.nigeria
+[buildout]
+# default set of versions we use.
+extends= http://grok.zope.org/releaseinfo/grok-1.1.cfg
+
+versions = versions
+
+[versions]
+collective.recipe.sphinxbuilder = 0.7.0
+hurry.workflow = 0.11
+# Pinned to circumvent breakage in 0.4.x
+hurry.zoperesource = 0.6
+# Pinned to prevent buildout svn-error.
+lovely.recipe = 1.0.0
+megrok.layout = 1.0.2
+reportlab = 2.5
+transaction = 1.1.0
+z3c.testsetup = 0.6.1
+zc.buildout = 2.1.0
+zc.recipe.egg = 2.0.0a3
+zc.recipe.testrunner = 2.0.0
+zope.app.testing = 3.8.1
+# for support of @provider directive
+zope.interface = 3.6.3
+# for support of contextual default values
+zope.schema = 3.8.0
+zope.testing = 3.10.2
+zope.xmlpickle = 3.4.0
+# Require latest version...
+Sphinx = 1.0.7
+ZODB3 = 3.10.3
+docutils = 0.7
+Jinja2 = 2.3
+# for support of unicode encoded passwords
+zope.password = 3.6.1
+# need at least 3.12.2 for working XMLRPC support...
+zope.publisher = 3.12.2
+# Pillow >= 2.0 supports Python 2.6, 2.7, 3.x
+# Pillow < 1.x supports Python 2.4, 2.5, 2.6, 2.7
+Pillow = 2.0.0
+mock = 1.0.1
+
+
+# Added by buildout at 2013-05-22 17:52:54.671893
+Beaker = 1.6.4
+Twisted = 13.0.0
+dolmen.beaker = 0.1
+hurry.resource = 0.10
+mr.developer = 1.25
+repoze.profile = 2.0
+unittest2 = 0.5.1
+z3c.coverage = 2.0.0
+zc.async = 1.5.4
+zc.dict = 1.2.1
+zc.twist = 1.3.1
+zc.z3monitor = 0.8.0
+zope.bforest = 1.2
+
+# Required by:
+# z3c.coverage==2.0.0
+coverage = 3.6
+
+# Required by:
+# waeup.kofa==0.2dev
+hurry.file = 1.2.1
+
+# Required by:
+# waeup.kofa==0.2dev
+hurry.jquery = 1.4.3.1
+
+# Required by:
+# waeup.kofa==0.2dev
+hurry.jqueryui = 1.8.5.1
+
+# Required by:
+# waeup.kofa==0.2dev
+hurry.query = 1.1.1
+
+# Required by:
+# grokui.base==0.2
+megrok.menu = 0.4
+
+# Required by:
+# dolmen.beaker==0.1
+pycryptopp = 0.6.0.1206569328141510525648634803928199668821045408958
+
+# Required by:
+# repoze.profile==2.0
+pyprof2calltree = 1.1.0
+
+# Required by:
+# zc.async==1.5.4
+rwproperty = 1.0
+
+# Required by:
+# zope.testrunner==4.3.3
+six = 1.3.0
+
+# Required by:
+# waeup.kofa==0.2dev
+ulif.loghandlers = 0.1.1
+
+# Required by:
+# waeup.kofa==0.2dev
+unicodecsv = 0.9.4
+
+# Required by:
+# zc.async==1.5.4
+uuid = 1.30
+
+# Required by:
+# zc.z3monitor==0.8.0
+zc.monitor = 0.3.1
+
+# Required by:
+# zc.monitor==0.3.1
+zc.ngi = 2.0.1
+
+# Required by:
+# zc.async==1.5.4
+zc.queue = 1.3
+
+# Required by:
+# waeup.kofa==0.2dev
+zope.errorview = 0.11
+
+# Required by:
+# zc.recipe.testrunner==2.0.0
+zope.testrunner = 4.3.3
+
+# Added by buildout at 2014-02-13 08:26:53.898100
+WebOb = 1.3.1
+diazo = 1.0.5
+repoze.xmliter = 0.5
+z3c.recipe.staticlxml = 0.10
+
+# Required by:
+# diazo==1.0.5
+experimental.cssselect = 0.3
+
+# Required by:
+# diazo==1.0.5
+# experimental.cssselect==0.3
+lxml = 3.3.1
+
+# Required by:
+# z3c.recipe.staticlxml==0.10
+zc.recipe.cmmi = 1.3.5
