Index: /main/waeup.kofa/trunk/CHANGES.txt
===================================================================
--- /main/waeup.kofa/trunk/CHANGES.txt	(revision 16827)
+++ /main/waeup.kofa/trunk/CHANGES.txt	(revision 16828)
@@ -4,4 +4,6 @@
 1.7.2.dev0 (unreleased)
 =======================
+
+* Add importers for previous study course data.
 
 * Add exporters for previous study course data.
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py	(revision 16827)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py	(revision 16828)
@@ -485,4 +485,5 @@
     iface_transfer = IStudentStudyCourseTransfer
     factory_name = 'waeup.StudentStudyCourse'
+    studycourse_name = 'studycourse'
 
     def getParent(self, row, site):
@@ -493,5 +494,5 @@
         if student is None:
             return None
-        return student.get('studycourse')
+        return student.get(self.studycourse_name)
 
     def updateEntry(self, obj, row, site, filename):
@@ -508,5 +509,8 @@
             student.transfer(
                 certificate=certificate, current_session=current_session)
-            obj = student['studycourse']
+            obj = student[self.studycourse_name]
+            # Once imported we must ensure that after export and reimport
+            # the student is not transferred again.
+            row['entry_mode'] = 'transferred'
         items_changed = super(StudentStudyCourseProcessor, self).updateEntry(
             obj, row, site, filename)
@@ -585,4 +589,5 @@
     iface = IStudentStudyLevel
     factory_name = 'waeup.StudentStudyLevel'
+    studycourse_name = 'studycourse'
 
     additional_fields_required = ['level']
@@ -599,5 +604,5 @@
         if student is None:
             return None
-        return student['studycourse']
+        return student[self.studycourse_name]
 
     def getEntry(self, row, site):
@@ -702,4 +707,5 @@
     iface = ICourseTicketImport
     factory_name = 'waeup.CourseTicket'
+    studycourse_name = 'studycourse'
 
     additional_fields = ['level', 'code']
@@ -721,5 +727,5 @@
         if student is None:
             return None
-        return student['studycourse'].get(str(row['level']))
+        return student[self.studycourse_name].get(str(row['level']))
 
     def getEntry(self, row, site):
@@ -1079,2 +1085,36 @@
         notify(grok.ObjectModifiedEvent(obj.__parent__))
         return
+
+class FirstStudentStudyCourseProcessor(StudentStudyCourseProcessor):
+    """The First Student Study Course Processor imports first
+    study course data of students who have been transferred.
+    """
+    util_name = 'studycourseprocessor_1'
+    grok.name(util_name)
+    name = _('FirstStudentStudyCourse Processor')
+    studycourse_name = 'studycourse_1'
+
+    def addEntry(self, obj, row, site):
+        parent = self.getParent(row, site)
+        parent[self.studycourse_name] = obj
+        return
+
+class FirstStudentStudyLevelProcessor(StudentStudyLevelProcessor):
+    """The First Student Study Level Processor imports study level data
+    into first study course containers of students who have been transferred.
+    """
+    util_name = 'studylevelprocessor_1'
+    grok.name(util_name)
+    name = _('FirstStudentStudyLevel Processor')
+    studycourse_name = 'studycourse_1'
+
+class FirstCourseTicketProcessor(CourseTicketProcessor):
+    """The First Course Ticket Processor imports course tickets into
+    first study level containers of students who have been transferred.
+    """
+    util_name = 'courseticketprocessor_1'
+    grok.name(util_name)
+    name = _('FirstCourseTicket Processor')
+    iface = ICourseTicketImport
+    factory_name = 'waeup.CourseTicket'
+    studycourse_name = 'studycourse_1'
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py	(revision 16827)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py	(revision 16828)
@@ -39,5 +39,8 @@
     StudentProcessor, StudentStudyCourseProcessor,
     StudentStudyLevelProcessor, CourseTicketProcessor,
-    StudentOnlinePaymentProcessor, StudentVerdictProcessor)
+    StudentOnlinePaymentProcessor, StudentVerdictProcessor,
+    FirstStudentStudyCourseProcessor,
+    FirstStudentStudyLevelProcessor,
+    FirstCourseTicketProcessor)
 from waeup.kofa.students.payments import StudentOnlinePayment
 from waeup.kofa.students.student import Student
