Changeset 2268


Ignore:
Timestamp:
21 Sep 2007, 20:11:08 (17 years ago)
Author:
Henrik Bettermann
Message:

allow overwriting of matric_no or jamb_reg_no if student id is provided

Location:
WAeUP_SRP
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r2267 r2268  
    11561156            if not res:
    11571157                return '',"no student with id %s" % sid
    1158             elif matric_no and res[0].matric_no and\
     1158            if matric_no and res[0].matric_no and\
    11591159              matric_no != res[0].matric_no:
    1160                 return '%s' % res[0].id ,"student has no matric_no %s" % matric_no
    1161             elif jamb_reg_no and res[0].jamb_reg_no and\
     1160                logger.info("%s, old matric_no %s overwritten with %s" % (res[0].id,res[0].matric_no,matric_no))
     1161            if jamb_reg_no and res[0].jamb_reg_no and\
    11621162              jamb_reg_no != res[0].jamb_reg_no:
    1163                 return '%s' % res[0].id ,"student has no jamb_reg_no %s" % jamb_reg_no
     1163                logger.info("%s, old reg_no %s overwritten with %s" % (res[0].id,res[0].jamb_reg_no,jamb_reg_no))
    11641164        elif jamb_reg_no:
    11651165            res = self.students_catalog(jamb_reg_no = jamb_reg_no)
     
    11731173            editable_keys.remove('matric_no')
    11741174
    1175         # included only to change wf state from admitted to returning
    1176         if res[0].review_state not in ('admitted','objection_raised'):
    1177             return '%s' % res[0].id ,"student is not in state admitted or objection_raised"
    1178         # end inclusion
     1175        ## included only to change wf state from admitted to returning
     1176        #if res[0].review_state not in ('admitted','objection_raised'):
     1177        #    return '%s' % res[0].id ,"student is not in state admitted or objection_raised"
     1178        ## end inclusion
    11791179
    11801180        sid = res[0].id
     
    12101210
    12111211
    1212         # included only to change wf state from admitted to returning
    1213             if res[0].review_state in ('admitted','objection_raised'):
    1214                 new_state = f2t[pt]['wf_transition_return']
    1215                 sub_obj = getattr(student_obj,f2t[pt]['id'],None)
    1216                 if sub_obj and new_state != "remain":
    1217                     try:
    1218                         self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
    1219                     except:
    1220                         #logger.info('%s, wf transition %s of %s failed' % (sid,new_state,sub_obj.id))
    1221                         pass
    1222         if res[0].review_state in ('admitted','objection_raised'):
    1223             wfaction = 'return'
    1224             try:
    1225                 self.portal_workflow.doActionFor(student_obj,wfaction)
    1226                 logger.info('%s, wf state changed' % sid)
    1227                 any_change = True
    1228             except:
    1229                 logger.info('%s, wf transition failed, old state = %s' % (sid,res[0].review_state))
    1230                 pass
    1231         # end inclusion
     1212        ## included only to change wf state from admitted to returning
     1213        #    if res[0].review_state in ('admitted','objection_raised'):
     1214        #        new_state = f2t[pt]['wf_transition_return']
     1215        #        sub_obj = getattr(student_obj,f2t[pt]['id'],None)
     1216        #        if sub_obj and new_state != "remain":
     1217        #            try:
     1218        #                self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
     1219        #            except:
     1220        #                #logger.info('%s, wf transition %s of %s failed' % (sid,new_state,sub_obj.id))
     1221        #                pass
     1222        #if res[0].review_state in ('admitted','objection_raised'):
     1223        #    wfaction = 'return'
     1224        #    try:
     1225        #        self.portal_workflow.doActionFor(student_obj,wfaction)
     1226        #        logger.info('%s, wf state changed' % sid)
     1227        #        any_change = True
     1228        #    except:
     1229        #        logger.info('%s, wf transition failed, old state = %s' % (sid,res[0].review_state))
     1230        #        pass
     1231        ## end inclusion
    12321232
    12331233
  • WAeUP_SRP/uniben/profiles/default/actions.xml

    r2262 r2268  
    5252  </action>
    5353  <action title="Import Data" action_id="import" category="global"
    54      condition_expr="python:member and member.has_role('Manager')" url_expr="string:./import"
    55      visible="True">
    56    <permission>View</permission>
    57   </action> 
     54     condition_expr="python:member and member.has_role('Manager')" url_expr="string:${portal_url}/import"
     55     visible="True">
     56   <permission>View</permission>
     57  </action>
    5858  <action title="action_manage_vocabularies" action_id="manage_vocabularies"
    5959     category="global" condition_expr=""
  • WAeUP_SRP/uniben/profiles/default/layouts/import_student.xml

    r2237 r2268  
    88 <property name="flexible_widgets"/>
    99 <property name="validate_values_expr"></property>
     10
     11 <widget name="id" meta_type="String Widget">
     12  <property name="title">Id</property>
     13  <property name="fields">
     14   <element value="email"/>
     15  </property>
     16  <property name="is_required">False</property>
     17  <property name="label">Id</property>
     18  <property name="label_edit">Id</property>
     19  <property name="readonly_layout_modes"/>
     20  <property name="hidden_layout_modes"/>
     21  <property name="hidden_readonly_layout_modes"/>
     22 </widget>
     23
    1024 <widget name="reg_transition" meta_type="String Widget">
    1125  <property name="title">Transition after import</property>
     
    262276  <property name="hidden_readonly_layout_modes"/>
    263277 </widget>
    264  
     278
    265279  <widget name="jamb_state" meta_type="String Widget">
    266280  <property name="title">JAMB State</property>
  • WAeUP_SRP/uniben/profiles/default/schemas/import_student.xml

    r2188 r2268  
    22<?xml-stylesheet type="text/xsl" href="schema.xsl"?>
    33<object name="import_student" meta_type="CPS Schema">
     4 <field name="id" meta_type="CPS String Field"/>
    45 <field name="reg_transition" meta_type="CPS String Field"/>
    56 <field name="firstname" meta_type="CPS String Field"/>
Note: See TracChangeset for help on using the changeset viewer.