Changeset 3726
- Timestamp:
- 14 Oct 2008, 10:11:54 (16 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/CHANGES.txt
r3714 r3726 82 82 ----------------- 83 83 - add FCEOyo profile and skin 84 85 1.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 677 677 'wf_transition_return': 'close', 678 678 'wf_transition_admit': 'remain', 679 'wf_transition_graduate': 'close', 679 680 'fields': 680 681 ('jamb_reg_no', … … 703 704 'wf_transition_return': 'close', 704 705 'wf_transition_admit': 'remain', 706 'wf_transition_graduate': 'close', 705 707 'fields': 706 708 ('matric_no', … … 715 717 'wf_transition_return': 'open', 716 718 'wf_transition_admit': 'remain', 719 'wf_transition_graduate': 'close', 717 720 'fields': 718 721 ('firstname', … … 730 733 'wf_transition_return': 'open', 731 734 'wf_transition_admit': 'remain', 735 'wf_transition_graduate': 'close', 732 736 'fields': 733 737 ('study_course', … … 754 758 'wf_transition_return': 'open', 755 759 'wf_transition_admit': 'open', 760 'wf_transition_graduate': 'close', 756 761 'fields': 757 762 () … … 762 767 def create(self,mapping): ###( 763 768 "create student records due import" 764 logger = logging.getLogger('WAeUP Tool.mass_create_student')769 logger = logging.getLogger('WAeUPImport.StudentImport.create') 765 770 students_folder = self.portal_url.getPortalObject().campus.students 766 771 jamb_reg_no = mapping.get('jamb_reg_no',None) … … 832 837 "edit student records due import" 833 838 wftool = self.portal_workflow 834 logger = logging.getLogger('WAeUP Tool.mass_edit_student')839 logger = logging.getLogger('WAeUPImport.StudentImport.edit') 835 840 students_folder = self.portal_url.getPortalObject().campus.students 836 841 student_id = mapping.get('id',None) … … 876 881 student_record = res[0] 877 882 editable_keys.remove('matric_no') 878 ## included only to change wf state from admitted to returning879 #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 inclusion882 883 student_id = student_record.id 883 884 student_obj = getattr(students_folder,student_id) … … 889 890 d['session'] = mapping.get('current_session','') 890 891 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 891 896 while d['session'] and d['verdict'] and current_level: 892 897 sub_obj = getattr(student_obj,'study_course',None) … … 903 908 pass 904 909 break 910 905 911 for pt in f2t.keys(): 906 912 #if pt == "StudentApplication": … … 909 915 # d['jamb_sex'] = 'F' 910 916 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) 911 920 if intersect and pt not in ('StudentStudyLevel',): 912 object_id = f2t[pt]['id']913 sub_obj = getattr(student_obj,object_id,None)914 921 if sub_obj is None: 915 922 try: … … 929 936 if changed: 930 937 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 954 951 return student_id,msg,mapping 955 952 ###) -
WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml
r3689 r3726 132 132 </permission-map> 133 133 </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> 134 151 <state state_id="deferred" title=""> 135 152 <exit-transition transition_id="deactivate"/> … … 167 184 <exit-transition transition_id="deactivate"/> 168 185 <exit-transition transition_id="pay_school_fee"/> 186 <exit-transition transition_id="graduate"/> 169 187 <permission-map name="Delete objects" acquired="False"> 170 188 <permission-role>Manager</permission-role> … … 281 299 </guard> 282 300 </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> 283 312 <transition transition_id="defer" title="" 284 313 new_state="deferred" trigger="USER" -
WAeUP_SRP/trunk/profiles/uniben/actions.xml
r3715 r3726 7 7 <permission>View</permission> 8 8 </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> 9 17 </object>
Note: See TracChangeset for help on using the changeset viewer.