Index: /main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.py	(revision 12619)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.py	(revision 12620)
@@ -120,17 +120,19 @@
         return
 
-    def moveCertificate(self, fac, dep):
+    def moveCertificate(self, facname, depname, newcode):
         self.moved = True
         cert = self
-        del self.__parent__[cert.code]
-        grok.getSite()['faculties'][fac][dep].certificates[cert.code] = cert
-        self.__parent__._p_changed = True
+        oldcode = cert.code
+        cert.code = newcode
+        del self.__parent__[oldcode]
+        newdep = grok.getSite()['faculties'][facname][depname]
+        newdep.certificates[newcode] = cert
+        #self.__parent__._p_changed = True
         cat = getUtility(ICatalog, name='students_catalog')
-        results = cat.searchResults(certcode=(cert.code, cert.code))
+        results = cat.searchResults(certcode=(oldcode, oldcode))
         for student in results:
             notify(grok.ObjectModifiedEvent(student))
             student.__parent__.logger.info(
                 '%s - Certificate moved' % student.__name__)
-
         return
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/university/department.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/department.py	(revision 12619)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/university/department.py	(revision 12620)
@@ -102,9 +102,10 @@
         """
         self.moved = True
-        fac = grok.getSite()['faculties'][facname]
+        newfac = grok.getSite()['faculties'][facname]
         oldcode = self.code
-        fac[depname] = self
-        del self.__parent__[oldcode]
-        fac[depname].code = depname
+        oldfac = self.__parent__
+        newfac[depname] = self
+        del oldfac[oldcode]
+        newfac[depname].code = depname
         #self.__parent__._p_changed = True
         cat = getUtility(ICatalog, name='students_catalog')
Index: /main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_move.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_move.py	(revision 12619)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_move.py	(revision 12620)
@@ -22,4 +22,5 @@
 from zope.catalog.interfaces import ICatalog
 from zope.component import queryUtility
+from waeup.kofa.university.faculty import Faculty
 from waeup.kofa.university.department import Department
 from waeup.kofa.students.tests.test_browser import StudentsFullSetup
@@ -28,4 +29,5 @@
 
     def test_move_department(self):
+        self.app['faculties']['fac2'] = Faculty(code=u'fac2')
         self.assertEqual(
             self.app['faculties']['fac1']['dep1'].certificates['CERT1'],
@@ -36,19 +38,19 @@
         # We move the depart using the UtilityView
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
-        self.browser.open('http://localhost/app/faculties/fac1/dep1/move_department?fac=fac1&dep=newdep')
+        self.browser.open('http://localhost/app/faculties/fac1/dep1/move_department?fac=fac2&dep=newdep')
 
         # New department is created and old department is removed
         self.assertEqual(
-            [key for key in self.app['faculties']['fac1']], ['newdep'])
+            [key for key in self.app['faculties']['fac2']], ['newdep'])
 
         # All subobjects have been moved too
         self.assertEqual(
-            self.app['faculties']['fac1']['newdep'].courses['COURSE1'],
+            self.app['faculties']['fac2']['newdep'].courses['COURSE1'],
             self.course)
         self.assertEqual(
-            self.app['faculties']['fac1']['newdep'].certificates['CERT1'],
+            self.app['faculties']['fac2']['newdep'].certificates['CERT1'],
             self.certificate)
         self.assertEqual(
-            [key for key in self.app['faculties']['fac1'][
+            [key for key in self.app['faculties']['fac2'][
                 'newdep'].certificates['CERT1'].keys()],
             [u'COURSE1_100'])
@@ -67,4 +69,5 @@
         assert len(results) == 1
         assert results[0] is self.course
+
         # We can still find the certificatecourse in the catalog
         cat = queryUtility(ICatalog, name='certcourses_catalog')
@@ -72,5 +75,5 @@
         results = [x for x in results] 
         assert len(results) == 1
-        assert results[0] is self.app['faculties']['fac1'][
+        assert results[0] is self.app['faculties']['fac2'][
             'newdep'].certificates['CERT1']['COURSE1_100']
 
@@ -91,28 +94,34 @@
             self.app['datacenter'].storage, 'logs', 'main.log')
         logcontent = open(logfile).read()
-        self.assertTrue('INFO - zope.mgr - Department dep1 moved to fac1/newdep'
+        self.assertTrue('INFO - zope.mgr - Department dep1 moved to fac2/newdep'
             in logcontent)
 
 
     def test_move_certificate(self):
+        self.app['faculties']['fac2'] = Faculty(code=u'fac2')
+        self.app['faculties']['fac2']['dep2'] = Department(code=u'dep2')
         self.assertEqual(
             self.app['faculties']['fac1']['dep1'].certificates['CERT1'],
             self.certificate)
-        self.app['faculties']['fac1']['dep2'] = Department(code=u'dep2')
-        self.certificate.moveCertificate('fac1', 'dep2')
+
+        #self.certificate.moveCertificate('fac2', 'dep2', 'NEWCODE')
+
+        # We move the depart using the UtilityView
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open('http://localhost/app/faculties/fac1/dep1/certificates/CERT1/move_certificate?fac=fac2&dep=dep2&cert=NEWCODE')
+
         self.assertEqual(
-            self.app['faculties']['fac1']['dep2'].certificates['CERT1'],
+            self.app['faculties']['fac2']['dep2'].certificates['NEWCODE'],
             self.certificate)
         self.assertEqual(
-            [key for key in self.app['faculties']['fac1'][
-                'dep2'].certificates['CERT1'].keys()],
-            [u'COURSE1_100'])
+            [key for key in self.app['faculties']['fac2'][
+                'dep2'].certificates['NEWCODE'].keys()], [u'COURSE1_100'])
         self.assertEqual(
             self.student['studycourse'].certificate,
             self.certificate)
 
-        # We can still find the certificate in the catalog
+        # We can find the moved certificate in the catalog
         cat = queryUtility(ICatalog, name='certificates_catalog')
-        results = cat.searchResults(code=('CERT1','CERT1'))
+        results = cat.searchResults(code=('NEWCODE','NEWCODE'))
         results = [x for x in results] # Turn results generator into list
         assert len(results) == 1
@@ -124,6 +133,6 @@
         results = [x for x in results] # Turn results generator into list
         assert len(results) == 1
-        assert results[0] is self.app['faculties']['fac1'][
-                'dep2'].certificates['CERT1']['COURSE1_100']
+        assert results[0] is self.app['faculties']['fac2'][
+                'dep2'].certificates['NEWCODE']['COURSE1_100']
 
         # We can find the student studying in the new department
@@ -133,7 +142,23 @@
         assert len(results) == 1
         assert results[0] is self.app['students'][self.student_id]
+
+        # We can find the student studying the new course ...
+        cat = queryUtility(ICatalog, name='students_catalog')
+        results = cat.searchResults(certcode=('NEWCODE','NEWCODE'))
+        results = [x for x in results] # Turn results generator into list
+        assert len(results) == 1
+        assert results[0] is self.app['students'][self.student_id]
+        # ... but not the old course
+        results = cat.searchResults(certcode=('CERT1','CERT1'))
+        assert len(results) == 0
+
         logfile = os.path.join(
             self.app['datacenter'].storage, 'logs', 'students.log')
         logcontent = open(logfile).read()
-        self.assertTrue('INFO - system - K1000000 - Certificate moved'
+        self.assertTrue('INFO - zope.mgr - K1000000 - Certificate moved'
             in logcontent)
+        logfile = os.path.join(
+            self.app['datacenter'].storage, 'logs', 'main.log')
+        logcontent = open(logfile).read()
+        self.assertTrue('INFO - zope.mgr - Certificate CERT1 moved to fac2/dep2/NEWCODE'
+            in logcontent)
Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/browser.py	(revision 12619)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/browser.py	(revision 12620)
@@ -25,5 +25,5 @@
 from waeup.kofa.interfaces import IObjectHistory
 from waeup.kofa.interfaces import IUniversity
-from waeup.kofa.university.interfaces import IDepartment
+from waeup.kofa.university.interfaces import IDepartment, ICertificate
 
 def replaceStudentMessages(old, new):
@@ -227,2 +227,29 @@
         self.redirect(self.url(self.context, '@@index'))
         return
+
+class MoveCertificate(UtilityView, grok.View):
+    """ View to move a certificate.
+
+    """
+    grok.context(ICertificate)
+    grok.name('move_certificate')
+    grok.require('waeup.managePortal')
+
+    def update(self,fac=None, dep=None, cert=None):
+        if None in (fac, dep, cert):
+            self.flash('Syntax: /move_certificate?fac=[new faculty code]&dep=[new department code]&cert=[new certificate code]')
+            return
+        oldcode = self.context.code
+        try:
+            self.context.moveCertificate(fac, dep, cert)
+        except:
+            self.flash('Error')
+            return
+        grok.getSite().logger.info(
+            "Certificate %s moved to %s/%s/%s" % (oldcode, fac, dep, cert))
+        self.flash('Finished')
+        return
+
+    def render(self):
+        self.redirect(self.url(self.context, '@@index'))
+        return
