Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6694)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6695)
@@ -66,5 +66,5 @@
     IStudentPersonal, IStudentBase, IStudentStudyCourse,
     IStudentPayments, IStudentAccommodation, IStudentNavigation,
-    IStudentBaseEdit, 
+    IStudentBaseEdit, IStudentClearanceEdit,
     )
 from waeup.sirp.students.student import Student
@@ -117,5 +117,5 @@
     grok.name('index')
     grok.require('waeup.viewStudent')
-    grok.template('studentscontainerpage')
+    grok.template('containerpage')
     label = 'Student Section'
     title = 'Students'
@@ -156,5 +156,5 @@
     grok.name('manage')
     grok.require('waeup.manageStudents')
-    grok.template('studentscontainermanagepage')
+    grok.template('containermanagepage')
     pnav = 4
     title = 'Manage student section'
@@ -233,5 +233,5 @@
     grok.name('index')
     grok.require('waeup.viewStudent')
-    grok.template('studentpage')
+    grok.template('basepage')
     form_fields = grok.AutoFields(IStudentBase).omit('password')
     pnav = 4
@@ -247,5 +247,5 @@
     grok.view(StudentBaseDisplayFormPage)
     grok.require('waeup.manageStudents')
-    text = 'Edit'
+    text = 'Manage'
     target = 'edit_base'
 
@@ -257,6 +257,6 @@
     grok.require('waeup.manageStudents')
     form_fields = grok.AutoFields(IStudentBase).omit('student_id')
-    grok.template('studentbasemanagepage')
-    label = 'Edit base data'
+    grok.template('basemanagepage')
+    label = 'Manage base data'
     title = 'Base Data'
     pnav = 4
@@ -303,5 +303,5 @@
     grok.name('view_clearance')
     grok.require('waeup.viewStudent')
-    form_fields = grok.AutoFields(IStudentClearance)
+    form_fields = grok.AutoFields(IStudentClearance).omit('clearance_locked')
     form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
     title = 'Clearance Data'
@@ -317,5 +317,5 @@
     grok.view(StudentClearanceDisplayFormPage)
     grok.require('waeup.manageStudents')
-    text = 'Edit'
+    text = 'Manage'
     target = 'edit_clearance'
 
@@ -327,5 +327,5 @@
     grok.require('waeup.manageStudents')
     form_fields = grok.AutoFields(IStudentClearance)
-    label = 'Edit clearance data'
+    label = 'Manage clearance data'
     title = 'Clearance Data'
     pnav = 4
@@ -337,4 +337,17 @@
         return super(StudentClearanceManageFormPage, self).update()
 
