Index: WAeUP_SRP/base/Upload.py
===================================================================
--- WAeUP_SRP/base/Upload.py	(revision 3313)
+++ WAeUP_SRP/base/Upload.py	(revision 3314)
@@ -14,4 +14,6 @@
 from WAeUPImport import CourseImport,CourseResultImport
 from WAeUPImport import DepartmentImport,FacultyImport,StudentImport,VerdictImport
+from WAeUPImport import NO_KEY
+ 
 import logging
 import csv,re,os
@@ -21,5 +23,4 @@
 p_home = Globals.package_home(globals())
 i_home = Globals.INSTANCE_HOME
-
 storage_path = "%s/%s" % (i_home,'import')
 
@@ -53,5 +54,5 @@
     portal_type = meta_type
     security = ClassSecurityInfo()
-
+    NO_KEY = NO_KEY
     security.declareProtected(View,"Title") ###(
     def Title(self):
@@ -69,4 +70,5 @@
         msg = ''
         invalid_keys = []
+        keys = []
         if not os.path.exists(csv_path):
             base,ext = os.path.splitext(csv_path)
@@ -79,5 +81,7 @@
                 msg = 'No such file %(base_path)s' % vars()
         else:
-            headline = csv.reader(open(csv_path,"rb")).next()
+            reader = csv.reader(open(csv_path,"rb"))
+            headline = reader.next()
+            values = reader.next()
             if "import_mode" not in headline:
                 msg += 'import_mode must be in heading'
@@ -85,6 +89,8 @@
             if invalid_keys:
                 msg += "invalid keys in heading"
-        return msg,invalid_keys
-
+            keys = importer.getHeadlineFields(headline,values)
+        return msg,keys
+    ###)
+    
     security.declareProtected(View,"getFields") ###(
     def getKeys(self):
@@ -102,5 +108,6 @@
         doc = self.getContent()
         return os.stat(os.path.join(storage_path,doc.filename))
-        
+    ###)
+    
     security.declareProtected(ModifyPortalContent,"editHeadline") ###(
     def editHeadline(self,key_pairs):
Index: WAeUP_SRP/base/WAeUPImport.py
===================================================================
--- WAeUP_SRP/base/WAeUPImport.py	(revision 3313)
+++ WAeUP_SRP/base/WAeUPImport.py	(revision 3314)
@@ -50,4 +50,6 @@
 i_home = INSTANCE_HOME
 from utils import makeDigest
+
+NO_KEY = '----'
 
 class WAeUPImport(UniqueObject, SimpleItem, ActionProviderBase): ###(
@@ -147,4 +149,24 @@
             return list(diff2schema)
         return []
+    ###)
+
+    def getHeadlineFields(self,headline,values): ###(
+        """ check the headline of an csv.file """
+        import_keys = [k.strip() for k in headline if not (k.strip().startswith('ignore')
+                                                        or k.strip() in self.info.keys())]
+        si = set(import_keys)
+        ss = set(self.schema.keys())
+                 
+        invalid_keys = si - ss
+        diff2layout = set(import_keys).difference(set(self.layout.keys()))
+        keys = []
+        i = 0
+        for k in import_keys:
+            if k in invalid_keys:
+                keys += (k,NO_KEY,values[i]),
+            else:
+                keys += (k,k,values[i]),
+            i += 1
+        return keys
     ###)
 ###)
Index: WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt
===================================================================
--- WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt	(revision 3313)
+++ WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt	(revision 3314)
@@ -36,48 +36,50 @@
               <th>Upload Date</th>
               <th>Error Message</th>
-              <th>Invalid Keys</th>
             </tr>            
