Ignore:
Timestamp:
4 Sep 2006, 13:03:08 (18 years ago)
Author:
joachim
Message:

apply_admission basics

Location:
WAeUP_SRP/trunk/skins/waeup_student
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/application_form.pt

    r477 r478  
    1010  </metal:block>
    1111
    12   <metal:block fill-slot="main"
    13                tal:define="roles member/getRoles;
    14                frontend python:'Student' in roles or isAnon;
    15                folder here/getContent;"                             
    16                >
     12  <metal:block fill-slot="main">
    1713
    1814    <tal:block tal:condition="python:context.portal_type == 'Student'" tal:omit-tag=""> 
    1915      <tal:block tal:define="
    20                           appl python:here.application;
    21                           appl_proxy python:appl.getContent();"
     16                          rendered python:context.application.getContent().renderEdit(layout_id='student_application_fe',
     17                                                         layout_mode='edit');"
    2218                          >
    2319
    24       <h2>Application Form for <span tal:content="appl_proxy/jamb_firstname" /> <span tal:content="appl_proxy/jamb_lastname" /></h2>     
    2520   
    26       <tal:block tal:content="structure python:appl_proxy.renderEdit(request=request, layout_id='student_application_fe', proxy=appl_proxy, layout_mode='edit')" />
    27      
    28       <tal:block tal:content="structure python:appl_proxy.renderEdit(layout_id='student_application_fe', layout_mode='view')" />
    29            
    30       <tal:block tal:content="structure python:appl_proxy.render(layout_id='student_application_fe')" />
     21      <tal:block tal:content="structure rendered" />
    3122
    3223      </tal:block> 
     
    3425    <tal:block condition="python:context.portal_type != 'Student'">
    3526   
    36       This is not a student object!
     27      This is not a student object
     28     
    3729   
    3830    </tal:block> 
  • WAeUP_SRP/trunk/skins/waeup_student/application_pin_form.pt

    r476 r478  
    1818          <p>Instructions :</p>
    1919          <ul>
    20             <li>Buy an Application Scratch Card.</li>
     20            <li>Buy an Appliiication Scratch Card.</li>
    2121            <li>Enter your JAMB registration number and the Application PIN above.</li>
    2222            <li>Upload your passport picture.</li>
  • WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py

    r477 r478  
    1414REQUEST.set('type_name',type_name)
    1515
    16 validate = REQUEST.has_key("cpsdocument_edit_button")
     16validate = REQUEST.has_key("cpsdocument_create_button")
    1717
    1818
     
    2121
    2222res,psm,ds = lt.renderLayout(layout_id= 'student_check_pin',
    23                       schema_id= 'student_application',
     23                      schema_id= 'student_check_pin',
    2424                      context=context,
    2525                      mapping=validate and REQUEST,
     
    3131if psm == 'invalid':
    3232    return context.application_pin_form(rendered = res,
    33                                  psm = "Please correct your input",
     33                                 #psm = "Please correct your input",
     34                                 psm = "psm : #%s#" % (psm,),
     35                                 firstlayout = True,
     36                                 lastlayout = True,
    3437                                 ds = ds,
    3538                                 )
     
    3740    return context.application_pin_form(rendered = res,
    3841                                 psm = None,
     42                                 firstlayout = True,
     43                                 lastlayout = True,
    3944                                 ds = ds,
    4045                                 )
    4146elif psm == 'valid':
    42     jamb_id = ds.get('jamb_id')
     47    jamb_id = ds.get('jamb_reg_no')
    4348    catalog = context.portal_catalog
    4449    search = catalog({'meta_type': 'StudentApplication',
     
    5459application = search[0].getObject()
    5560student = application.aq_parent
    56 student.invokeFactory('StudentClearance','clearance')
    57 student.invokeFactory('StudentPersonal','personal')
     61if context.portal_workflow.getInfoFor(student,'review_state',None) == "created":
     62    student.invokeFactory('StudentClearance','clearance')
     63    student.invokeFactory('StudentPersonal','personal')
     64    student.content_status_modify(workflow_action="enter_application_pin")
     65
     66apdoc = application.getContent()
     67names = apdoc.jamb_lastname.split()
     68dp = {}
     69if len(names) == 3:
     70    dp['firstname'] = names[0].capitalize()
     71    dp['middlename'] = names[1].capitalize()
     72    dp['lastname'] = names[2].capitalize()
     73elif len(names) == 2:
     74    dp['firstname'] = names[0].capitalize()
     75    dp['lastname'] = names[1].capitalize()
     76else:
     77    dp['lastname'] = apdoc.jamb_lastname
     78dp['sex'] = apdoc.jamb_sex == 'M'
     79dp['lga'] = "%s/%s" % (apdoc.jamb_state,apdoc.jamb_lga )
     80student.personal.getContent().edit(mapping = dp)
     81da = {}
     82da['app_ac_pin'] = ds['pin']
     83apdoc.edit(mapping = da)
    5884# now display the passport form with jamb-data readonly
    5985return student.application_form()
Note: See TracChangeset for help on using the changeset viewer.