Index: /WAeUP_SRP/base/Upload.py
===================================================================
--- /WAeUP_SRP/base/Upload.py	(revision 3291)
+++ /WAeUP_SRP/base/Upload.py	(revision 3292)
@@ -63,5 +63,6 @@
     def checkKeys(self):
         """check fields in csv-headline"""
-        csv_path = os.path.join(storage_path,self.filename)
+        doc = self.getContent()
+        csv_path = os.path.join(storage_path,doc.filename)
         importer_name = ''.join([part.capitalize() for part in self.getContent().import_layout.split('_')])
         importer = eval("%sImport" % importer_name)(self)
@@ -69,5 +70,12 @@
         invalid_keys = []
         if not os.path.exists(csv_path):
-            msg = 'No such file %(csv_path)s' % vars()
+            base,ext = os.path.splitext(csv_path)
+            if os.path.exists("%(base)s.done" % vars()):
+            #import pdb;pdb.set_trace()
+                #msg = "imported"
+                pass
+            else:
+                base_path = os.path.split(csv_path)[1]
+                msg = 'No such file %(base_path)s' % vars()
         else:
             headline = csv.reader(open(csv_path,"rb")).next()
@@ -79,5 +87,5 @@
         return msg,invalid_keys
 
-    security.declareProtected(View,"checkFields") ###(
+    security.declareProtected(View,"getFields") ###(
     def getKeys(self):
         """return the valid keys for headline"""
@@ -87,5 +95,12 @@
         keys.sort()
         return keys
+    ###)
     
+    security.declareProtected(View,"getUploadFileInfo") ###(
+    def getUploadFileInfo(self):
+        """return the valid keys for headline"""
+        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 3291)
+++ /WAeUP_SRP/base/WAeUPImport.py	(revision 3292)
@@ -137,5 +137,5 @@
     ###)
 
