Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6791)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6792)
@@ -566,6 +566,9 @@
     form_fields = grok.AutoFields(IStudentStudyLevel)
     grok.template('studylevelpage')
-    title = 'Study Level'
-    pnav = 4
+    pnav = 4
+
+    @property
+    def title(self):
+        return 'Study Level %s' % self.context.level_title
 
     @property
@@ -573,4 +576,82 @@
         return '%s: Study Level %s' % (
             self.context.getStudent().name,self.context.level_title)
+
+class StudyLevelManageActionButton(ManageActionButton):
+    grok.order(1)
+    grok.context(IStudentStudyLevel)
+    grok.view(StudyLevelDisplayFormPage)
+    grok.require('waeup.manageStudents')
+    text = 'Manage'
+    target = 'manage'
+
+class StudyLevelManageFormPage(WAeUPEditFormPage):
+    """ Page to edit the student study level data
+    """
+    grok.context(IStudentStudyLevel)
+    grok.name('manage')
+    grok.require('waeup.manageStudents')
+    grok.template('studylevelmanagepage')
+    form_fields = grok.AutoFields(IStudentStudyLevel)
+    pnav = 4
+    taboneactions = ['Save','Cancel']
+    tabtwoactions = ['Remove selected tickets','Cancel']
+    tabthreeactions = ['Add course ticket']
+
+    def update(self):
+        super(StudyLevelManageFormPage, self).update()
+        tabs.need()
+        datatable.need()
+        return
+
+    @property
+    def title(self):
+        return 'Study Level %s' % self.context.level_title
+
+    @property
+    def label(self):
+        return 'Manage study level %s' % self.context.level_title
+
+    @grok.action('Save')
+    def save(self, **data):
+        msave(self, **data)
+        return
+
+    @grok.action('Add course ticket')
+    def addStudyLevel(self, **data):
+        # We need a ticket catalog
+        return
+
+        #course_code = self.request.form.get('addticket', None)
+        #try:
+        #    self.context.addCourseTicket(
+        #        self.context.certificate,studylevel)
+        #except KeyError:
+        #    self.flash('This ticket exists.')
+        #self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
+        #return
+
+    @grok.action('Remove selected tickets')
+    def delCourseTicket(self, **data):
+        form = self.request.form
+        if form.has_key('val_id'):
+            child_id = form['val_id']
+        else:
+            self.flash('No ticket selected.')
+            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
+            return
+        if not isinstance(child_id, list):
+            child_id = [child_id]
+        deleted = []
+        for id in child_id:
+            try:
+                del self.context[id]
+                deleted.append(id)
+            except:
+                self.flash('Could not delete %s: %s: %s' % (
+                        id, sys.exc_info()[0], sys.exc_info()[1]))
+        if len(deleted):
+            self.flash('Successfully removed: %s' % ', '.join(deleted))
+        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
+        return
 
 class PaymentsDisplayFormPage(WAeUPDisplayFormPage):
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studylevelmanagepage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studylevelmanagepage.pt	(revision 6792)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studylevelmanagepage.pt	(revision 6792)
@@ -0,0 +1,120 @@
+<h2 i18n:translate=""
+tal:condition="view/label"
+tal:content="view/label">Label</h2>
+
+<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>
+
+<form action="." tal:attributes="action request/URL" method="POST"
+      class="edit-form" enctype="multipart/form-data"> 
+
+<div id="tabs">
+<ul>
+  <li><a href="#tab-1"><span>Settings</span></a></li>
+  <li><a href="#tab-2"><span>Course Tickets</span></a></li>
+</ul>
+   
+<div id="tab-1">        
+  <table class="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">
+    <span tal:repeat="action view/actions"
+          tal:omit-tag="">
+      <input tal:condition="python:action.label in view.taboneactions"
+             tal:replace="structure action/render"/>
+    </span>
+  </div>
+</div>    
+    
+<div id="tab-2">
+  <h3>Course Tickets</h3>
+  <table class="display dataTableManage">
+  <thead>
+    <tr>
+      <th>&nbsp;</th>
+      <th>Level</th>
+      <th>Course Code</th>
+      <th>Course Title</th>
+      <th>Department</th>
+      <th>Faculty</th>
+      <th>Credits</th>
+      <th>Mandatory</th>
+      <th>Score</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr tal:repeat="value context/values">
+       <td>
+        <input type="checkbox" name="val_id"
+  		  tal:attributes="value value/__name__" />
+      </td>
+      <td tal:content="value/level">LEVEL</td>
+      <td> <a tal:attributes="href value/__name__">
+      <span tal:content="value/code">CODE</span>
+      </a></td>
+      <td tal:content="value/title">TITLE</td>
+      <td tal:content="value/department">DEPARTMENT</td>
+      <td tal:content="value/faculty">FACULTY</td>
+      <td tal:content="value/credits">CREDITS</td>
+      <td tal:content="value/core_or_elective">MANDATORY</td>
+      <td tal:content="value/score">SCORE</td>
+    </tr>
+  </tbody>
+  </table>
+
+  <div class="actionButtons" tal:condition="view/availableActions">
+    <span tal:repeat="action view/actions"
+          tal:omit-tag="">
+      <input tal:condition="python:action.label in view.tabtwoactions"
+             tal:replace="structure action/render"/>
+    </span>
+  </div>
+
+  <br /><br /><br />
+
+  <div>
+    <span class="actionButtons" tal:condition="view/availableActions">
+      <span tal:repeat="action view/actions"
+            tal:omit-tag="">
+        <input tal:condition="python:action.label in view.tabthreeactions"
+               tal:replace="structure action/render"/>
+      </span>
+    </span>
+
+  </div>
+
+</div>
+</div>
+</form>  
+
+
+
