Changeset 3726


Ignore:
Timestamp:
14 Oct 2008, 10:11:54 (16 years ago)
Author:
Henrik Bettermann
Message:
  • enable reg_transition by import in edit mode
  • add graduate transition and graduated state to student workflow
Location:
WAeUP_SRP/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/CHANGES.txt

    r3714 r3726  
    8282-----------------
    8383- add FCEOyo profile and skin
     84
     851.15 (2008-10-14)
     86-----------------
     87- enable reg_transition by import in edit mode
     88- add graduate transition and graduated state to student workflow
  • WAeUP_SRP/trunk/WAeUPImport.py

    r3705 r3726  
    677677                           'wf_transition_return': 'close',
    678678                           'wf_transition_admit': 'remain',
     679                           'wf_transition_graduate': 'close',
    679680                           'fields':
    680681                             ('jamb_reg_no',
     
    703704                           'wf_transition_return': 'close',
    704705                           'wf_transition_admit': 'remain',
     706                           'wf_transition_graduate': 'close',
    705707                           'fields':
    706708                             ('matric_no',
     
    715717                           'wf_transition_return': 'open',
    716718                           'wf_transition_admit': 'remain',
     719                           'wf_transition_graduate': 'close',
    717720                           'fields':
    718721                             ('firstname',
     
    730733                           'wf_transition_return': 'open',
    731734                           'wf_transition_admit': 'remain',
     735                           'wf_transition_graduate': 'close',
    732736                           'fields':
    733737                             ('study_course',
     
    754758                           'wf_transition_return': 'open',
    755759                           'wf_transition_admit': 'open',
     760                           'wf_transition_graduate': 'close',
    756761                           'fields':
    757762                             ()
     
    762767    def create(self,mapping): ###(
    763768        "create student records due import"
    764         logger = logging.getLogger('WAeUPTool.mass_create_student')
     769        logger = logging.getLogger('WAeUPImport.StudentImport.create')
    765770        students_folder = self.portal_url.getPortalObject().campus.students
    766771        jamb_reg_no = mapping.get('jamb_reg_no',None)
     
    832837        "edit student records due import"
    833838        wftool = self.portal_workflow
    834         logger = logging.getLogger('WAeUPTool.mass_edit_student')
     839        logger = logging.getLogger('WAeUPImport.StudentImport.edit')
    835840        students_folder = self.portal_url.getPortalObject().campus.students
    836841        student_id = mapping.get('id',None)
     
    876881                student_record = res[0]
    877882                editable_keys.remove('matric_no')
    878             ## included only to change wf state from admitted to returning
    879             #if student_record.review_state not in ('admitted','objection_raised'):
    880             #    return '%s' % student_record.id ,"student is not in state admitted or objection_raised"
    881             ## end inclusion
    882883            student_id = student_record.id
    883884            student_obj = getattr(students_folder,student_id)
     
    889890            d['session']  = mapping.get('current_session','')
    890891            current_level = mapping.get('current_level','')
     892            transition = mapping.get('reg_transition',None)
     893            if transition and transition not in ('admit','return','graduate'):
     894                msg = "no valid transition provided"
     895                break     
    891896            while d['session'] and d['verdict'] and current_level:
    892897                sub_obj = getattr(student_obj,'study_course',None)
     
    903908                    pass
    904909                break
     910           
    905911            for pt in f2t.keys():
    906912                #if pt == "StudentApplication":
     
    909915                #        d['jamb_sex']  = 'F'
    910916                intersect = set(f2t[pt]['fields']).intersection(set(editable_keys))
     917                #import pdb;pdb.set_trace()
     918                object_id = f2t[pt]['id']
     919                sub_obj = getattr(student_obj,object_id,None)
    911920                if intersect and pt not in ('StudentStudyLevel',):
    912                     object_id = f2t[pt]['id']
    913                     sub_obj = getattr(student_obj,object_id,None)
    914921                    if sub_obj is None:
    915922                        try:
     
    929936                        if changed:
    930937                            sub_doc.edit(mapping = d)
    931             ## included only to change wf state from admitted to returning
    932             #    if student_record.review_state in ('admitted','objection_raised'):
    933             #        new_state = f2t[pt]['wf_transition_return']
    934             #        sub_obj = getattr(student_obj,f2t[pt]['id'],None)
    935             #        if sub_obj and new_state != "remain":
    936             #            try:
    937             #                self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
    938             #            except:
    939             #                #logger.info('%s, wf transition %s of %s failed' % (student_id,new_state,sub_obj.id))
    940             #                pass
    941             #if student_record.review_state in ('admitted','objection_raised'):
    942             #    wfaction = 'return'
    943             #    try:
    944             #        self.portal_workflow.doActionFor(student_obj,wfaction)
    945             #        logger.info('%s, wf state changed' % student_id)
    946             #        any_change = True
    947             #    except:
    948             #        logger.info('%s, wf transition failed, old state = %s' % (student_id,student_record.review_state))
    949             #        pass
    950             ## end inclusion
    951             break
    952         # if not any_change:
    953         #     msg = 'not modified'
     938                if transition:
     939                    new_state = f2t[pt]['wf_transition_%(transition)s' % vars()]
     940                    if new_state != "remain":
     941                        try:
     942                            self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
     943                        except:
     944                            pass
     945            if transition:
     946                try:
     947                    self.portal_workflow.doActionFor(student_obj,transition)
     948                except:
     949                    msg = "reg_transition not allowed"
     950            break
    954951        return student_id,msg,mapping
    955952    ###)
  • WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml

    r3689 r3726  
    132132  </permission-map>
    133133 </state>
     134 <state state_id="graduated" title="">
     135  <exit-transition transition_id="return"/>
     136  <permission-map name="Delete objects" acquired="True">
     137   <permission-role>Manager</permission-role>
     138   <permission-role>SectionManager</permission-role>
     139   <permission-role>SectionOfficer</permission-role>
     140  </permission-map>
     141  <permission-map name="Modify portal content"
     142                  acquired="False">
     143   <permission-role>Manager</permission-role>
     144   <permission-role>SectionManager</permission-role>
     145   <permission-role>SectionOfficer</permission-role>
     146  </permission-map>
     147  <permission-map name="View" acquired="True">
     148   <permission-role>Owner</permission-role>
     149  </permission-map>
     150 </state>
    134151 <state state_id="deferred" title="">
    135152  <exit-transition transition_id="deactivate"/>
     
    167184  <exit-transition transition_id="deactivate"/>
    168185  <exit-transition transition_id="pay_school_fee"/>
     186  <exit-transition transition_id="graduate"/>
    169187  <permission-map name="Delete objects" acquired="False">
    170188   <permission-role>Manager</permission-role>
     
    281299  </guard>
    282300 </transition>
     301 <transition transition_id="graduate" title=""
     302             new_state="graduated" trigger="USER"
     303             before_script="" after_script="">
     304
     305
     306  <guard>
     307   <guard-role>SectionOfficer</guard-role>
     308   <guard-role>Manager</guard-role>
     309   <guard-role>SectionManager</guard-role>
     310  </guard>
     311 </transition>
    283312 <transition transition_id="defer" title=""
    284313             new_state="deferred" trigger="USER"
  • WAeUP_SRP/trunk/profiles/uniben/actions.xml

    r3715 r3726  
    77   <permission>View</permission>
    88  </action>
     9 </action-provider>
     10 <action-provider name="portal_actions">
     11  <action title="Send Email" action_id="send_email_form" category="global"
     12     condition_expr="python:str(member) in ('admin','med')"
     13     url_expr="string:${portal_url}/send_email_form" visible="True">
     14   <permission>View</permission>
     15  </action>     
     16 </action-provider>
    917</object>
Note: See TracChangeset for help on using the changeset viewer.