Index: /WAeUP_SRP/base/WAeUPImport.py
===================================================================
--- /WAeUP_SRP/base/WAeUPImport.py	(revision 3190)
+++ /WAeUP_SRP/base/WAeUPImport.py	(revision 3191)
@@ -55,5 +55,5 @@
     required_modes = ('create',)
 
-    def __init__(self,mode,waeup_tool):
+    def __init__(self,waeup_tool):
         self.member = member = waeup_tool.portal_membership.getAuthenticatedMember()
         self.import_date = DateTime.DateTime().strftime("%d/%m/%y %H:%M:%S")
@@ -68,9 +68,9 @@
         self.courses_catalog = waeup_tool.courses_catalog
         self.course_results = waeup_tool.course_results
-        self.mode = mode
-        self.import_method = getattr(self, '%s' % mode,None)
+        #self.mode = mode
+        # self.import_method = getattr(self, '%s' % mode,None)
         errors = []
-        if self.import_method is None:
-            errors.append('No importer method %s' % mode)
+        # if self.import_method is None:
+        #     errors.append('No importer method %s' % mode)
         self.pending_path = "%s/import/%s.pending" % (i_home,self.plural_name)
         self.pending_tmp = "%s/import/%s.pending.tmp" % (i_home,self.plural_name)
@@ -96,5 +96,5 @@
         info['imported_by'] = str(member)
         info['import_date'] = self.import_date
-        info['import_mode'] = mode
+        #info['import_mode'] = mode #now in import_xxx schema + layout
         info['error'] = ''
         #info['digest'] = ''
Index: /WAeUP_SRP/base/WAeUPTool.py
===================================================================
--- /WAeUP_SRP/base/WAeUPTool.py	(revision 3190)
+++ /WAeUP_SRP/base/WAeUPTool.py	(revision 3191)
@@ -1353,16 +1353,16 @@
         if filename == pend_str:
             pending_only = True
-        mode = "create"
-        if edit:
-            if filename.endswith('_toDelete'):
-                mode = "delete"
-            else:
-                mode = "edit"
+        # mode = "create"
+        # if edit:
+        #     if filename.endswith('_toDelete'):
+        #         mode = "delete"
+        #     else:
+        #         mode = "edit"
         importer_name = ''.join([part.capitalize() for part in name.split('_')])
-        importer = eval("%sImport" % importer_name)(mode,self)
+        importer = eval("%sImport" % importer_name)(self)
         logger = importer.logger
         if importer.init_errors:
-            logger.info(self.init_errors)
-            return self.init_errors
+            logger.info(importer.init_errors)
+            return importer.init_errors
         member = importer.member
         current = importer.current
@@ -1423,4 +1423,8 @@
         info['imported_from'] = import_source_fn
         attrs = csv.reader(open(import_source_path,"rb")).next()
+        if "import_mode" not in attrs:
+            msg = 'import_mode must be in heading'
+            return msg
+            
         import_keys = [k.strip() for k in attrs if not (k.strip().startswith('ignore')
                                                         or k.strip() in info.keys())]
@@ -1430,12 +1434,12 @@
             msg = 'not ignorable key(s): "%s" found in heading' % ", ".join(diff2schema)
             return msg
-        if mode in importer.required_modes:
-            required_keys = [importer.layout.getIdUnprefixed(id)
-                                for id,widget in importer.layout.objectItems()
-                                if widget.is_required]
-            if not set(required_keys).issubset(set(import_keys)):
-                diff2import = set(required_keys).difference(set(import_keys))
-                msg = 'required key(s): "%s" not found in heading' % ", ".join(diff2import)
-                return msg
+        # if import_mode in importer.required_modes:
+        #     required_keys = [importer.layout.getIdUnprefixed(id)
+        #                         for id,widget in importer.layout.objectItems()
+        #                         if widget.is_required]
+        #     if not set(required_keys).issubset(set(import_keys)):
+        #         diff2import = set(required_keys).difference(set(import_keys))
+        #         msg = 'required key(s): "%s" not found in heading' % ", ".join(diff2import)
+        #         return msg
         #
         # start importing
@@ -1467,6 +1471,5 @@
                 start = False
                 adapters = [MappingStorageAdapter(importer.schema, item)]