-    def checkHeadline(self,headline):
+    def checkHeadline(self,headline): ###(
         """ check the headline of an csv.file """
         import_keys = [k.strip() for k in headline if not (k.strip().startswith('ignore')
@@ -147,4 +147,5 @@
             return list(diff2schema)
         return []
+    ###)
 ###)
 
Index: /WAeUP_SRP/base/WAeUPTool.py
===================================================================
--- /WAeUP_SRP/base/WAeUPTool.py	(revision 3291)
+++ /WAeUP_SRP/base/WAeUPTool.py	(revision 3292)
@@ -52,5 +52,5 @@
 import csv,re,os,sys
 import md5
-from shutil import copy2
+from shutil import copy2,copy
 from Products.AdvancedQuery import Eq, Between, Le,In
 
@@ -1388,4 +1388,5 @@
         import random
         students_folder = self.portal_url.getPortalObject().campus.students
+        uploads_folder = self.portal_url.getPortalObject().campus.uploads
         pending_only = False
         pend_str = '--'
@@ -1456,8 +1457,10 @@
         total_added_to_imported = 0
         total_pending = 0
+        import_source_done = ""
         if pending_only:
             import_source_path = pending_path
         else:
             import_source_path = "%s/import/%s.csv" % (i_home,filename)
+            import_source_done = "%s/import/%s.done" % (i_home,filename)
         if not os.path.exists(import_source_path):
             fn = os.path.split(import_source_path)[1]
@@ -1626,9 +1629,17 @@
         #msg += "%(total_pending)d totally written" % vars()    # this line does not make any sense
         logger.info(msg)
+        if import_source_done:
+            copy(import_source_path,import_source_done)
+            os.remove(import_source_path)
+            upload = getattr(uploads_folder,os.path.split(import_source_path)[1],None)
+            if upload is not None:
+                upload_doc = upload.getContent()
+                mapping = {}
+                mapping['imported_at'] = DateTime.DateTime()
+                mapping['import_message'] = msg
+                upload_doc.edit(mapping = mapping)
         os.remove(pending_tmp)
         return msg
     ###)
-
-
 
     security.declareProtected(ModifyPortalContent,"moveImagesToFS")###(
Index: /WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt
===================================================================
--- /WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt	(revision 3291)
+++ /WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt	(revision 3292)
@@ -1,4 +1,4 @@
 <metal:html tal:define="info options/info;
-            portal_status_message options/psm;
+            portal_status_message options/psm|request/portal_status_message;
             ds options/ds;
             mode options/mode;
@@ -23,82 +23,156 @@
                class="destructive" />
       </form>
-      <form action="" method="post" class="group"
-            tal:attributes="action info/action"
-            tal:define="rows python: info['items'];"
-            >
-        <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">      
-          <tr>
-            <th></th>
-            <th>Filename</th>
-            <th>Data Layout</th>
-            <th>By</th>
-            <th>Date</th>
-            <th>Message</th>
-            <th>Unknown Fields</th>
-          </tr>            
-          <tr tal:repeat="row rows"
-            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">
-                  <option tal:repeat="new row/valid_keys"
-                          tal:attributes="value new"
-                          tal:content="new" />
+      <span tal:condition="info/wrong">
+        <h2>Uploads which must be corrected:</h2>
+        <form  action="" method="post" class="group"
+               tal:attributes="action info/action"
+               >
+          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">      
+            <tr>
+              <th></th>
+              <th>Filename</th>
+              <th>Data Layout</th>
+              <th>By</th>
+              <th>Date</th>
+              <th>Message</th>
+              <th>Unknown Fields</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>
-              </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]
+              </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">
+                    <option tal:repeat="new row/valid_keys"
+                            tal:attributes="value new"
+                            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>
-        
-        <br />
-
-        <input tal:condition="nothing" type="button" value="button_select_all" class="context"
-               onclick="someJavaScriptFunctionThatWillBeReplaced"
-               i18n:attributes="value"
-               tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
-               % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
-               />
-        <input type="submit" name="edit" value="Edit"
-               class="destructive" i18n:attributes="value"
-               />
-        <input type="submit" name="folder_delete:method" value="button_delete"
-               class="destructive" i18n:attributes="value"
-               tal:attributes="onclick python:'return window.confirm(\'%s\')' %
-               (cpsmcat('description_confirm_delete'), )" 
-               />
-
-      </form>
+              </td>
+            </tr>
+          </table>
+          <br />
+          <input tal:condition="nothing" type="button" value="button_select_all" class="context"
+                 onclick="someJavaScriptFunctionThatWillBeReplaced"
+                 i18n:attributes="value"
+                 tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
+                 % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
+                 />
+          <input type="submit" name="edit" value="edit"
+                 class="destructive" i18n:attributes="value"
+                 />
+          <input type="submit" name="folder_delete:method" value="button_delete"
+                 class="destructive" i18n:attributes="value"
+                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                 (cpsmcat('description_confirm_delete'), )" 
+                 />
+        </form>
+      </span>
+      <span tal:condition="info/importable">
+        <h2>Importable Uploads:</h2>
+        <form action="" method="post" class="group"
+              tal:attributes="action info/action"
+              >
+          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">      
+            <tr>
+              <th></th>
+              <th>Filename</th>
+              <th>Data Layout</th>
+              <th>By</th>
+              <th>Date</th>
+            </tr>            
+            <tr tal:repeat="row info/importable"
+                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 tal:content="row/import_layout"></td>
+              <td tal:content="row/uploaded_by" ></td>
+              <td tal:content="row/upload_date" ></td>
+              <td tal:content="row/msg" ></td>
+            </tr>
+          </table>
+          <br />
+          <input tal:condition="nothing" type="button" value="button_select_all" class="context"
+                 onclick="someJavaScriptFunctionThatWillBeReplaced"
+                 i18n:attributes="value"
+                 tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
+                 % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
+                 />
+          <input type="submit" name="import_uploads:method" value="import"
+                 class="destructive" i18n:attributes="value"
+                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                 (cpsmcat('description_confirm_delete'), )" 
+                 />
+          <input type="submit" name="folder_delete:method" value="button_delete"
+                 class="destructive" i18n:attributes="value"
+                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                 (cpsmcat('description_confirm_delete'), )" 
+                 />
+        </form>
+      </span>
+      <span tal:condition="info/imported">
+        <h2>Imported Uploads:</h2>
+        <form action="" method="post" class="group"
+              tal:attributes="action info/action"
+              >
+          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">      
+            <tr>
+              <th>Filename</th>
+              <th>Data Layout</th>
+              <th>By</th>
+              <th>Date</th>
+              <th>Import Date</th>
+              <th>Message</th>
+            </tr>            
+            <tr tal:repeat="row info/imported"
+                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
+              <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}.done" ></td>
+              <td tal:content="row/import_layout"></td>
+              <td tal:content="row/uploaded_by" ></td>
+              <td tal:content="row/upload_date" ></td>
+              <td tal:content="row/imported_at" ></td>
+              <td tal:content="row/msg"></td>
+            </tr>
+          </table>
+        </form>
+      </span>
     </metal:main>
