Index: /WAeUP_SRP/base/Upload.py
===================================================================
--- /WAeUP_SRP/base/Upload.py	(revision 3315)
+++ /WAeUP_SRP/base/Upload.py	(revision 3316)
@@ -14,5 +14,5 @@
 from WAeUPImport import CourseImport,CourseResultImport
 from WAeUPImport import DepartmentImport,FacultyImport,StudentImport,VerdictImport
-from WAeUPImport import NO_KEY
+from WAeUPImport import NO_KEY,IGNORE
  
 import logging
@@ -55,4 +55,5 @@
     security = ClassSecurityInfo()
     NO_KEY = NO_KEY
+    IGNORE = IGNORE
     security.declareProtected(View,"Title") ###(
     def Title(self):
@@ -89,5 +90,7 @@
             if invalid_keys:
                 msg += "invalid keys in heading"
-            keys = importer.getHeadlineFields(headline,values)
+            err,keys = importer.getHeadlineFields(headline,values)
+            if err:
+                msg += err
         return msg,keys
     ###)
@@ -120,6 +123,5 @@
         records = [record for record in reader]
         #import pdb;pdb.set_trace()
-        for old,new in key_pairs:
-            pos = headline.index(old)
+        for old,new,pos in key_pairs:
             del headline[pos]
             headline.insert(pos,new)
Index: /WAeUP_SRP/base/WAeUPImport.py
===================================================================
--- /WAeUP_SRP/base/WAeUPImport.py	(revision 3315)
+++ /WAeUP_SRP/base/WAeUPImport.py	(revision 3316)
@@ -52,5 +52,5 @@
 
 NO_KEY = '----'
-
+IGNORE = 'ignore'
 class WAeUPImport(UniqueObject, SimpleItem, ActionProviderBase): ###(
     """ WAeUPImport """
@@ -143,4 +143,5 @@
         import_keys = [k.strip() for k in headline if not (k.strip().startswith('ignore')
                                                         or k.strip() in self.info.keys())]
+        # import_keys = [k.strip() for k in headline if not (k.strip() in self.info.keys())]
         diff2schema = set(import_keys).difference(set(self.schema.keys()))
         diff2layout = set(import_keys).difference(set(self.layout.keys()))
@@ -153,21 +154,33 @@
     def getHeadlineFields(self,headline,values): ###(
         """ check the headline of a csv file """
-        #import_keys = [k.strip() for k in headline if not (k.strip().startswith('ignore')
-        #                                                or k.strip() in self.info.keys())]
-        import_keys = [k.strip() for k in headline]                                                        
+        # import_keys = [k.strip() for k in headline if not (k.strip().startswith('ignore')
+        #                                                 or k.strip() in self.info.keys())]
+        import_keys = [k.strip() for k in headline if not (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
+        duplicates = False
+        singels = []
+        msg = ''
+        while True:
+            if len(values) != len(import_keys):
+                msg += "%d fields in headline but %d values" % (len(import_keys),len(values))
+                break
+            for k in import_keys:
+                if k in singels:
+                    keys += (k,'DUP_%s' % k,values[i],'duplicate'),
+                    msg += ("duplicate %s," % k)
+                    keys[singels.index(k)] = (k,'DUP_%s' % k,values[singels.index(k)],'duplicate')
+                elif k in invalid_keys and not k.startswith(IGNORE):
+                    keys += (k,NO_KEY,values[i],'invalid'),
+                else:
+                    keys += (k,k,values[i],''),
+                i += 1
+                singels += k,
+            break
+        return msg,keys
     ###)
 ###)
Index: /WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt
===================================================================
--- /WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt	(revision 3315)
+++ /WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt	(revision 3316)
@@ -66,13 +66,16 @@
                 <th>Value from 1. record</th>
               </tr>
-              <tr tal:repeat="key row/invalid_keys">
+              <tr tal:repeat="key row/fields">
                 <td colspan="1"> 
-                  <font tal:attributes="color python: test(key[1] == '----' and not key[0].startswith('ignore'),'red','black')" tal:content="python: key[0]" />
+                  <font tal:attributes="color python: test(key[3],'red','black')">
+                    <span tal:content="python: key[1]" tal:omit-tag=""/> 
+                    <span tal:condition="python: key[3]" tal:content="python: key[3]" tal:omit-tag=""/> 
+                  </font>
                 </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">
+                  <select tal:attributes="name string:${row/id}|${repeat/key/index}.valid_key:record">
                     <option tal:repeat="new row/valid_keys"
-                            tal:attributes="value new; selected python: new == new_key"
+                            tal:attributes="value new; selected python: new_key == new"
                             tal:content="new" />
                   </select><br />
Index: /WAeUP_SRP/base/skins/waeup_upload/uploads_index.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_upload/uploads_index.py	(revision 3315)
+++ /WAeUP_SRP/base/skins/waeup_upload/uploads_index.py	(revision 3316)
@@ -36,5 +36,4 @@
 edit = request.form.has_key('edit')
 ids = request.get('ids',[])
-#set_trace()
 if edit and ids:
     for long_id in ids:
@@ -46,14 +45,23 @@
         msg, invalid_keys = doc['checkKeys']()
         new_keys = []
-        for old_key,previous,value in invalid_keys:
-            id_key = "%s|%s" % (short_id,old_key)
+        i = 0
+        for old_key,previous,value,err in invalid_keys:
+            id_key = "%s|%s" % (short_id,i)
             if request.form.has_key(id_key):
                 new_key = request.form.get(id_key)['valid_key']
-                if new_key != old_key and new_key != doc.NO_KEY:
-                    new_keys += (old_key,new_key),
+                if new_key != old_key:
+                    if new_key == doc.IGNORE:
+                        new_keys += (old_key,"%s_%s" % (doc.IGNORE,old_key),i),
+                    elif new_key != doc.NO_KEY:
+                        new_keys += (old_key,new_key,i),
+            i += 1
         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]))
+                logger.info('%s changed column %s heading in file %s from %s to %s' % (member,
+                                                                                    key[2],
+                                                                                    long_id,
+                                                                                    key[0],
+                                                                                    key[1]))
     return request.RESPONSE.redirect(context.absolute_url())
 
@@ -67,9 +75,10 @@
     row['valid_keys'] = doc['getKeys']()
     row['valid_keys'][0:0] = doc.NO_KEY,
+    row['valid_keys'][1:1] = doc.IGNORE,
     row['id'] = id.replace('.csv','')
     row['title'] = doc.filename
     row['url'] = upload.absolute_url()
     row['imported'] = False
-    row['invalid_keys'] = []
+    row['fields'] = []
     import_message = getattr(doc,'import_message','')
     if import_message:
@@ -83,5 +92,5 @@
         add_to = imported
     else:
-        row['msg'],row['invalid_keys'] = doc['checkKeys']()
+        row['msg'],row['fields'] = doc['checkKeys']()
         if not (request.has_key('goto_edit') and id in ids) and not row['msg']:
             add_to = importable
