Index: WAeUP_SRP/trunk/CHANGES.txt
===================================================================
--- WAeUP_SRP/trunk/CHANGES.txt	(revision 3725)
+++ WAeUP_SRP/trunk/CHANGES.txt	(revision 3726)
@@ -82,2 +82,7 @@
 -----------------
 - add FCEOyo profile and skin
+
+1.15 (2008-10-14)
+-----------------
+- enable reg_transition by import in edit mode
+- add graduate transition and graduated state to student workflow
Index: WAeUP_SRP/trunk/WAeUPImport.py
===================================================================
--- WAeUP_SRP/trunk/WAeUPImport.py	(revision 3725)
+++ WAeUP_SRP/trunk/WAeUPImport.py	(revision 3726)
@@ -677,4 +677,5 @@
                            'wf_transition_return': 'close',
                            'wf_transition_admit': 'remain',
+                           'wf_transition_graduate': 'close',
                            'fields':
                              ('jamb_reg_no',
@@ -703,4 +704,5 @@
                            'wf_transition_return': 'close',
                            'wf_transition_admit': 'remain',
+                           'wf_transition_graduate': 'close',
                            'fields':
                              ('matric_no',
@@ -715,4 +717,5 @@
                            'wf_transition_return': 'open',
                            'wf_transition_admit': 'remain',
+                           'wf_transition_graduate': 'close',
                            'fields':
                              ('firstname',
@@ -730,4 +733,5 @@
                            'wf_transition_return': 'open',
                            'wf_transition_admit': 'remain',
+                           'wf_transition_graduate': 'close',
                            'fields':
                              ('study_course',
@@ -754,4 +758,5 @@
                            'wf_transition_return': 'open',
                            'wf_transition_admit': 'open',
+                           'wf_transition_graduate': 'close',
                            'fields':
                              ()
@@ -762,5 +767,5 @@
     def create(self,mapping): ###(
         "create student records due import"
-        logger = logging.getLogger('WAeUPTool.mass_create_student')
+        logger = logging.getLogger('WAeUPImport.StudentImport.create')
         students_folder = self.portal_url.getPortalObject().campus.students
         jamb_reg_no = mapping.get('jamb_reg_no',None)
@@ -832,5 +837,5 @@
         "edit student records due import"
         wftool = self.portal_workflow
-        logger = logging.getLogger('WAeUPTool.mass_edit_student')
+        logger = logging.getLogger('WAeUPImport.StudentImport.edit')
         students_folder = self.portal_url.getPortalObject().campus.students
         student_id = mapping.get('id',None)
@@ -876,8 +881,4 @@
                 student_record = res[0]
                 editable_keys.remove('matric_no')
-            ## included only to change wf state from admitted to returning
-            #if student_record.review_state not in ('admitted','objection_raised'):
-            #    return '%s' % student_record.id ,"student is not in state admitted or objection_raised"
-            ## end inclusion
             student_id = student_record.id
             student_obj = getattr(students_folder,student_id)
@@ -889,4 +890,8 @@
             d['session']  = mapping.get('current_session','')
             current_level = mapping.get('current_level','')
+            transition = mapping.get('reg_transition',None)
+            if transition and transition not in ('admit','return','graduate'):
+                msg = "no valid transition provided"
+                break     
             while d['session'] and d['verdict'] and current_level:
                 sub_obj = getattr(student_obj,'study_course',None)
@@ -903,4 +908,5 @@
                     pass
                 break
+           
             for pt in f2t.keys():
                 #if pt == "StudentApplication":
@@ -909,7 +915,8 @@
                 #        d['jamb_sex']  = 'F'
                 intersect = set(f2t[pt]['fields']).intersection(set(editable_keys))
+                #import pdb;pdb.set_trace()
+                object_id = f2t[pt]['id']
+                sub_obj = getattr(student_obj,object_id,None)
                 if intersect and pt not in ('StudentStudyLevel',):
-                    object_id = f2t[pt]['id']
-                    sub_obj = getattr(student_obj,object_id,None)
                     if sub_obj is None:
                         try:
@@ -929,27 +936,17 @@
                         if changed:
                             sub_doc.edit(mapping = d)
-            ## included only to change wf state from admitted to returning
-            #    if student_record.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' % (student_id,new_state,sub_obj.id))
-            #                pass
-            #if student_record.review_state in ('admitted','objection_raised'):
-            #    wfaction = 'return'
-            #    try:
-            #        self.portal_workflow.doActionFor(student_obj,wfaction)
-            #        logger.info('%s, wf state changed' % student_id)
-            #        any_change = True
-            #    except:
-            #        logger.info('%s, wf transition failed, old state = %s' % (student_id,student_record.review_state))
-            #        pass
-            ## end inclusion
-            break
-        # if not any_change:
-        #     msg = 'not modified'
+                if transition:
+                    new_state = f2t[pt]['wf_transition_%(transition)s' % vars()]
+                    if new_state != "remain":
+                        try:
+                            self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
+                        except:
+                            pass
+            if transition:
+                try:
+                    self.portal_workflow.doActionFor(student_obj,transition)
+                except:
+                    msg = "reg_transition not allowed"
+            break
         return student_id,msg,mapping
     ###)
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 3725)
+++ WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 3726)
@@ -132,4 +132,21 @@
   </permission-map>
  </state>
+ <state state_id="graduated" title="">
+  <exit-transition transition_id="return"/>
+  <permission-map name="Delete objects" acquired="True">
+   <permission-role>Manager</permission-role>
+   <permission-role>SectionManager</permission-role>
+   <permission-role>SectionOfficer</permission-role>
+  </permission-map>
+  <permission-map name="Modify portal content"
+                  acquired="False">
+   <permission-role>Manager</permission-role>
+   <permission-role>SectionManager</permission-role>
+   <permission-role>SectionOfficer</permission-role>
+  </permission-map>
+  <permission-map name="View" acquired="True">
+   <permission-role>Owner</permission-role>
+  </permission-map>
+ </state> 
  <state state_id="deferred" title="">
   <exit-transition transition_id="deactivate"/>
@@ -167,4 +184,5 @@
   <exit-transition transition_id="deactivate"/>
   <exit-transition transition_id="pay_school_fee"/>
+  <exit-transition transition_id="graduate"/>
   <permission-map name="Delete objects" acquired="False">
    <permission-role>Manager</permission-role>
@@ -281,4 +299,15 @@
   </guard>
  </transition>
+ <transition transition_id="graduate" title=""
+             new_state="graduated" trigger="USER"
+             before_script="" after_script="">
+
+
+  <guard>
+   <guard-role>SectionOfficer</guard-role>
+   <guard-role>Manager</guard-role>
+   <guard-role>SectionManager</guard-role>
+  </guard>
+ </transition> 
  <transition transition_id="defer" title=""
              new_state="deferred" trigger="USER"
Index: WAeUP_SRP/trunk/profiles/uniben/actions.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/uniben/actions.xml	(revision 3725)
+++ WAeUP_SRP/trunk/profiles/uniben/actions.xml	(revision 3726)
@@ -7,3 +7,11 @@
    <permission>View</permission>
   </action>
+ </action-provider>
+ <action-provider name="portal_actions">
+  <action title="Send Email" action_id="send_email_form" category="global"
+     condition_expr="python:str(member) in ('admin','med')"
+     url_expr="string:${portal_url}/send_email_form" visible="True">
+   <permission>View</permission>
+  </action>     
+ </action-provider>
 </object>
