Index: WAeUP_SRP/base/WAeUPTool.py
===================================================================
--- WAeUP_SRP/base/WAeUPTool.py	(revision 2264)
+++ WAeUP_SRP/base/WAeUPTool.py	(revision 2265)
@@ -990,4 +990,30 @@
     ###)
 
+    security.declareProtected(ModifyPortalContent,'mass_create_course') ###(
+    def mass_create_course(self,mapping):
+        if getattr(self,'_v_course_list',None) is None:
+            self._v_course_list = []
+        if getattr(self,'_v_departments',None) is None:
+            res = self.portal_catalog(portal_type = "Department")
+            self._v_departments = {}
+            for d in res:
+                self._v_departments[d.getId] = d.getObject()
+        did = mapping['department_code']
+        d = self._v_departments.get(did,None)
+        if d is None:
+            return '', "No Department with ID: %s" % fid
+        course_id = mapping.get('code')
+        if course_id in self._v_course_list:
+            return '', "Duplicate Department ID: %s" % did
+        c = getattr(d,course_id,None)
+        if c is not None:
+            return '', "Duplicate Department ID: %s" % did
+        d.invokeFactory('Course', course_id)
+        self._v_course_list.append(course_id)
+        c = getattr(d,course_id)
+        c.getContent().edit(mapping=mapping)
+        return course_id,''
+    ###)
+
     field2types_student = {   ###(
                       'StudentApplication':
@@ -1147,8 +1173,8 @@
             editable_keys.remove('matric_no')
 
-        ## included only to change wf state from admitted to returning
-        #if res[0].review_state not in ('admitted','objection_raised'):
-        #    return '%s' % res[0].id ,"student is not in state admitted or objection_raised"
-        ## end inclusion
+        # included only to change wf state from admitted to returning
+        if res[0].review_state not in ('admitted','objection_raised'):
+            return '%s' % res[0].id ,"student is not in state admitted or objection_raised"
+        # end inclusion
 
         sid = res[0].id
@@ -1156,4 +1182,5 @@
         f2t = self.field2types_student
         d = {}
+        #import pdb;pdb.set_trace()
         any_change = False
         for pt in f2t.keys():
@@ -1183,24 +1210,24 @@
 
 
-        ## included only to change wf state from admitted to returning
-        #    if res[0].review_state in ('admitted','objection_raised'):
-        #        new_state = f2t[pt]['wf_transition_return']
-        #        sub_obj = getattr(student_obj,f2t[pt]['id'],None)
-        #        if sub_obj and new_state != "remain":
-        #            try:
-        #                self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
-        #            except:
-        #                #logger.info('%s, wf transition %s of %s failed' % (sid,new_state,sub_obj.id))
-        #                pass
-        #if res[0].review_state in ('admitted','objection_raised'):
-        #    wfaction = 'return'
-        #    try:
-        #        self.portal_workflow.doActionFor(student_obj,wfaction)
-        #        logger.info('%s, wf state changed' % sid)
-        #        any_change = True
-        #    except:
-        #        logger.info('%s, wf transition failed, old state = %s' % (sid,res[0].review_state))
-        #        pass
-        ## end inclusion
+        # included only to change wf state from admitted to returning
+            if res[0].review_state in ('admitted','objection_raised'):
+                new_state = f2t[pt]['wf_transition_return']
+                sub_obj = getattr(student_obj,f2t[pt]['id'],None)
+                if sub_obj and new_state != "remain":
+                    try:
+                        self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
+                    except:
+                        #logger.info('%s, wf transition %s of %s failed' % (sid,new_state,sub_obj.id))
+                        pass
+        if res[0].review_state in ('admitted','objection_raised'):
+            wfaction = 'return'
+            try:
+                self.portal_workflow.doActionFor(student_obj,wfaction)
+                logger.info('%s, wf state changed' % sid)
+                any_change = True
+            except:
+                logger.info('%s, wf transition failed, old state = %s' % (sid,res[0].review_state))
+                pass
+        # end inclusion
 
 
@@ -1282,5 +1309,5 @@
                 format_error = format + ',"%(Error)s"'
                 format = '"%(id)s",'+ format
-
+                           
             dm = DataModel(item, adapters,context=self)
             ds = DataStructure(data=item,datamodel=dm)
Index: WAeUP_SRP/uniben/profiles/default/layouts.xml
===================================================================
--- WAeUP_SRP/uniben/profiles/default/layouts.xml	(revision 2264)
+++ WAeUP_SRP/uniben/profiles/default/layouts.xml	(revision 2265)
@@ -11,4 +11,5 @@
   <object name="certificate_course" meta_type="CPS Layout"/>
   <object name="course" meta_type="CPS Layout"/>
+  <object name="import_course" meta_type="CPS Layout"/>
   <object name="import_department" meta_type="CPS Layout"/>
   <object name="department" meta_type="CPS Layout"/>
Index: WAeUP_SRP/uniben/profiles/default/layouts/import_course.xml
===================================================================
--- WAeUP_SRP/uniben/profiles/default/layouts/import_course.xml	(revision 2265)
+++ WAeUP_SRP/uniben/profiles/default/layouts/import_course.xml	(revision 2265)
@@ -0,0 +1,104 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="layout.xsl"?>
+<object name="course" meta_type="CPS Layout">
+ <property name="layout_create_method"></property>
+ <property name="layout_edit_method"></property>
+ <property name="layout_view_method"></property>
+ <property name="style_prefix">layout_waeup_</property>
+ <property name="flexible_widgets"/>
+ <property name="validate_values_expr"></property>
+<widget name="code" meta_type="CourseId Widget">
+ <property name="title">Course Id</property>
+ <property name="fields">
+  <element value="code"/>
+ </property>
+ <property name="is_required">True</property>
+ <property name="label">Course Id</property>
+ <property name="label_edit">Course Id</property>
+ <property name="readonly_layout_modes">
+  <element value="edit"/>
+ </property>
+ <property name="hidden_layout_modes"/>
+ <property name="hidden_readonly_layout_modes"/>
+ <property name="display_width">8</property>
+</widget>
+ <widget name="credits" meta_type="Int Widget">
+  <property name="title">Credits</property>
+  <property name="fields">
+   <element value="credits"/>
+  </property>
+  <property name="label">Credits</property>
+  <property name="label_edit">Credits</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="passmark" meta_type="Int Widget">
+  <property name="title">Passmark</property>
+  <property name="fields">
+   <element value="passmark"/>
+  </property>
+  <property name="is_required">False</property>
+  <property name="label">Passmark</property>
+  <property name="label_edit">Passmark</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="semester" meta_type="Int Widget">
+  <property name="title">Semester</property>
+  <property name="fields">
+   <element value="semester"/>
+  </property>
+  <property name="label">Semester</property>
+  <property name="label_edit">Semester</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="title" meta_type="String Widget">
+  <property name="title">Course Title</property>
+  <property name="fields">
+   <element value="title"/>
+  </property>
+  <property name="label">Course Title</property>
+  <property name="label_edit">Course Title</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">60</property>
+ </widget>
+ <widget name="department_code" meta_type="String Widget">
+  <property name="title">Department Code</property>
+  <property name="fields">
+   <element value="department_code"/>
+  </property>
+  <property name="label">Department Code</property>
+  <property name="label_edit">Department Code</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">60</property>
+ </widget>
+ <table>
+  <row>
+   <cell name="code"/>
+  </row>
+  <row>
+   <cell name="title"/>
+  </row>
+  <row>
+   <cell name="level"/>
+  </row>
+  <row>
+   <cell name="semester"/>
+  </row>
+  <row>
+   <cell name="credits"/>
+  </row>
+  <row>
+   <cell name="passmark"/>
+  </row>
+ </table>
+</object>
+
Index: WAeUP_SRP/uniben/profiles/default/schemas.xml
===================================================================
--- WAeUP_SRP/uniben/profiles/default/schemas.xml	(revision 2264)
+++ WAeUP_SRP/uniben/profiles/default/schemas.xml	(revision 2265)
@@ -10,4 +10,5 @@
  <object name="certificate" meta_type="CPS Schema"/>
  <object name="certificate_course" meta_type="CPS Schema"/>
+ <object name="import_course" meta_type="CPS Schema"/>
  <object name="course" meta_type="CPS Schema"/>
  <object name="import_department" meta_type="CPS Schema"/>
Index: WAeUP_SRP/uniben/profiles/default/schemas/import_course.xml
===================================================================
--- WAeUP_SRP/uniben/profiles/default/schemas/import_course.xml	(revision 2265)
+++ WAeUP_SRP/uniben/profiles/default/schemas/import_course.xml	(revision 2265)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="schema.xsl"?>
+<object name="course" meta_type="CPS Schema">
+ <field name="title" meta_type="CPS String Field"/>
+ <field name="department_code" meta_type="CPS String Field"/>
+ <field name="code" meta_type="CPS String Field"/>
+ <field name="credits" meta_type="CPS Int Field"/>
+ <field name="org_code" meta_type="CPS String Field"/>
+ <field name="passmark" meta_type="CPS Int Field">
+  <property name="default_expr">python:40</property>
+ </field>
+ <field name="semester" meta_type="CPS Int Field"/>
+ <field name="level" meta_type="CPS String Field"/>
+</object>