+    @grok.action('Save')
+    def save(self, **data):
+        changed_fields = self.applyData(self.context, **data)
+        changed_fields = changed_fields.values()
+        fields_string = '+'.join(' + '.join(str(i) for i in b) for b in changed_fields)
+        self.context._p_changed = True
+        form = self.request.form
+        self.flash('Form has been saved.')
+        ob_class = self.__implemented__.__name__.replace('waeup.sirp.','')
+        if fields_string:
+            self.context.loggerInfo(ob_class, 'saved: % s' % fields_string)
+        return
+
 class StudentPersonalDisplayFormPage(WAeUPDisplayFormPage):
     """ Page to display student personal data
@@ -356,5 +369,5 @@
     grok.view(StudentPersonalDisplayFormPage)
     grok.require('waeup.manageStudents')
-    text = 'Edit'
+    text = 'Manage'
     target = 'edit_personal'
 
@@ -366,5 +379,5 @@
     grok.require('waeup.viewStudent')
     form_fields = grok.AutoFields(IStudentPersonal)
-    label = 'Edit personal data'
+    label = 'Manage personal data'
     title = 'Personal Data'
     pnav = 4
@@ -390,5 +403,5 @@
     grok.view(StudyCourseDisplayFormPage)
     grok.require('waeup.manageStudents')
-    text = 'Edit'
+    text = 'Manage'
     target = 'edit'
 
@@ -400,7 +413,6 @@
     grok.require('waeup.manageStudents')
     form_fields = grok.AutoFields(IStudentStudyCourse)
-    label = 'Edit clearance data'
     title = 'Study Course'
-    label = 'Edit study course'
+    label = 'Manage study course'
     pnav = 4
 
@@ -466,5 +478,5 @@
     grok.require('waeup.handleStudent')
     form_fields = grok.AutoFields(IStudentBaseEdit).omit('student_id')
-    grok.template('studentbaseeditpage')
+    grok.template('baseeditpage')
     label = 'Change password'
     title = 'Base Data'
@@ -491,2 +503,23 @@
             IUserAccount(self.context).setPassword(form['form.password'])
         return
+
+class StudentClearanceEditActionButton(ManageActionButton):
+    grok.order(1)
+    grok.context(IStudent)
+    grok.view(StudentClearanceDisplayFormPage)
+    grok.require('waeup.handleStudent')
+    text = 'Edit and submit'
+    target = 'cedit'
+
+class StudentClearanceEditFormPage(StudentClearanceManageFormPage):
+    """ View to edit student clearance data by student
+    """
+    grok.context(IStudent)
+    grok.name('cedit')
+    grok.require('waeup.handleStudent')
+    form_fields = grok.AutoFields(IStudentClearanceEdit).omit('clearance_locked')
+    #grok.template('clearanceeditpage')
+    label = 'Edit clerance data'
+    title = 'Clearance Data'
+    pnav = 4
+    form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/baseeditpage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/baseeditpage.pt	(revision 6695)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/baseeditpage.pt	(revision 6695)
@@ -0,0 +1,48 @@
+<h2 i18n:translate=""
+    tal:condition="view/label"
+    tal:content="view/label">Label</h2>
+
+<form action="." tal:attributes="action request/URL" method="post"
+      class="edit-form" enctype="multipart/form-data">
+
+  <div class="form-status"
+    tal:define="status view/status"
+    tal:condition="status">
+    Form Status:
+    <span i18n:translate="" tal:content="view/status">
+      Form status summary
+    </span>
+  </div>
+
+  <table class="form-fields zebra">
+    <tbody>
+      <tal:block repeat="widget view/widgets">
+        <tr>
+          <td class="label">
+            <label tal:attributes="for widget/name">
+              <span class="required" tal:condition="widget/required">*</span>
+              <span i18n:translate="" tal:content="widget/label">label</span>:
+            </label>
+          </td>
+          <td class="field">
+            <span class="widget" tal:content="structure widget">
+              <input type="text" />
+            </span>
+            <tal:error tal:condition="widget/error">
+              <span tal:replace="structure widget/error">error</span>
+            </tal:error>
+            <tal:hint tal:condition="widget/hint">
+              <span class="hint" tal:content="structure widget/hint">hint</span>
+            </tal:hint>
+          </td>
+        </tr>
+      </tal:block>
+    </tbody>
+  </table>
+
+  <div class="actionButtons" tal:condition="view/availableActions">
+    <input tal:repeat="action view/actions"
+           tal:replace="structure action/render"
+           />
+  </div>
+</form>
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/basemanagepage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/basemanagepage.pt	(revision 6695)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/basemanagepage.pt	(revision 6695)
@@ -0,0 +1,59 @@
+<h2 i18n:translate=""
+    tal:condition="view/label"
+    tal:content="view/label">Label</h2>
+
+<form action="." tal:attributes="action request/URL" method="post"
+      class="edit-form" enctype="multipart/form-data">
+
+  <div class="form-status"
+    tal:define="status view/status"
+    tal:condition="status">
+    Form Status:
+    <span i18n:translate="" tal:content="view/status">
+      Form status summary
+    </span>
+  </div>
+
+  <table class="form-fields zebra">
+    <tbody>
+      <tal:block repeat="widget view/widgets">
+        <tr>
+          <td class="label">
+            <label tal:attributes="for widget/name">
+              <span class="required" tal:condition="widget/required">*</span>
+              <span i18n:translate="" tal:content="widget/label">label</span>:
+            </label>
+          </td>
+          <td class="field">
+            <span class="widget" tal:content="structure widget">
+              <input type="text" />
+            </span>
+            <tal:error tal:condition="widget/error">
+              <span tal:replace="structure widget/error">error</span>
+            </tal:error>
+            <tal:hint tal:condition="widget/hint">
+              <span class="hint" tal:content="structure widget/hint">hint</span>
+            </tal:hint>
+          </td>
+        </tr>
+      </tal:block>
+      <tr>
+        <td class="label"><label>Registration Transition:</label></td>
+        <td>
+          <select id="transition" name="transition">
+            <option tal:repeat="transition view/getTransitions"
+                    tal:attributes="value transition/name">
+              <span tal:replace="transition/title">TRANSITIONTITLE</span>
+            </option>
+          </select>
+        </td>
+      </tr>
+    </tbody>
+  </table>
+
+  <div class="actionButtons" tal:condition="view/availableActions">
+    <input tal:repeat="action view/actions"
+           tal:replace="structure action/render"
+           />
+  </div>
+</form>
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containermanagepage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containermanagepage.pt	(revision 6695)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containermanagepage.pt	(revision 6695)
@@ -0,0 +1,46 @@
+<h2 tal:content="view/label">Title</h2>
+<form method="POST">
+
+<br />
+
+  <input type="submit" name="search" value="Search" />
+  for students
+
+  <select name="searchtype">
+    <option value="student_id">with id</option>
+    <option value="name">with name</option>
+  </select>
+
+  <input type="text" name="searchterm" />
+
+  <p>&nbsp;</p>
+  <div tal:condition="view/hitlist">
+    <h3>Search Results</h3>
+    <input type="hidden" name="old_searchterm"
+         tal:attributes="value view/searchterm" />
+    <input type="hidden" name="old_searchtype"
+         tal:attributes="value view/searchtype" />
+    <table class="display dataTableManage">
+      <thead>
+    	<tr>
+    	  <th>&nbsp;</th>
+    	  <th>Student Id</th><th>Name</th>
+    	</tr>
+      </thead>
+      <tbody>
+    	<tr tal:repeat="item view/hitlist">
+    	  <td><input type="checkbox" name="entries"
+    	             tal:attributes="value item/context/__name__" /></td>
+    	  <td> <a tal:attributes="href item/url">
+          <span tal:content="item/student_id">A123456</span></a>
+        </td>
+    	  <td tal:content="item/name">Bob</td>
+    	</tr>
+      </tbody>
+    </table>
+    <div class="actionButtons">
+        <input type="submit" name="remove" value="Remove selected" />
+    </div>
+
+  </div>
+</form>
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containerpage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containerpage.pt	(revision 6695)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containerpage.pt	(revision 6695)
@@ -0,0 +1,40 @@
+<h2 tal:content="view/label">Title</h2>
+<form method="POST">
+
+<br />
+
+  <input type="submit" name="search" value="Search" />
+  for students
+
+  <select name="searchtype">
+    <option value="student_id">with id</option>
+    <option value="name">with name</option>
+  </select>
+
+  <input type="text" name="searchterm" />
+
+  <p>&nbsp;</p>
+  <div tal:condition="view/hitlist">
+    <h3>Search Results</h3>
+    <input type="hidden" name="old_searchterm"
+         tal:attributes="value view/searchterm" />
+    <input type="hidden" name="old_searchtype"
+         tal:attributes="value view/searchtype" />
+    <table class="display dataTableManage">
+      <thead>
+    	<tr>
+    	  <th>Student Id</th><th>Name</th>
+    	</tr>
+      </thead>
+      <tbody>
+    	<tr tal:repeat="item view/hitlist">
+    	  <td> <a tal:attributes="href item/url">
+          <span tal:content="item/student_id">A123456</span></a>
+        </td>
+    	  <td tal:content="item/name">Bob</td>
+    	</tr>
+      </tbody>
+    </table>
+    <br />
+  </div>
+</form>
Index: in/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentbaseeditpage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentbaseeditpage.pt	(revision 6694)
+++ 	(revision )
@@ -1,48 +1,0 @@
-<h2 i18n:translate=""
-    tal:condition="view/label"
-    tal:content="view/label">Label</h2>
-
-<form action="." tal:attributes="action request/URL" method="post"
-      class="edit-form" enctype="multipart/form-data">
-
-  <div class="form-status"
-    tal:define="status view/status"
-    tal:condition="status">
-    Form Status:
-    <span i18n:translate="" tal:content="view/status">
-      Form status summary
-    </span>
-  </div>
-
-  <table class="form-fields zebra">
-    <tbody>
-      <tal:block repeat="widget view/widgets">
-        <tr>
-          <td class="label">
-            <label tal:attributes="for widget/name">
-              <span class="required" tal:condition="widget/required">*</span>
-              <span i18n:translate="" tal:content="widget/label">label</span>:
-            </label>
-          </td>
-          <td class="field">
-            <span class="widget" tal:content="structure widget">
-              <input type="text" />
-            </span>
-            <tal:error tal:condition="widget/error">
-              <span tal:replace="structure widget/error">error</span>
-            </tal:error>
-            <tal:hint tal:condition="widget/hint">
-              <span class="hint" tal:content="structure widget/hint">hint</span>
-            </tal:hint>
-          </td>
-        </tr>
-      </tal:block>
-    </tbody>
-  </table>
-
-  <div class="actionButtons" tal:condition="view/availableActions">
-    <input tal:repeat="action view/actions"
-           tal:replace="structure action/render"
-           />
-  </div>
-</form>
Index: in/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentbasemanagepage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentbasemanagepage.pt	(revision 6694)
+++ 	(revision )
@@ -1,59 +1,0 @@
-<h2 i18n:translate=""
-    tal:condition="view/label"
-    tal:content="view/label">Label</h2>
-
-<form action="." tal:attributes="action request/URL" method="post"
-      class="edit-form" enctype="multipart/form-data">
-
-  <div class="form-status"
-    tal:define="status view/status"
-    tal:condition="status">
-    Form Status:
-    <span i18n:translate="" tal:content="view/status">
-      Form status summary
-    </span>
-  </div>
-
-  <table class="form-fields zebra">
-    <tbody>
-      <tal:block repeat="widget view/widgets">
-        <tr>
-          <td class="label">
-            <label tal:attributes="for widget/name">
-              <span class="required" tal:condition="widget/required">*</span>
-              <span i18n:translate="" tal:content="widget/label">label</span>:
-            </label>
-          </td>
-          <td class="field">
-            <span class="widget" tal:content="structure widget">
-              <input type="text" />
-            </span>
-            <tal:error tal:condition="widget/error">
-              <span tal:replace="structure widget/error">error</span>
-            </tal:error>
-            <tal:hint tal:condition="widget/hint">
-              <span class="hint" tal:content="structure widget/hint">hint</span>
-            </tal:hint>
-          </td>
-        </tr>
-      </tal:block>
-      <tr>
-        <td class="label"><label>Registration Transition:</label></td>
-        <td>
-          <select id="transition" name="transition">
-            <option tal:repeat="transition view/getTransitions"
-                    tal:attributes="value transition/name">
-              <span tal:replace="transition/title">TRANSITIONTITLE</span>
-            </option>
-          </select>
-        </td>
-      </tr>
-    </tbody>
-  </table>
-
-  <div class="actionButtons" tal:condition="view/availableActions">
-    <input tal:repeat="action view/actions"
-           tal:replace="structure action/render"
-           />
-  </div>
-</form>
Index: in/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentscontainermanagepage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentscontainermanagepage.pt	(revision 6694)
+++ 	(revision )
@@ -1,46 +1,0 @@
-<h2 tal:content="view/label">Title</h2>
-<form method="POST">
-
-<br />
-
-  <input type="submit" name="search" value="Search" />
-  for students
-
-  <select name="searchtype">
-    <option value="student_id">with id</option>
-    <option value="name">with name</option>
-  </select>
-
-  <input type="text" name="searchterm" />
-
-  <p>&nbsp;</p>
-  <div tal:condition="view/hitlist">
-    <h3>Search Results</h3>
-    <input type="hidden" name="old_searchterm"
-         tal:attributes="value view/searchterm" />
-    <input type="hidden" name="old_searchtype"
-         tal:attributes="value view/searchtype" />
-    <table class="display dataTableManage">
-      <thead>
-    	<tr>
-    	  <th>&nbsp;</th>
-    	  <th>Student Id</th><th>Name</th>
-    	</tr>
-      </thead>
-      <tbody>
-    	<tr tal:repeat="item view/hitlist">
-    	  <td><input type="checkbox" name="entries"
-    	             tal:attributes="value item/context/__name__" /></td>
-    	  <td> <a tal:attributes="href item/url">
-          <span tal:content="item/student_id">A123456</span></a>
-        </td>
-    	  <td tal:content="item/name">Bob</td>
-    	</tr>
-      </tbody>
-    </table>
-    <div class="actionButtons">
-        <input type="submit" name="remove" value="Remove selected" />
-    </div>
-
-  </div>
-</form>
Index: in/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentscontainerpage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentscontainerpage.pt	(revision 6694)
+++ 	(revision )
@@ -1,40 +1,0 @@
-<h2 tal:content="view/label">Title</h2>
-<form method="POST">
-
-<br />
-
-  <input type="submit" name="search" value="Search" />
-  for students
-
-  <select name="searchtype">
-    <option value="student_id">with id</option>
-    <option value="name">with name</option>
-  </select>
-
-  <input type="text" name="searchterm" />
-
-  <p>&nbsp;</p>
-  <div tal:condition="view/hitlist">
-    <h3>Search Results</h3>
-    <input type="hidden" name="old_searchterm"
-         tal:attributes="value view/searchterm" />
-    <input type="hidden" name="old_searchtype"
-         tal:attributes="value view/searchtype" />
-    <table class="display dataTableManage">
-      <thead>
-    	<tr>
-    	  <th>Student Id</th><th>Name</th>
-    	</tr>
-      </thead>
-      <tbody>
-    	<tr tal:repeat="item view/hitlist">
-    	  <td> <a tal:attributes="href item/url">
-          <span tal:content="item/student_id">A123456</span></a>
-        </td>
-    	  <td tal:content="item/name">Bob</td>
-    	</tr>
-      </tbody>
-    </table>
-    <br />
-  </div>
-</form>
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/container.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/container.py	(revision 6694)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/container.py	(revision 6695)
@@ -49,4 +49,5 @@
             raise TypeError(
                 'StudentsContainers contain only IStudent instances')
+        student.clearance_locked = True
         self[student.student_id] = student
         studycourse = StudentStudyCourse()
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py	(revision 6694)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py	(revision 6695)
@@ -91,4 +91,9 @@
         )
 
+    clearance_locked = schema.Bool(
+        title = u'Clearance form locked',
+        default = False,
+        )
+
 class IStudentPersonal(IWAeUPObject):
     """Representation of student personal data.
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/student.py	(revision 6694)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/student.py	(revision 6695)
@@ -24,6 +24,6 @@
 from waeup.sirp.interfaces import IObjectHistory
 from waeup.sirp.students.interfaces import (
-    IStudent, IStudentNavigation, IStudentBaseEdit,
-    )
+    IStudent, IStudentNavigation, IStudentBaseEdit, IStudentClearanceEdit,
+    IStudentPersonalEdit)
 from waeup.sirp.utils.helpers import attrs_to_fields
 from waeup.sirp.students.utils import generate_student_id
