Index: /WAeUP_SRP/trunk/WAeUPTool.py
===================================================================
--- /WAeUP_SRP/trunk/WAeUPTool.py	(revision 1897)
+++ /WAeUP_SRP/trunk/WAeUPTool.py	(revision 1898)
@@ -269,20 +269,22 @@
         if dict.get('sex'):
             d['jamb_sex']  = 'F'
+        entry_session = dict.get('entry_session')
+        wfaction = 'return'
+        wft = 'wf_transition_returning'
+        if entry_session == self.getSessionId():
+            wfaction = 'admit'
+            wft = 'wf_transition_admitted'
         for pt in f2t.keys():
             student_obj.invokeFactory(pt,f2t[pt]['id'])
             sub_obj = getattr(student_obj,f2t[pt]['id'])
             sub_doc = sub_obj.getContent()
-            self.portal_workflow.doActionFor(sub_obj,'open',dest_container=sub_obj)
+            #self.portal_workflow.doActionFor(sub_obj,'open',dest_container=sub_obj)
             d['Title'] = f2t[pt]['title']
             for field in f2t[pt]['fields']:
                 d[field] = dict.get(field,'')
             sub_doc.edit(mapping = d)
-            new_state = f2t[pt]['wf_transition']
+            new_state = f2t[pt][wft]
             if new_state != "remain":
                 self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
-        entry_session = dict.get('entry_session')
-        wfaction = 'return'
-        if entry_session == self.getSessionId():
-            wfaction = 'admit'
         self.portal_workflow.doActionFor(student_obj,wfaction)
         student_obj.manage_setLocalRoles(sid, ['Owner',])
@@ -735,5 +737,6 @@
                           {'id': 'application',
                            'title': 'Application Data',
-                           'wf_transition': 'close',
+                           'wf_transition_returning': 'close',
+                           'wf_transition_admitted': 'remain',
                            'fields':
                              ('jamb_reg_no',
@@ -747,5 +750,6 @@
                       #    {'id': 'pume',
                       #     'title': 'Pume Data',
-                      #     'wf_transition': 'close',
+                      #     'wf_transition_returning': 'close',
+                      #     'wf_transition_admitted': 'close',
                       #     'fields':
                       #       ('pume_score',
@@ -755,5 +759,6 @@
                           {'id': 'clearance',
                            'title': 'Clearance Data',
-                           'wf_transition': 'close',
+                           'wf_transition_returning': 'close',
+                           'wf_transition_admitted': 'remain',
                            'fields':
                              ('matric_no',
@@ -766,5 +771,6 @@
                           {'id': 'personal',
                            'title': 'Personal Data',
-                           'wf_transition': 'open',
+                           'wf_transition_returning': 'open',
+                           'wf_transition_admitted': 'remain',
                            'fields':
                              ('firstname',
@@ -780,5 +786,6 @@
                           {'id': 'study_course',
                            'title': 'Study Course',
-                           'wf_transition': 'open',
+                           'wf_transition_returning': 'open',
+                           'wf_transition_admitted': 'remain',
                            'fields':
                              ('study_course',
@@ -789,12 +796,13 @@
                               )
                               },
-                         #only temporarily changed to import admitted students
-                         #'PaymentsFolder':
-                         # {'id': 'payments',
-                         #  'title': 'Payments',
-                         #  'wf_transition': 'open',
-                         #  'fields':
-                         #    ()
-                         #     },
+
+                         'PaymentsFolder':
+                          {'id': 'payments',
+                           'title': 'Payments',
+                           'wf_transition_returning': 'open',
+                           'wf_transition_admitted': 'open',
+                           'fields':
+                             ()
+                              },
                          }
     ###)
@@ -837,9 +845,8 @@
                         d[zu] = mapping[von]
             sub_doc.edit(mapping = d)
-            new_state = f2t[pt]['wf_transition']
-
-        #only temporarily changed to import admitted students
-            #if new_state != "remain":
-            #    self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
+
+            new_state = f2t[pt]['wf_transition_admitted']
+            if new_state != "remain":
+                self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
         wfaction = 'admit'
 
