Changeset 1781


Ignore:
Timestamp:
13 May 2007, 17:38:27 (18 years ago)
Author:
Henrik Bettermann
Message:

email and phone was not copied into application and personal after first login

Location:
WAeUP_SRP/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTool.py

    r1775 r1781  
    218218                d[field] = dict.get(field,'')
    219219            sub_doc.edit(mapping = d)
    220             new_state = f2t[pt]['wf_state']
     220            new_state = f2t[pt]['wf_transition']
    221221            if new_state != "remain":
    222222                self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
     
    605605            data = {}
    606606
    607             # format of the first file sent from Tayo
     607            # format of the first file sent by Tayo
    608608            #data['datetime'] = date = DateTime.DateTime(pay_transaction['Date'])
    609609            #data['student_id'] = student_id = pay_transaction['Payer ID']
     
    612612            #data['amount'] = amount = pay_transaction['Amount']
    613613
    614             # format of the second file sent from Tayo
     614            # format of the second file sent by Tayo
    615615            data['datetime'] = date = 0
    616616            data['student_id'] = student_id = pay_transaction['Payer ID']
     
    652652    ###)
    653653
     654   
     655    # all workflow transitions refer to students in state returning
    654656    student_field2types = {   ###(
    655657                      'StudentApplication':
    656658                          {'id': 'application',
    657659                           'title': 'Application Data',
    658                            'wf_state': 'close',
     660                           'wf_transition': 'close',
    659661                           'fields':
    660662                             ('jamb_reg_no',
     
    669671                          {'id': 'pume',
    670672                           'title': 'Pume Data',
    671                            'wf_state': 'close',
     673                           'wf_transition': 'close',
    672674                           'fields':
    673675                             ('pume_score',
     
    677679                          {'id': 'clearance',
    678680                           'title': 'Clearance Data',
    679                            'wf_state': 'close',
     681                           'wf_transition': 'close',
    680682                           'fields':
    681683                             ('matric_no',
     
    687689                          {'id': 'personal',
    688690                           'title': 'Personal Data',
    689                            'wf_state': 'open',
     691                           'wf_transition': 'open',
    690692                           'fields':
    691693                             ('firstname',
     
    701703                          {'id': 'study_course',
    702704                           'title': 'Study Course',
    703                            'wf_state': 'open',
     705                           'wf_transition': 'open',
    704706                           'fields':
    705707                             ('study_course',
     
    713715                          {'id': 'payments',
    714716                           'title': 'Payments',
    715                            'wf_state': 'open',
     717                           'wf_transition': 'open',
    716718                           'fields':
    717719                             ()
     
    723725    security.declareProtected(ModifyPortalContent,'importStudent') ###(
    724726    def importStudent(self,dict):
    725         "create a students data"
    726         logger = logging.getLogger('WAeUPTool.import_student')
     727        "create a students record due import"
     728        logger = logging.getLogger('WAeUPTool.importStudent')
    727729        students_folder = self.portal_url.getPortalObject().campus.students
    728730        jamb_reg_no = dict.get('jamb_reg_no',None)
     
    748750            sub_obj = getattr(student_obj,f2t[pt]['id'])
    749751            sub_doc = sub_obj.getContent()
    750             #self.portal_workflow.doActionFor(sub_obj,'open',dest_container=sub_obj)
    751752            d['Title'] = f2t[pt]['title']
    752753            for field in f2t[pt]['fields']:
    753754                d[field] = dict.get(field,'')
    754755            sub_doc.edit(mapping = d)
    755             new_state = f2t[pt]['wf_state']
     756            new_state = f2t[pt]['wf_transition']
    756757            if new_state != "remain":
    757758                self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
     
    764765    security.declareProtected(ModifyPortalContent,'importEditStudent') ###(
    765766    def importEditStudent(self,dict):
    766         "edit a students data"
    767         logger = logging.getLogger('WAeUPTool.create_student')
     767        "edit a students record due import"
     768        logger = logging.getLogger('WAeUPTool.importEditStudent')
    768769        students_folder = self.portal_url.getPortalObject().campus.students
    769770        sid = dict.get('id',None)
     
    804805                sub_obj = getattr(student_obj,f2t[pt]['id'])
    805806            sub_doc = sub_obj.getContent()
    806             self.portal_workflow.doActionFor(sub_obj,'open',dest_container=sub_obj)
     807            # self.portal_workflow.doActionFor(sub_obj,'open',dest_container=sub_obj)
    807808            d['Title'] = f2t[pt]['title']
    808809            for field in f2t[pt]['fields']:
    809810                d[field] = dict.get(field,'')
    810811            sub_doc.edit(mapping = d)
    811             # new_state = f2t[pt]['wf_state']
     812            # new_state = f2t[pt]['wf_transition']
    812813            # if new_state != "remain":
    813814            #     self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
  • WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py

    r1780 r1781  
    4444        student = getattr(students,str(member))
    4545        student_app = getattr(student,'application',None)
    46         if request.has_key('returning') and student_app is None:
     46        student_per = getattr(student,'personal',None)
     47        if request.has_key('returning') and  student_app is None:
    4748            email=request.get("email")
    4849            phone=request.get("phone_nr")
    4950            context.waeup_tool.makeStudentData(str(member),
    50                                                email=email,
    51                                                phone_nr=phone,
    52                                                )
    53             d = {}
    54             d['id'] = str(member)
    55             d['email'] = email
    56             d['phone'] = phone
    57             context.students_catalog.modifyRecord(**d)
     51                                                   email=email,
     52                                                   phone_nr=phone,
     53                                                   )
     54            #d = {}
     55            #d['id'] = str(member)
     56            #d['email'] = email
     57            #d['phone'] = phone
     58            #context.students_catalog.modifyRecord(**d)
    5859        elif student_app is None:
    5960            context.waeup_tool.makeStudentData(str(member))
     
    7374        logger.info('%s logged in, review_state %s' % (member,s_review_state))
    7475        app_doc = student_app.getContent()
     76       
     77        if request.has_key('returning'):
     78            email=request.get("email")
     79            phone=request.get("phone_nr")       
     80            # should be always closed, however ...
     81            if a_review_state != 'opened':
     82                wftool.doActionFor(student_app,'open')
     83            # should be always opened after import, however ...
     84            if p_review_state != 'opened':   
     85                wftool.doActionFor(student_per,'open')
     86            per_doc = student_per.getContent()
     87            app_doc.edit(mapping = {'app_email' : email})
     88            per_doc.edit(mapping = {'email' : email, 'phone' : phone})
     89            wftool.doActionFor(student_app,'close')
     90       
    7591        #from Products.zdb import set_trace;set_trace()
    7692        if load_passport and 'passport' not in app_doc.objectIds():
  • WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py

    r1763 r1781  
    2222entry_sessions = ('94','95','96','97','98','99','00','01','02','03','04','05')
    2323
    24 new_states =      ('returning',
     24ret_states =      ('returning',
    2525                   'school_fee_paid',
    2626                   'courses_registered',
     
    3939res = context.students_catalog(entry_session = entry_sessions)
    4040dict['total'] = len(res)
    41 for state in new_states:
     41for state in ret_states:
    4242    res = context.students_catalog(entry_session = entry_sessions, review_state = state)
    4343    dict[state] = len(res)
     
    5555    res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId)
    5656    dict['total'] = len(res)
    57     for state in new_states:
     57    for state in ret_states:
    5858        res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId, review_state = state)
    5959        dict[state] = len(res)
Note: See TracChangeset for help on using the changeset viewer.