-    
     <metal:sub fill-slot="sub"/>
   </metal:body>
Index: /WAeUP_SRP/base/skins/waeup_upload/uploads_index.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_upload/uploads_index.py	(revision 3291)
+++ /WAeUP_SRP/base/skins/waeup_upload/uploads_index.py	(revision 3292)
@@ -1,3 +1,3 @@
-## Script (Python) "getUploadsInfo"
+## Script (Python) "uploads_index"
 ##bind container=container
 ##bind context=context
@@ -5,8 +5,8 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=student=None
+##parameters=
 ##title=
 ##
-# $Id:getUploadsInfo.py 486 2006-09-06 10:09:39Z joachim $
+# $Id:uploads_index.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Uploads
@@ -35,5 +35,4 @@
 info['doc'] = context.getContent()
 
-items = []
 edit = request.form.has_key('edit')
 ids = request.get('ids',[])
@@ -59,5 +58,9 @@
         request.RESPONSE.redirect(context.absolute_url())
 
+wrong = []
+imported = []
+importable = []
 for id,upload in context.objectItems():
+    add_to = wrong
     row = {}
     doc = upload.getContent()
@@ -67,12 +70,27 @@
     row['title'] = doc.filename
     row['url'] = upload.absolute_url()
-    row['msg'], row['invalid_keys'] = doc['checkKeys']()
+    row['imported'] = False
+    row['invalid_keys'] = []
+    import_message = getattr(doc,'import_message','')
+    if import_message:
+        row['imported'] = True
+        row['msg'] = import_message
+        row['imported_at'] = doc.imported_at.strftime("%d/%m/%y %H:%M:%S")
+        add_to = imported
+    else:
+        row['msg'],row['invalid_keys'] = doc['checkKeys']()
+        if not row['msg'] and not row['invalid_keys']:
+            add_to = importable
     row['filename'] = doc.filename
     row['import_layout'] = doc.import_layout
     row['upload_date'] =  doc.upload_date.strftime("%d/%m/%y %H:%M:%S")
     row['uploaded_by'] = doc.uploaded_by
-    items.append(row)
-items.sort()
-info['items'] = items
+    add_to.append(row)
+wrong.sort()
+imported.sort()
+importable.sort()
+info['wrong'] = wrong
+info['imported'] = imported
+info['importable'] = importable
 
 validate = "upload" in request.keys()
Index: /WAeUP_SRP/uniben/profiles/default/schemas/upload.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/schemas/upload.xml	(revision 3291)
+++ /WAeUP_SRP/uniben/profiles/default/schemas/upload.xml	(revision 3292)
@@ -7,3 +7,4 @@
   <field name="uploaded_by" meta_type="CPS String Field"/>
   <field name="import_date" meta_type="CPS DateTime Field"/>
+  <field name="import_message" meta_type="CPS String Field"/>
 </object>