@@ -34,5 +34,5 @@
     """
     grok.implements(IStudent, IStudentNavigation,
-        IStudentBaseEdit)
+        IStudentBaseEdit, IStudentClearanceEdit, IStudentPersonalEdit)
     grok.provides(IStudent)
 
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6694)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6695)
@@ -199,5 +199,5 @@
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
         self.assertEqual(self.browser.url, self.student_path)
-        self.browser.getLink("Edit").click()
+        self.browser.getLink("Manage").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
         self.assertEqual(self.browser.url, self.manage_student_path)
@@ -213,5 +213,5 @@
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
         self.assertEqual(self.browser.url, self.clearance_student_path)
-        self.browser.getLink("Edit").click()
+        self.browser.getLink("Manage").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
         self.assertEqual(self.browser.url, self.edit_clearance_student_path)
@@ -221,5 +221,5 @@
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
         self.assertEqual(self.browser.url, self.personal_student_path)
-        self.browser.getLink("Edit").click()
+        self.browser.getLink("Manage").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
         self.assertEqual(self.browser.url, self.edit_personal_student_path)
@@ -229,6 +229,6 @@
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
         self.assertEqual(self.browser.url, self.studycourse_student_path)
-        self.browser.getLink("Edit").click()
-        self.assertTrue('Edit study course' in self.browser.contents)
+        self.browser.getLink("Manage").click()
+        self.assertTrue('Manage study course' in self.browser.contents)
 
         self.browser.open(self.student_path)
@@ -274,5 +274,5 @@
         # We can login again with the new password
         self.browser.getLink("Login").click()
-        #self.browser.open(self.login_path)
+        self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.test_student_id
         self.browser.getControl(name="form.password").value = 'new_password'
@@ -280,3 +280,4 @@
         self.assertEqual(self.browser.url, self.student_path)
         self.assertTrue('You logged in' in self.browser.contents)
-        return
+
+        return