-                logger.info('%(member)s starts import from %(import_source_fn)s in %(mode)s mode' % vars())
-                #logger.info('%s starts import from %s in %s mode with schema and layout %s' % (member,filename,mode,iname))
+                logger.info('%(member)s starts import from %(import_source_fn)s' % vars())
             dm = DataModel(item, adapters,context=self)
             ds = DataStructure(data=item,datamodel=dm)
@@ -1474,13 +1477,18 @@
             total += 1
             error_count = 0
-            for k in import_keys:
-                if k not in item.keys() or k not in importer.validators.keys():
-                    continue
-                if not importer.validators[k](ds,mode=mode):
-                    if error_count:
-                        error_string += ' ++ '
-                    error_string += "%s: %s" % (k,self.translation_service(ds.getError(k),
+            import_mode = item.get('import_mode','edit')
+            import_method = getattr(importer, '%(import_mode)s' % vars(),None )
+            if import_method is None:
+                error_string += "no %(import_mode)s " % vars()
+            else:
+                for k in import_keys:
+                    if k not in item.keys() or k not in importer.validators.keys():
+                        continue
+                    if not importer.validators[k](ds,mode=import_mode):
+                        if error_count:
+                            error_string += ' ++ '
+                            error_string += "%s: %s" % (k,self.translation_service(ds.getError(k),
                                                                            ds.getErrorMapping(k)))
-                    error_count += 1
+                            error_count += 1
             if error_string:
                 error = error_string
@@ -1490,9 +1498,4 @@
                 temp_item = item.copy()
                 temp_item.update(dm)
-                import_method = importer.import_method
-                if pending_only:
-                    import_mode = temp_item.get('import_mode','edit')
-                    import_method = getattr(importer, '%(import_mode)s' % vars() )
-                    info['import_mode'] = import_mode
                 results = import_method(temp_item)
                 id = results[0]
@@ -1567,5 +1570,5 @@
         elapse = time.time() - elapse
         copy2(pending_tmp,pending_path)
-        msg = "finished importing in %(mode)s mode from %(import_source_fn)s in %(elapse).2f seconds, " % vars()
+        msg = "finished importing from %(import_source_fn)s in %(elapse).2f seconds, " % vars()
         msg += "%(count)d records totally read, %(total_added_to_imported)d added to %(imported_fn)s, " % vars()
         if pending_only:
Index: /WAeUP_SRP/uniben/profiles/default/layouts/import.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/import.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/import.xml	(revision 3191)
@@ -33,17 +33,4 @@
   <property name="vocabulary">import_names</property>
  </widget>
- <widget name="mode" meta_type="Select Widget">
-  <property name="title">Import Mode</property>
-  <property name="fields">
-   <element value="mode"/>
-  </property>
-  <property name="is_required">False</property>
-  <property name="label">Import Mode</property>
-  <property name="label_edit">Import Mode</property>
-  <property name="readonly_layout_modes"/>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
-  <property name="vocabulary">import_modes</property>
- </widget> 
  <table>
   <row>
Index: /WAeUP_SRP/uniben/profiles/default/layouts/import_application.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/import_application.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/import_application.xml	(revision 3191)
@@ -9,4 +9,17 @@
   <property name="validate_values_expr"></property>
 
+ <widget name="import_mode" meta_type="Select Widget">
+  <property name="title">Import Mode</property>
+  <property name="fields">
+   <element value="import_mode"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Import Mode</property>
+  <property name="label_edit">Import Mode</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">import_modes</property>
+ </widget>
   <widget name="student_id" meta_type="String Widget">
     <property name="title">Student Id</property>
Index: /WAeUP_SRP/uniben/profiles/default/layouts/import_certificate.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/import_certificate.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/import_certificate.xml	(revision 3191)
@@ -8,4 +8,17 @@
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
+ <widget name="import_mode" meta_type="Select Widget">
+  <property name="title">Import Mode</property>
+  <property name="fields">
+   <element value="import_mode"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Import Mode</property>
+  <property name="label_edit">Import Mode</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">import_modes</property>
+ </widget>
  <widget name="title" meta_type="String Widget">
   <property name="fields">
Index: /WAeUP_SRP/uniben/profiles/default/layouts/import_certificate_course.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/import_certificate_course.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/import_certificate_course.xml	(revision 3191)
@@ -8,4 +8,17 @@
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
+ <widget name="import_mode" meta_type="Select Widget">
+  <property name="title">Import Mode</property>
+  <property name="fields">
+   <element value="import_mode"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Import Mode</property>
+  <property name="label_edit">Import Mode</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">import_modes</property>
+ </widget>
  <widget name="Title" meta_type="String Widget">
   <property name="title">Title</property>
Index: /WAeUP_SRP/uniben/profiles/default/layouts/import_course.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/import_course.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/import_course.xml	(revision 3191)
@@ -8,4 +8,17 @@
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
+ <widget name="import_mode" meta_type="Select Widget">
+  <property name="title">Import Mode</property>
+  <property name="fields">
+   <element value="import_mode"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Import Mode</property>
+  <property name="label_edit">Import Mode</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">import_modes</property>
+ </widget>
 <widget name="code" meta_type="WAeUPId Widget">
  <property name="title">Course Id</property>
Index: /WAeUP_SRP/uniben/profiles/default/layouts/import_course_result.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/import_course_result.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/import_course_result.xml	(revision 3191)
@@ -8,4 +8,17 @@
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
+ <widget name="import_mode" meta_type="Select Widget">
+  <property name="title">Import Mode</property>
+  <property name="fields">
+   <element value="import_mode"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Import Mode</property>
+  <property name="label_edit">Import Mode</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">import_modes</property>
+ </widget>
   <widget name="student_id" meta_type="String Widget">
     <property name="title">Student Id</property>
Index: /WAeUP_SRP/uniben/profiles/default/layouts/import_department.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/import_department.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/import_department.xml	(revision 3191)
@@ -8,4 +8,17 @@
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
+ <widget name="import_mode" meta_type="Select Widget">
+  <property name="title">Import Mode</property>
+  <property name="fields">
+   <element value="import_mode"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Import Mode</property>
+  <property name="label_edit">Import Mode</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">import_modes</property>
+ </widget>
  <widget name="code" meta_type="WAeUPId Widget">
   <property name="title">Department Code</property>
Index: /WAeUP_SRP/uniben/profiles/default/layouts/import_faculty.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/import_faculty.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/import_faculty.xml	(revision 3191)
@@ -8,5 +8,18 @@
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
+ <widget name="import_mode" meta_type="Select Widget">
+  <property name="fields">
+   <element value="import_mode"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Import Mode</property>
+  <property name="label_edit">Import Mode</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">import_modes</property>
+ </widget>
  <widget name="title" meta_type="String Widget">
+  <property name="title">Import Mode</property>
   <property name="fields">
    <element value="title"/>
Index: /WAeUP_SRP/uniben/profiles/default/layouts/import_student.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/import_student.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/import_student.xml	(revision 3191)
@@ -8,5 +8,17 @@
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
-
+ <widget name="import_mode" meta_type="Select Widget">
+  <property name="title">Import Mode</property>
+  <property name="fields">
+   <element value="import_mode"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Import Mode</property>
+  <property name="label_edit">Import Mode</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">import_modes</property>
+ </widget>
  <widget name="id" meta_type="String Widget">
   <property name="title">Id</property>
Index: /WAeUP_SRP/uniben/profiles/default/layouts/import_verdict.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/import_verdict.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/import_verdict.xml	(revision 3191)
@@ -8,4 +8,17 @@
   <property name="flexible_widgets"/>
   <property name="validate_values_expr"></property>
+ <widget name="import_mode" meta_type="Select Widget">
+  <property name="title">Import Mode</property>
+  <property name="fields">
+   <element value="import_mode"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Import Mode</property>
+  <property name="label_edit">Import Mode</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">import_modes</property>
+ </widget>
   <widget name="id" meta_type="String Widget">
     <property name="title">Id</property>
Index: /WAeUP_SRP/uniben/profiles/default/schemas/import.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/schemas/import.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/schemas/import.xml	(revision 3191)
@@ -3,4 +3,3 @@
  <field name="filename" meta_type="CPS String Field"/>
  <field name="name" meta_type="CPS String Field"/>
- <field name="import_or_edit" meta_type="CPS Boolean Field"/>
 </object>
Index: /WAeUP_SRP/uniben/profiles/default/schemas/import_application.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/schemas/import_application.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/schemas/import_application.xml	(revision 3191)
@@ -2,4 +2,5 @@
 <?xml-stylesheet type="text/xsl" href="schema.xsl"?>
 <object name="import_application" meta_type="CPS Schema">
+ <field name="import_mode" meta_type="CPS String Field"/>
  <field name="course1" meta_type="CPS String Field"/>
  <field name="course2" meta_type="CPS String Field"/>
Index: /WAeUP_SRP/uniben/profiles/default/schemas/import_certificate.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/schemas/import_certificate.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/schemas/import_certificate.xml	(revision 3191)
@@ -2,4 +2,5 @@
 <?xml-stylesheet type="text/xsl" href="schema.xsl"?>
 <object name="certificate" meta_type="CPS Schema">
+ <field name="import_mode" meta_type="CPS String Field"/>
  <field name="title" meta_type="CPS String Field"/>
  <field name="admin_status" meta_type="CPS String Field"/>
Index: /WAeUP_SRP/uniben/profiles/default/schemas/import_certificate_course.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/schemas/import_certificate_course.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/schemas/import_certificate_course.xml	(revision 3191)
@@ -2,4 +2,5 @@
 <?xml-stylesheet type="text/xsl" href="schema.xsl"?>
 <object name="certificate_course" meta_type="CPS Schema">
+ <field name="import_mode" meta_type="CPS String Field"/>
  <field name="code" meta_type="CPS String Field" />
  <field name="certificate_code" meta_type="CPS String Field" />
Index: /WAeUP_SRP/uniben/profiles/default/schemas/import_course.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/schemas/import_course.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/schemas/import_course.xml	(revision 3191)
@@ -2,4 +2,5 @@
 <?xml-stylesheet type="text/xsl" href="schema.xsl"?>
 <object name="course" meta_type="CPS Schema">
+ <field name="import_mode" meta_type="CPS String Field"/>
  <field name="title" meta_type="CPS String Field"/>
  <field name="department_code" meta_type="CPS String Field"/>
Index: /WAeUP_SRP/uniben/profiles/default/schemas/import_course_result.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/schemas/import_course_result.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/schemas/import_course_result.xml	(revision 3191)
@@ -2,4 +2,5 @@
 <?xml-stylesheet type="text/xsl" href="schema.xsl"?>
 <object name="course_result" meta_type="CPS Schema">
+ <field name="import_mode" meta_type="CPS String Field"/>
  <field name="student_id" meta_type="CPS String Field"/>
  <field name="matric_no" meta_type="CPS String Field"/>
Index: /WAeUP_SRP/uniben/profiles/default/schemas/import_department.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/schemas/import_department.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/schemas/import_department.xml	(revision 3191)
@@ -2,4 +2,5 @@
 <?xml-stylesheet type="text/xsl" href="schema.xsl"?>
 <object name="import_department" meta_type="CPS Schema">
+ <field name="import_mode" meta_type="CPS String Field"/>
  <field name="code" meta_type="CPS String Field"/>
  <field name="faculty_code" meta_type="CPS String Field"/>
Index: /WAeUP_SRP/uniben/profiles/default/schemas/import_faculty.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/schemas/import_faculty.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/schemas/import_faculty.xml	(revision 3191)
@@ -2,4 +2,5 @@
 <?xml-stylesheet type="text/xsl" href="schema.xsl"?>
 <object name="import_faculty" meta_type="CPS Schema">
+ <field name="import_mode" meta_type="CPS String Field"/>
  <field name="code" meta_type="CPS String Field"/>
  <field name="title" meta_type="CPS String Field"/>
Index: /WAeUP_SRP/uniben/profiles/default/schemas/import_verdict.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/schemas/import_verdict.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/schemas/import_verdict.xml	(revision 3191)
@@ -2,4 +2,5 @@
 <?xml-stylesheet type="text/xsl" href="schema.xsl"?>
 <object name="import_verdict" meta_type="CPS Schema">
+ <field name="import_mode" meta_type="CPS String Field"/>
  <field name="id" meta_type="CPS String Field"/>
  <field name="matric_no" meta_type="CPS String Field"/>
Index: /WAeUP_SRP/uniben/profiles/default/vocabularies/import_names.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/vocabularies/import_names.xml	(revision 3190)
+++ /WAeUP_SRP/uniben/profiles/default/vocabularies/import_names.xml	(revision 3191)
@@ -7,5 +7,5 @@
  <property name="acl_write_roles">Manager</property>
  <item key="student" msgid="">Student Data</item>
- <item key="verdict" msgid="">Verdicts & Return</item>
+ <item key="verdict" msgid="">Verdicts + Return</item>
  <item key="faculty" msgid="">Faculty Data</item>
  <item key="department" msgid="">Department Data</item>
