Index: WAeUP_SRP/base/WAeUPTables.py
===================================================================
--- WAeUP_SRP/base/WAeUPTables.py	(revision 2737)
+++ WAeUP_SRP/base/WAeUPTables.py	(revision 2738)
@@ -125,4 +125,12 @@
     def deleteRecord(self, uid):
         self.uncatalog_object(uid)
+
+    def getRecordByKey(self,key):
+        if not key:
+            return None
+        res = self.evalAdvancedQuery(Eq(self.key,key))
+        if res:
+            return res[0]
+        return None
 
     def searchAndSetRecord(self, **data):
@@ -602,5 +610,4 @@
     #               "course_admitted",
     #               )
-    ###)
 
     def __init__(self,name=None):
@@ -1396,8 +1403,9 @@
 
 class PaymentsCatalog(WAeUPTable): ###(
+    security = ClassSecurityInfo()
 
     meta_type = 'WAeUP Payments Catalog'
     name = "students_catalog"
-    key = "id"
+    key = "key"
     def __init__(self,name=None):
         if name ==  None:
@@ -1405,4 +1413,34 @@
         WAeUPTable.__init__(self, name)
 
+    security.declarePrivate('notify_event_listener') ###(
+    def notify_event_listener(self,event_type,object,infos):
+        "listen for events"
+        if not infos.has_key('rpath'):
+            return
+        pt = getattr(object,'portal_type',None)
+        mt = getattr(object,'meta_type',None)
+        data = {}
+        if pt == 'Payment' and mt == 'CPS Proxy Folder':
+            order_id = object.id
+            if event_type == "sys_add_object":
+                try:
+                    self.addRecord(order_id = order_id)
+                except ValueError:
+                    pass
+                return
+            elif event_type == 'sys_del_object':
+                self.deleteRecord(order_id)
+        if pt != 'Payment' or mt == 'CPS Proxy Folder':
+            return
+        if event_type not in ('sys_modify_object'):
+            return
+        for field in self.schema():
+            data[field] = getattr(object,field)
+        rpl = infos['rpath'].split('/')
+        student_id = rpl[-3]
+        data['student_id'] = student_id
+        self.modifyRecord(**data)
+    ###)
+
 
 InitializeClass(PaymentsCatalog)
Index: WAeUP_SRP/base/Widgets.py
===================================================================
--- WAeUP_SRP/base/Widgets.py	(revision 2737)
+++ WAeUP_SRP/base/Widgets.py	(revision 2738)
@@ -769,5 +769,6 @@
 ##            return 0
         widget_id = self.getWidgetId()
-        value = makeCertificateCode(datastructure[widget_id]).upper()
+        #value = makeCertificateCode(datastructure[widget_id]).upper()
+        value = datastructure[widget_id].upper()
         id_pat_str = r"\S"
         inv_id_pat = re.compile(r"^%s$" % id_pat_str)
@@ -1148,4 +1149,6 @@
         widget_id = self.getWidgetId()
         v = datastructure[widget_id]
+        if not v:
+            v = []
         err = 0
         s = datastructure[widget_id+'_s'].strip()
Index: WAeUP_SRP/base/skins/waeup_layout/layout_apply_admission_create.pt
===================================================================
--- WAeUP_SRP/base/skins/waeup_layout/layout_apply_admission_create.pt	(revision 2737)
+++ WAeUP_SRP/base/skins/waeup_layout/layout_apply_admission_create.pt	(revision 2738)
@@ -3,54 +3,54 @@
 <!-- a layout_lib macro -->
 <!-- $Id: layout_apply_admission_create.pt 2141 2007-08-21 16:50:33Z henrik $ -->
-
 <metal:block define-macro="default_table"
-  tal:define="layout options/layout;
-  ds options/datastructure;
-  dm ds/getDataModel;
-  creation creation|nothing;
-  metadata metadata|nothing;
-  cpsmcat nocall:here/translation_service;
-  apply request/apply_button|nothing;">
-  
-  <table  cellpadding="2" cellspacing="2" summary="Form layout" border=0
-       tal:condition="layout/rows">
-  <tr tal:repeat="row layout/rows" valign="top">
-
-  <span tal:repeat="cell row"> 
-        <tal:block define="widget cell/widget;
-                           wid widget/getWidgetId;
-                           err python:ds.getError(wid);
-                           err_mapping python:ds.getErrorMapping(wid);
-                           widget_css_class cell/widget_css_class|nothing;
-                           css_class python:test(err, 'row error','row')">
+             tal:define="layout options/layout;
+             ds options/datastructure;
+             dm ds/getDataModel;
+             creation creation|nothing;
+             metadata metadata|nothing;
+             cpsmcat nocall:here/translation_service;
+             apply request/apply_button|nothing;"
+             >
+    <table  cellpadding="2" cellspacing="2" summary="Form layout" border=0
+            tal:condition="layout/rows">
+      <span tal:repeat="row layout/rows" valign="top" tal:omit-tag="">
+        <span tal:repeat="cell row" tal:omit-tag=""> 
+          <tal:block define="widget cell/widget;
+          wid widget/getWidgetId;
+          err python:ds.getError(wid);
+          err_mapping python:ds.getErrorMapping(wid);
+          widget_css_class cell/widget_css_class|nothing;
+          css_class python:test(err, 'row error','row')">
           <span tal:attributes="class widget_css_class;
-                               id python:widget.getHtmlWidgetId()+'_widget';
-                              ">
-                              
-                    
-            <td valign="middle" tal:condition="python:widget.label_edit and widget.label_edit!='label field'">               
-              <div class="label">
-                <label tal:content="widget/label_edit"
-                  tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
-              </div>
-            </td>
-            
-            <td tal:condition="cell/widget_rendered">
-              <div tal:attributes="class python:test(widget.label_edit == 'label field', 'label','')">          
-              <label tal:replace="structure cell/widget_rendered"/>
-              </div>          
-              <tal:block condition="err">
+          id python:widget.getHtmlWidgetId()+'_widget';"
+          >
+            <tr tal:condition="widget/description|nothing" class="even ajaxtd">
+              <th colspan="5" align="left"><h3 tal:replace="widget/description" /></th>
+            </tr>
+            <tr>
+              <td valign="middle" tal:condition="python:widget.label_edit and widget.label_edit!='label field'">               
+                <div class="label">
+                  <label tal:content="widget/label_edit"
+                         tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
+                </div>
+              </td>
+              <td tal:condition="cell/widget_rendered">
+                <div tal:attributes="class python:test(widget.label_edit == 'label field', 'label','')">          
+                  <label tal:replace="structure cell/widget_rendered"/>
+                </div>          
+                <tal:block condition="err">
                   <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)">
                     <br /><em style="color: red"
-                      tal:content="msg">err</em>
+                              tal:content="msg">err</em>
                   </tal:block>
-              </tal:block>
-            </td>
-  
+                </tal:block>
+              </td>
+            </tr>
           </span>
         </tal:block>
-  </span>      
-  </tr>
+      </span>      
+    </span>      
   </table>
   <br/>
 </metal:block>
+  
