Index: /WAeUP_SRP/trunk/Academics.py
===================================================================
--- /WAeUP_SRP/trunk/Academics.py	(revision 397)
+++ /WAeUP_SRP/trunk/Academics.py	(revision 398)
@@ -616,4 +616,19 @@
     portal_type = meta_type
     security = ClassSecurityInfo()
+    def getCourseEntry(self,cid):
+        res = self.portal_catalog({'meta_type': "Course",
+                                           'id': cid})
+        if res:
+            return res[-1]
+        else:
+            return None
+
+    security.declareProtected(View,"Title")
+    def Title(self):
+        """compose title"""
+        ce = self.getCourseEntry(self.id.upper())
+        if ce:
+            return "%s" % ce.Title
+        return "No such course"
 
 InitializeClass(CourseTicket)
Index: /WAeUP_SRP/trunk/Students.py
===================================================================
--- /WAeUP_SRP/trunk/Students.py	(revision 397)
+++ /WAeUP_SRP/trunk/Students.py	(revision 398)
@@ -19,4 +19,5 @@
 p_home = Globals.package_home(globals())
 i_home = Globals.INSTANCE_HOME
+MAX_TRANS = 1000
 
 class StudentsFolder(CPSDocument): ###(
@@ -32,4 +33,6 @@
         """load Fulltime Studentdata from CSV values"""
         #return
+        import transaction
+        tr_count = 0
         name = 'short_full_time'
         no_import = False
@@ -64,10 +67,10 @@
                 continue
             certcode = makeCertificateCode(student.get('CourseMajor'))
-            if sid in students_added:
-                em = 'Student with ID %(MatricNo)s %(fullname)s already exists in this import\n' % student
-                logger.info(em)
-                no_import.write(em)
-                no_import.write('"%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"\n' % student)
-                continue
+##            if sid in students_added:
+##                em = 'Student with ID %(MatricNo)s %(fullname)s already exists in this import\n' % student
+##                logger.info(em)
+##                no_import.write(em)
+##                no_import.write('"%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"\n' % student)
+##                continue
             s = studs.get(sid,None)
             if certcode not in certs.keys():
@@ -92,4 +95,5 @@
                 s = getattr(self,sid)
                 students_added.append(sid)
+                studs[sid] = s
                 s.invokeFactory('StudentPersonal','personal')
                 sp = s.personal
@@ -153,12 +157,20 @@
                 no_import.write(em)
                 no_import.write('"%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"\n' % student)
+            if tr_count > MAX_TRANS:
+                #transaction.commit()
+                #em = '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Transaction commited\n' % student
+                logger.info(em)
+                tr_count = 0
+            tr_count += 1
         return self.students.academics_contents()
     ###)
 
-    security.declareProtected(ModifyPortalContent,"loadFullTimeStudentsResultsFromCSV")
+    security.declareProtected(ModifyPortalContent,"loadFullTimeStudentsResultsFromCSV") ###(
     def loadFullTimeStudentsResultsFromCSV(self):
         """load Fulltime Studentdata from CSV values"""
         #return
-        name = 'short_full_time_results_2004_2005.csv'
+        import transaction
+        tr_count = 0
+        name = 'short_full_time_results_2004_2005'
         no_import = False
         if not no_import:
@@ -177,27 +189,31 @@
         for s in l:
             students[s.id] = s.getObject()
-        courses = self.portal_catalog({'meta_type': "Course"})
+        l = self.portal_catalog({'meta_type': "Course"})
+        courses = {}
+        for c in l:
+            courses[c.id] = c.getObject()
         for result in results:
             sid = result.get('Matnumber')
             if sid not in students.keys():                
-                em = 'Student with ID %(Matnumber)s not found\n' % student
-                logger.info(em)
-                no_import.write(em)
-                no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % student)
+                em = 'Student with ID %(Matnumber)s not found\n' % result
+                logger.info(em)
+                no_import.write(em)
+                no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
                 continue