-            <tr tal:repeat="row info/wrong"
-                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
-              <td align="left" valign="middle" style="width: 5px;">
-                <input type="checkbox" name="ids:list" value="" id="" class="noborder"
-                       tal:define="id string:${row/id}.csv"
-                       tal:attributes="value id;
-                       id python:'cb_' + id;
-                       checked python:id in info['choosen_ids'];" 
-                       />
-              </td>
-              <td tal:condition="nothing"> <a href="view" tal:attributes="href string:${row/url}"> <span tal:content="row/id" /></a>  </td>
-              <td tal:content="string:${row/id}.csv" ></td>
-              <td>
-                <select name="import_layout:record" tal:attributes="name string:${row/id}.import_layout:record">
-                  <option tal:repeat="option python: context.portal_vocabularies.import_names.items()"
-                          tal:attributes="value python: option[0];
-                          selected python: option[0] == row['import_layout']" 
-                          tal:content="python:option[1]" />
-                </select>
-              </td>
-              <td tal:content="row/uploaded_by" ></td>
-              <td tal:content="row/upload_date" ></td>
-              <td tal:content="row/msg" ></td>
-              <td>
-                <div tal:repeat="key row/invalid_keys">
-                  <span tal:replace="key" /><br />
-                  <select tal:attributes="name string:${row/id}|${key}.valid_key:record">
+            <span tal:repeat="row info/wrong" tal:omit-tag="">
+              <tr tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
+                <td align="left" valign="middle" style="width: 5px;">
+                  <input type="checkbox" name="ids:list" value="" id="" class="noborder"
+                         tal:define="id string:${row/id}.csv"
+                         tal:attributes="value id;
+                         id python:'cb_' + id;
+                         checked python:id in info['choosen_ids'];" 
+                         />
+                </td>
+                <td tal:condition="nothing"> <a href="view" tal:attributes="href string:${row/url}"> <span tal:content="row/id" /></a>  </td>
+                <td tal:content="string:${row/id}.csv" ></td>
+                <td>
+                  <select name="import_layout:record" tal:attributes="name string:${row/id}.import_layout:record">
+                    <option tal:repeat="option python: context.portal_vocabularies.import_names.items()"
+                            tal:attributes="value python: option[0];
+                            selected python: option[0] == row['import_layout']" 
+                            tal:content="python:option[1]" />
+                  </select>
+                </td>
+                <td tal:content="row/uploaded_by" ></td>
+                <td tal:content="row/upload_date" ></td>
+                <td tal:content="row/msg" ></td>
+              </tr>
+              <tr>
+                <th>Current</th>
+                <th>Possible</th>
+                <th>Value from 1. record</th>
+              </tr>
+              <tr tal:repeat="key row/invalid_keys">
+                <td colspan="1"> 
+                  <font tal:attributes="color python: test(key[1] == '----','red','black')" tal:content="python: key[0]" />
+                </td>
+                <td colspan="1" 
+                    tal:define="old_key python: key[0];new_key python: key[1];">
+                  <select tal:attributes="name string:${row/id}|${old_key}.valid_key:record">
                     <option tal:repeat="new row/valid_keys"
-                            tal:attributes="value new"
+                            tal:attributes="value new; selected python: new == new_key"
                             tal:content="new" />
-                  </select>
-                </div>
-              </td>
-              <td tal:condition="python:0"> 
-                <a href="edit" tal:attributes="href string:${row/url}/external_edit_form"
-                   target="edit"
-                   onclick="javascript:window.open('','edit','width=600, height=700, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, status=no, resizable=no, dependent=no')">
-                  [edit]
-                </a> 
-              </td>
-            </tr>
-          </table>
+                  </select><br />
+                </td>
+                <td colspan="1" tal:content="python: key[2]" />
+              </tr>
+            </span>
+            </table>
           
           <br />
@@ -149,4 +151,7 @@
                  (cpsmcat('description_confirm_delete'), )" 
                  />
+          <input type="submit" name="goto_edit" value="Edit again"
+                 class="destructive" i18n:attributes="value"
+                 />
           <input type="submit" name="folder_delete:method" value="button_delete"
                  class="destructive" i18n:attributes="value"
Index: WAeUP_SRP/base/skins/waeup_upload/uploads_index.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_upload/uploads_index.py	(revision 3313)
+++ WAeUP_SRP/base/skins/waeup_upload/uploads_index.py	(revision 3314)
@@ -29,5 +29,4 @@
 
 path_info = request.get('PATH_INFO').split('/')
-NO_KEY = '----'
 info = {}
 info['action'] = "%s" % context.absolute_url()
@@ -47,14 +46,15 @@
         msg, invalid_keys = doc['checkKeys']()
         new_keys = []
-        for key in invalid_keys:
-            id_key = "%s|%s" % (short_id,key)
+        for old_key,previous,value in invalid_keys:
+            id_key = "%s|%s" % (short_id,old_key)
             if request.form.has_key(id_key):
                 new_key = request.form.get(id_key)['valid_key']
-                if new_key != NO_KEY:
-                    new_keys += (key,new_key),
+                if new_key != old_key and new_key != doc.NO_KEY:
+                    new_keys += (old_key,new_key),
         if new_keys:
             doc.editHeadline(new_keys)
             for key in new_keys:
                 logger.info('%s changed column heading in file %s from %s to %s' % (member,long_id,key[0],key[1]))
+    return request.RESPONSE.redirect(context.absolute_url())
 
 wrong = []
@@ -66,5 +66,5 @@
     doc = upload.getContent()
     row['valid_keys'] = doc['getKeys']()
-    row['valid_keys'][0] = NO_KEY
+    row['valid_keys'][0:0] = doc.NO_KEY,
     row['id'] = id.replace('.csv','')
     row['title'] = doc.filename
@@ -75,4 +75,5 @@
     if import_message:
         row['imported'] = True
+        row['imported_by'] = getattr('doc','imported_by','')
         row['msg'] = import_message
         if getattr(doc,'import_date',''):
@@ -83,10 +84,10 @@
     else:
         row['msg'],row['invalid_keys'] = doc['checkKeys']()
-        if not row['msg'] and not row['invalid_keys']:
+        if not (request.has_key('goto_edit') and id in ids) and not row['msg']:
             add_to = importable
     row['filename'] = doc.filename
     row['import_layout'] = doc.import_layout
+    row['uploaded_by'] =  doc.uploaded_by
     row['upload_date'] =  doc.upload_date.strftime("%d/%m/%y %H:%M:%S")
-    row['uploaded_by'] = doc.uploaded_by
     row['imported_by'] = doc.imported_by
     add_to.append(row)
