Index: /main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py	(revision 7437)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py	(revision 7438)
@@ -20,8 +20,7 @@
 from cStringIO import StringIO
 from grok import index
-from zope.component import getUtility, createObject, getUtility, getAdapter
+from zope.component import getUtility, createObject, getAdapter
 from zope.component.interfaces import IFactory
 from zope.event import notify
-from zope.catalog.interfaces import ICatalog
 from zope.securitypolicy.interfaces import IPrincipalRoleManager
 from zope.interface import implementedBy
@@ -35,8 +34,5 @@
 from waeup.sirp.students.vocabularies import RegNumNotInSource
 from waeup.sirp.utils.helpers import attrs_to_fields, get_current_principal
-from waeup.sirp.applicants.interfaces import (
-    IApplicant, IApplicantEdit, IApplicantBaseData,
-    )
-
+from waeup.sirp.applicants.interfaces import IApplicant, IApplicantEdit
 
 class Applicant(grok.Container):
Index: /main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py	(revision 7437)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py	(revision 7438)
@@ -27,11 +27,4 @@
 from hurry.workflow.interfaces import (
     IWorkflowInfo, IWorkflowState, InvalidTransitionError)
-from reportlab.pdfgen import canvas
-from reportlab.lib.units import cm
-from reportlab.lib.pagesizes import A4
-from reportlab.lib.styles import getSampleStyleSheet
-from reportlab.platypus import (Frame, Paragraph, Image,
-    Table, Spacer)
-from reportlab.platypus.tables import TableStyle
 from waeup.sirp.applicants.interfaces import (
     IApplicant, IApplicantEdit, IApplicantsRoot,
@@ -45,15 +38,12 @@
 from waeup.sirp.browser.interfaces import ICaptchaManager
 from waeup.sirp.browser.breadcrumbs import Breadcrumb
-from waeup.sirp.browser.layout import NullValidator, jsaction, JSAction
+from waeup.sirp.browser.layout import NullValidator, jsaction
 from waeup.sirp.browser.pages import add_local_role, del_local_roles
 from waeup.sirp.browser.resources import datepicker, tabs, datatable, warning
-from waeup.sirp.browser.viewlets import ManageActionButton, PrimaryNavTab
 from waeup.sirp.interfaces import (
     ISIRPObject, ILocalRolesAssignable, IExtFileStore, IPDF,
     IFileStoreNameChooser, IPasswordValidator, IUserAccount, ISIRPUtils)
 from waeup.sirp.permissions import get_users_with_local_roles
-from waeup.sirp.students.viewlets import PrimaryStudentNavTab
 from waeup.sirp.students.interfaces import IStudentsUtils
-from waeup.sirp.university.interfaces import ICertificate
 from waeup.sirp.utils.helpers import string_from_bytes, file_size
 from waeup.sirp.widgets.datewidget import (
@@ -77,10 +67,4 @@
         datatable.need()
         return
-
-class ManageApplicantsRootActionButton(ManageActionButton):
-    grok.context(IApplicantsRoot)
-    grok.view(ApplicantsRootPage)
-    grok.require('waeup.manageApplication')
-    text = 'Manage application section'
 
 class ApplicantsRootManageFormPage(SIRPEditFormPage):
@@ -229,51 +213,4 @@
         return self.context.p_id
 
-class ApplicantsAuthTab(PrimaryNavTab):
-    """Applicants tab in primary navigation.
-    """
-    grok.context(ISIRPObject)
-    grok.order(3)
-    grok.require('waeup.viewApplicantsTab')
-    pnav = 3
-    tab_title = u'Applicants'
-
-    @property
-    def link_target(self):
-        return self.view.application_url('applicants')
-
-class ApplicantsAnonTab(ApplicantsAuthTab):
-    """Applicants tab in primary navigation.
-
-    Display tab only for anonymous. Authenticated users can call the
-    form from the user navigation bar.
-    """
-    grok.require('waeup.Anonymous')
-    tab_title = u'Application'
-
-    # Also zope.manager has role Anonymous.
-    # To avoid displaying this tab, we have to check the principal id too.
-    @property
-    def link_target(self):
-        if self.request.principal.id == 'zope.anybody':
-            return self.view.application_url('applicants')
-        return
-
-class MyApplicationDataTab(PrimaryStudentNavTab):
-    """MyData-tab in primary navigation.
-    """
-    grok.order(3)
-    grok.require('waeup.viewMyApplicationDataTab')
-    pnav = 3
-    tab_title = u'My Data'
-
-    @property
-    def link_target(self):
-        try:
-            container, application_number = self.request.principal.id.split('_')
-        except ValueError:
-            return
-        rel_link = '/applicants/%s/%s' % (container, application_number)
-        return self.view.application_url() + rel_link
-
 class ApplicantsContainerPage(SIRPDisplayFormPage):
     """The standard view for regular applicant containers.
@@ -297,20 +234,4 @@
     def label(self):
         return self.context.title
-
-class ApplicantsContainerManageActionButton(ManageActionButton):
-    grok.order(1)
-    grok.context(IApplicantsContainer)
-    grok.view(ApplicantsContainerPage)
-    grok.require('waeup.manageApplication')
-    text = 'Manage applicants container'
-
-class ApplicantRegisterActionButton(ManageActionButton):
-    grok.order(2)
-    grok.context(IApplicantsContainer)
-    grok.view(ApplicantsContainerPage)
-    grok.require('waeup.Anonymous')
-    icon = 'actionicon_login.png'
-    text = 'Register for application'
-    target = 'register'
 
 class ApplicantsContainerManageFormPage(SIRPEditFormPage):
@@ -514,5 +435,4 @@
     def update(self):
         p_category = 'acceptance'
-        d = {}
         session = str(self.context.__parent__.year)
         try:
@@ -573,34 +493,4 @@
             self.context.__parent__.display_fullname,self.context.p_id)
 
-class PaymentReceiptActionButton(ManageActionButton):
-    grok.order(1)
-    grok.context(IApplicantOnlinePayment)
-    grok.view(OnlinePaymentDisplayFormPage)
-    grok.require('waeup.viewApplication')
-    icon = 'actionicon_pdf.png'
-    text = 'Download payment receipt'
-    target = 'payment_receipt.pdf'
-
-    @property
-    def target_url(self):
-        if self.context.p_state != 'paid':
-            return ''
-        return self.view.url(self.view.context, self.target)
-
-class RequestCallbackActionButton(ManageActionButton):
-    grok.order(2)
-    grok.context(IApplicantOnlinePayment)
-    grok.view(OnlinePaymentDisplayFormPage)
-    grok.require('waeup.payApplicant')
-    icon = 'actionicon_call.png'
-    text = 'Request callback'
-    target = 'callback'
-
-    @property
-    def target_url(self):
-        if self.context.p_state != 'unpaid':
-            return ''
-        return self.view.url(self.view.context, self.target)
-
 class OnlinePaymentCallbackPage(grok.View):
     """ Callback view
@@ -661,12 +551,4 @@
         return students_utils.renderPDF(self,'payment_receipt.pdf',
             self.context.__parent__, applicantview)
-
-class PDFActionButton(ManageActionButton):
-    grok.order(3)
-    grok.context(IApplicant)
-    grok.require('waeup.viewApplication')
-    icon = 'actionicon_pdf.png'
-    text = 'Download application slip'
-    target = 'application_slip.pdf'
 
 class ExportPDFPage(grok.View):
@@ -713,44 +595,4 @@
             'Content-Type', 'application/pdf')
         return pdfstream
-
-class ApplicantManageActionButton(ManageActionButton):
-    grok.order(1)
-    grok.context(IApplicant)
-    grok.view(ApplicantDisplayFormPage)
-    grok.require('waeup.manageApplication')
-    text = 'Manage application record'
-    target = 'manage'
-
-class ApplicantEditActionButton(ManageActionButton):
-    grok.order(2)
-    grok.context(IApplicant)
-    grok.view(ApplicantDisplayFormPage)
-    grok.require('waeup.handleApplication')
-    text = 'Edit application record'
-    target ='edit'
-
-    @property
-    def target_url(self):
-        """Get a URL to the target...
-        """
-        if self.context.locked:
-            return
-        return self.view.url(self.view.context, self.target)
-
-class StudentCreateActionButton(ManageActionButton):
-    grok.order(4)
-    grok.context(IApplicant)
-    grok.require('waeup.manageApplication')
-    icon = 'actionicon_entrance.png'
-    text = 'Create student record'
-    target ='createstudent'
-
-    @property
-    def target_url(self):
-        """Get a URL to the target...
-        """
-        if IWorkflowState(self.context).getState() != 'admitted':
-            return
-        return self.view.url(self.view.context, self.target)
 
 def handle_img_upload(upload, context, view):
@@ -1007,12 +849,4 @@
         return
 
-class ApplicantViewActionButton(ManageActionButton):
-    grok.context(IApplicant)
-    grok.view(ApplicantManageFormPage)
-    grok.require('waeup.viewApplication')
-    icon = 'actionicon_view.png'
-    text = 'View application record'
-    target = 'index'
-
 class PassportImage(grok.View):
     """Renders the passport image for applicants.
Index: /main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py	(revision 7437)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py	(revision 7438)
@@ -36,6 +36,5 @@
     lgas_vocab, CertificateSource, GenderSource)
 from waeup.sirp.applicants.vocabularies import (
-    application_types_vocab, application_pins_vocab,
-    AppCatCertificateSource)
+    application_types_vocab, AppCatCertificateSource)
 from waeup.sirp.payments.interfaces import IOnlinePayment
 
Index: /main/waeup.sirp/trunk/src/waeup/sirp/applicants/pdf.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/applicants/pdf.py	(revision 7437)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/applicants/pdf.py	(revision 7438)
@@ -29,5 +29,4 @@
 from zope.component import getUtility
 from zope.formlib.form import setUpEditWidgets
-from zope.interface import Interface
 from zope.publisher.browser import TestRequest
 from waeup.sirp.applicants.interfaces import IApplicant
Index: /main/waeup.sirp/trunk/src/waeup/sirp/applicants/viewlets.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/applicants/viewlets.py	(revision 7438)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/applicants/viewlets.py	(revision 7438)
@@ -0,0 +1,188 @@
+## $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 hurry.workflow.interfaces import IWorkflowState
+from waeup.sirp.interfaces import ISIRPObject
+from waeup.sirp.students.viewlets import PrimaryStudentNavTab
+from waeup.sirp.browser.viewlets import ManageActionButton, PrimaryNavTab
+from waeup.sirp.applicants.interfaces import (
+    IApplicant, IApplicantsRoot, IApplicantsContainer,
+    IApplicantOnlinePayment,
+    )
+from waeup.sirp.applicants.browser import (
+    ApplicantsRootPage, ApplicantsContainerPage, ApplicantManageFormPage,
+    ApplicantDisplayFormPage, OnlinePaymentDisplayFormPage
+    )
+
+grok.context(ISIRPObject) # Make ISIRPObject the default context
+grok.templatedir('browser_templates')
+
+class ApplicantsAuthTab(PrimaryNavTab):
+    """Applicants tab in primary navigation.
+    """
+    grok.context(ISIRPObject)
+    grok.order(3)
+    grok.require('waeup.viewApplicantsTab')
+    pnav = 3
+    tab_title = u'Applicants'
+
+    @property
+    def link_target(self):
+        return self.view.application_url('applicants')
+
+class ApplicantsAnonTab(ApplicantsAuthTab):
+    """Applicants tab in primary navigation.
+
+    Display tab only for anonymous. Authenticated users can call the
+    form from the user navigation bar.
+    """
+    grok.require('waeup.Anonymous')
+    tab_title = u'Application'
+
+    # Also zope.manager has role Anonymous.
+    # To avoid displaying this tab, we have to check the principal id too.
+    @property
+    def link_target(self):
+        if self.request.principal.id == 'zope.anybody':
+            return self.view.application_url('applicants')
+        return
+
+class MyApplicationDataTab(PrimaryStudentNavTab):
+    """MyData-tab in primary navigation.
+    """
+    grok.order(3)
+    grok.require('waeup.viewMyApplicationDataTab')
+    pnav = 3
+    tab_title = u'My Data'
+
+    @property
+    def link_target(self):
+        try:
+            container, application_number = self.request.principal.id.split('_')
+        except ValueError:
+            return
+        rel_link = '/applicants/%s/%s' % (container, application_number)
+        return self.view.application_url() + rel_link
+
+class ManageApplicantsRootActionButton(ManageActionButton):
+    grok.context(IApplicantsRoot)
+    grok.view(ApplicantsRootPage)
+    grok.require('waeup.manageApplication')
+    text = 'Manage application section'
+
+class ApplicantsContainerManageActionButton(ManageActionButton):
+    grok.order(1)
+    grok.context(IApplicantsContainer)
+    grok.view(ApplicantsContainerPage)
+    grok.require('waeup.manageApplication')
+    text = 'Manage applicants container'
+
+class ApplicantRegisterActionButton(ManageActionButton):
+    grok.order(2)
+    grok.context(IApplicantsContainer)
+    grok.view(ApplicantsContainerPage)
+    grok.require('waeup.Anonymous')
+    icon = 'actionicon_login.png'
+    text = 'Register for application'
+    target = 'register'
+
+class ApplicantViewActionButton(ManageActionButton):
+    grok.context(IApplicant)
+    grok.view(ApplicantManageFormPage)
+    grok.require('waeup.viewApplication')
+    icon = 'actionicon_view.png'
+    text = 'View application record'
+    target = 'index'
+
+class ApplicantManageActionButton(ManageActionButton):
+    grok.order(1)
+    grok.context(IApplicant)
+    grok.view(ApplicantDisplayFormPage)
+    grok.require('waeup.manageApplication')
+    text = 'Manage application record'
+    target = 'manage'
+
+class ApplicantEditActionButton(ManageActionButton):
+    grok.order(2)
+    grok.context(IApplicant)
+    grok.view(ApplicantDisplayFormPage)
+    grok.require('waeup.handleApplication')
+    text = 'Edit application record'
+    target ='edit'
+
+    @property
+    def target_url(self):
+        """Get a URL to the target...
+        """
+        if self.context.locked:
+            return
+        return self.view.url(self.view.context, self.target)
+
+class PDFActionButton(ManageActionButton):
+    grok.order(3)
+    grok.context(IApplicant)
+    grok.require('waeup.viewApplication')
+    icon = 'actionicon_pdf.png'
+    text = 'Download application slip'
+    target = 'application_slip.pdf'
+
+class StudentCreateActionButton(ManageActionButton):
+    grok.order(4)
+    grok.context(IApplicant)
+    grok.require('waeup.manageApplication')
+    icon = 'actionicon_entrance.png'
+    text = 'Create student record'
+    target ='createstudent'
+
+    @property
+    def target_url(self):
+        """Get a URL to the target...
+        """
+        if IWorkflowState(self.context).getState() != 'admitted':
+            return
+        return self.view.url(self.view.context, self.target)
+
+class PaymentReceiptActionButton(ManageActionButton):
+    grok.order(1)
+    grok.context(IApplicantOnlinePayment)
+    grok.view(OnlinePaymentDisplayFormPage)
+    grok.require('waeup.viewApplication')
+    icon = 'actionicon_pdf.png'
+    text = 'Download payment receipt'
+    target = 'payment_receipt.pdf'
+
+    @property
+    def target_url(self):
+        if self.context.p_state != 'paid':
+            return ''
+        return self.view.url(self.view.context, self.target)
+
+class RequestCallbackActionButton(ManageActionButton):
+    grok.order(2)
+    grok.context(IApplicantOnlinePayment)
+    grok.view(OnlinePaymentDisplayFormPage)
+    grok.require('waeup.payApplicant')
+    icon = 'actionicon_call.png'
+    text = 'Request callback'
+    target = 'callback'
+
+    @property
+    def target_url(self):
+        if self.context.p_state != 'unpaid':
+            return ''
+        return self.view.url(self.view.context, self.target)