-            if student.get('CosCode') not in courses:
-                em = 'Course with ID %(CosCode)s not found\n' % student
-                logger.info(em)
-                no_import.write(em)
-                no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % student)
+            course = result.get('CosCode')
+            if course not in courses.keys():
+                em = 'Course with ID %(CosCode)s not found\n' % result
+                logger.info(em)
+                no_import.write(em)
+                no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
                 continue
-            level = student.get('Level')
+            level = result.get('Level')
             try: 
                 int(level)
             except:
-                em = 'Result for Student with ID %(Matnumber)s Course %(CosCode)s Level is empty\n' % student
-                logger.info(em)
-                no_import.write(em)
-                no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % student)
+                em = 'Result for result with ID %(Matnumber)s Course %(CosCode)s Level is empty\n' % result
+                logger.info(em)
+                no_import.write(em)
+                no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
                 continue
             sf = students.get(sid)
@@ -206,5 +222,5 @@
             if l is None:
                 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
-                logger.info('Creating Level %(StudentLevel)s for %(fullname)s' % student)
+                logger.info('Creating Level %(Level)s for %(Matnumber)s' % result)
                 sc.invokeFactory('StudyLevel', level)
                 l = getattr(sc, level)
@@ -216,12 +232,32 @@
                 second_s = getattr(l,'second')
                 second_s.getContent().edit(mapping={'Title': 'Second Semester'})
-            snr = student.get('Semester')
+            snr = result.get('Semester')
             semester = getattr(l,'first')
-            if snr == "1":
+            if snr == "2":
                 semester = getattr(l,'second')
+            logger.info('Creating CourseTicket %(CourseTicket)s in Level %(Level)s for %(Matnumber)s' % result)
+            semester.invokeFactory('CourseTicket',course)
+            ct = getattr(semester,course)
+            d = {}
+            d['ansbook'] = result.get('Ansbook')
+            d['status'] = result.get('CosStuatus')
+            d['score'] = result.get('Score')
+            d['carry_level'] = result.get('CarryLevel')
+            d['grade'] = result.get('Grade')
+            d['weight'] = result.get('Weight')
+            d['verdict'] = result.get('Verdict')
+            d['import_id'] = result.get('id')
+            gpa = result.get('GPA').replace(',','.')
+            d['gpa'] = float(gpa) 
+            ct.getContent().edit(mapping = d)
+            if tr_count > MAX_TRANS:
+                transaction.commit()
+                tr_count = 0
+            tr_count += 1
+        return self.students.academics_contents()
             
-                
-                
-
+###)
+
+            
     security.declareProtected(View,"Title")
     def Title(self):
Index: /WAeUP_SRP/trunk/profiles/default/layouts.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts.xml	(revision 397)
+++ /WAeUP_SRP/trunk/profiles/default/layouts.xml	(revision 398)
@@ -13,4 +13,5 @@
  <object name="clearence" meta_type="CPS Layout"/>
  <object name="course" meta_type="CPS Layout"/>
+ <object name="course_results" meta_type="CPS Layout"/>
  <object name="department" meta_type="CPS Layout"/>
  <object name="faculty" meta_type="CPS Layout"/>