@@ -733,5 +736,5 @@
         self.assertEqual(self.student['studycourse'].certificate.code, 'CERT2')
         self.assertEqual(self.student['studycourse_1'].certificate.code, 'CERT1')
-        self.assertEqual(self.student['studycourse'].entry_mode, 'transfer')
+        self.assertEqual(self.student['studycourse'].entry_mode, 'transferred')
         self.assertEqual(self.student['studycourse_1'].entry_mode, 'ug_ft')
         self.assertEqual(self.student.current_mode, 'ug_pt')
@@ -745,5 +748,5 @@
             'INFO - system - '
             'StudentStudyCourse Processor (update only) - '
-            'sample_transfer_data - K1000000 - updated: entry_mode=transfer, '
+            'sample_transfer_data - K1000000 - updated: entry_mode=transferred, '
             'certificate=CERT2, current_session=2009, current_level=300'
             in logcontent)
@@ -1135,4 +1138,47 @@
             '1,COURSE1,<IGNORE>,300,Cannot remove: no such entry\r\n'
             )
+        shutil.rmtree(os.path.dirname(fin_file))
+
+    def test_import_firstcourse_with_content(self):
+        processor = FirstStudentStudyCourseProcessor()
+        csv_file = os.path.join(
+            self.workdir, 'sample_studycourse_data.csv')
+        num, num_warns, fin_file, fail_file = processor.doImport(
+            csv_file, STUDYCOURSE_HEADER_FIELDS,'create')
+        self.assertEqual(num_warns,1)
+        content = open(fail_file).read()
+        self.assertTrue('current_level: not in range' in content)
+        studycourse = processor.getEntry(dict(reg_number='1'), self.app)
+        self.assertEqual(studycourse.certificate.code, u'CERT1')
+        self.assertEqual(studycourse.__name__, u'studycourse_1')
+        cat = queryUtility(ICatalog, name='students_catalog')
+        results = list(cat.searchResults(reg_number=('1', '1')))
+        self.assertEqual([i for i in results[0].keys()],
+            [u'accommodation', u'payments', u'studycourse', u'studycourse_1'])
+        processor = FirstStudentStudyLevelProcessor()
+        csv_file = os.path.join(
+            self.workdir, 'sample_studylevel_data.csv')
+        num, num_warns, fin_file, fail_file = processor.doImport(
+            csv_file, STUDYLEVEL_HEADER_FIELDS,'create')
+        self.assertEqual(num_warns,3)
+        assert processor.entryExists(
+            dict(reg_number='1', level='100'), self.app) is True
+        studylevel = processor.getEntry(
+            dict(reg_number='1', level='100'), self.app)
+        self.assertEqual(studylevel.__parent__.certificate.code, u'CERT1')
+        self.assertEqual(studylevel.level_session, 2008)
+        self.assertEqual(studylevel.level_verdict, '0')
+        self.assertEqual(studylevel.level, 100)
+        self.assertEqual([i for i in results[0]['studycourse_1'].keys()],
+            [u'100', u'200'])
+        processor = FirstCourseTicketProcessor()
+        csv_file = os.path.join(
+            self.workdir, 'sample_courseticket_data.csv')
+        num, num_warns, fin_file, fail_file = processor.doImport(
+            csv_file, COURSETICKET_HEADER_FIELDS,'create')
+        assert processor.entryExists(
+            dict(reg_number='1', level='100', code='COURSE1'), self.app) is True
+        self.assertEqual([i for i in results[0]['studycourse_1']['100'].keys()],
+            [u'COURSE1'])
         shutil.rmtree(os.path.dirname(fin_file))
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 16827)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 16828)
@@ -1650,5 +1650,5 @@
         modeselect = self.browser.getControl(name='mode')
         importerselect.getControl(
-            'StudentStudyCourse Processor (update only)').selected = True
+            'StudentStudyCourse Processor (update only)',index=0).selected = True
         modeselect.getControl(value='create').selected = True
         self.browser.getControl('Proceed to step 3').click()
Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py	(revision 16827)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py	(revision 16828)
@@ -136,4 +136,5 @@
     STUDY_MODES_DICT = {
         'transfer': 'Transfer',
+        'transferred': 'Transferred',
         'ug_ft': 'Undergraduate Full-Time',
         'ug_pt': 'Undergraduate Part-Time',