Index: /WAeUP_SRP/trunk/profiles/default/layouts/course_results.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/course_results.xml	(revision 398)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/course_results.xml	(revision 398)
@@ -0,0 +1,137 @@
+<?xml version="1.0"?>
+<object name="course_results" 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="ansbook" meta_type="String Widget">
+  <property name="title">Ansbook</property>
+  <property name="fields">
+   <element value="ansbook"/>
+  </property>
+  <property name="label">Ansbook</property>
+  <property name="label_edit">Ansbook</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="carry_level" meta_type="String Widget">
+  <property name="title">Carry Level</property>
+  <property name="fields">
+   <element value="carry_level"/>
+  </property>
+  <property name="label">Carry Level</property>
+  <property name="label_edit">Carry Level</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="gpa" meta_type="Float Widget">
+  <property name="title">GPA</property>
+  <property name="fields">
+   <element value="gpa"/>
+  </property>
+  <property name="label">GPA</property>
+  <property name="label_edit">GPA</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="grade" meta_type="String Widget">
+  <property name="title">Grade</property>
+  <property name="fields">
+   <element value="grade"/>
+  </property>
+  <property name="label">Grade</property>
+  <property name="label_edit">Grade</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="import_id" meta_type="String Widget">
+  <property name="title">ID</property>
+  <property name="fields">
+   <element value="import_id"/>
+  </property>
+  <property name="label">ID</property>
+  <property name="label_edit">ID</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="score" meta_type="Int Widget">
+  <property name="title">Score</property>
+  <property name="fields">
+   <element value="score"/>
+  </property>
+  <property name="label">Score</property>
+  <property name="label_edit">Score</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="status" meta_type="String Widget">
+  <property name="title">Status</property>
+  <property name="fields">
+   <element value="status"/>
+  </property>
+  <property name="label">Status</property>
+  <property name="label_edit">Status</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="verdict" meta_type="String Widget">
+  <property name="title">Verdict</property>
+  <property name="fields">
+   <element value="verdict"/>
+  </property>
+  <property name="label">Verdict</property>
+  <property name="label_edit">Verdict</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="weight" meta_type="String Widget">
+  <property name="title">Weight</property>
+  <property name="fields">
+   <element value="weight"/>
+  </property>
+  <property name="label">Weight</property>
+  <property name="label_edit">Weight</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <table>
+  <row>
+   <cell name="grade"/>
+  </row>
+  <row>
+   <cell name="ansbook"/>
+  </row>
+  <row>
+   <cell name="status"/>
+  </row>
+  <row>
+   <cell name="score"/>
+  </row>
+  <row>
+   <cell name="verdict"/>
+  </row>
+  <row>
+   <cell name="weight"/>
+  </row>
+  <row>
+   <cell name="gpa"/>
+  </row>
+  <row>
+   <cell name="carry_level"/>
+  </row>
+  <row>
+   <cell name="import_id"/>
+  </row>
+ </table>
+</object>
Index: /WAeUP_SRP/trunk/profiles/default/schemas/course_results.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/schemas/course_results.xml	(revision 397)
+++ /WAeUP_SRP/trunk/profiles/default/schemas/course_results.xml	(revision 398)
@@ -1,5 +1,12 @@
 <?xml version="1.0"?>
 <object name="course_results" meta_type="CPS Schema">
+ <field name="ansbook" meta_type="CPS String Field"/>
+ <field name="carry_level" meta_type="CPS String Field"/>
+ <field name="gpa" meta_type="CPS Float Field"/>
  <field name="grade" meta_type="CPS String Field"/>
- <field name="points" meta_type="CPS Int Field"/>
+ <field name="import_id" meta_type="CPS String Field"/>
+ <field name="score" meta_type="CPS Int Field"/>
+ <field name="status" meta_type="CPS String Field"/>
+ <field name="verdict" meta_type="CPS String Field"/>
+ <field name="weight" meta_type="CPS String Field"/>
 </object>
Index: /WAeUP_SRP/trunk/profiles/default/types/StudentsFolder.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/types/StudentsFolder.xml	(revision 397)
+++ /WAeUP_SRP/trunk/profiles/default/types/StudentsFolder.xml	(revision 398)
@@ -8,5 +8,5 @@
  <property name="product">WAeUP_SRP</property>
  <property name="factory">addStudentsFolder</property>
- <property name="immediate_view">folder_view</property>
+ <property name="immediate_view">academics_contents</property>
  <property name="global_allow">True</property>
  <property name="filter_content_types">True</property>
@@ -70,3 +70,7 @@
     url_expr="string:${object_url}/loadFullTimeStudentsFromCSV"
     visible="True"/>
+ <action title="Import FtS Results" action_id="import_fulltime_students"
+    category="import" condition_expr=""
+    url_expr="string:${object_url}/loadFullTimeStudentsResultsFromCSV"
+    visible="True"/>
 </object>
