Ignore:
Timestamp:
5 Sep 2006, 13:20:18 (18 years ago)
Author:
joachim
Message:

added workflow student_subobject_wf
modified apply_admission accordingly

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

Legend:

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

    r478 r479  
    1111
    1212  <metal:block fill-slot="main">
    13 
    14     <tal:block tal:condition="python:context.portal_type == 'Student'" tal:omit-tag=""> 
    15       <tal:block tal:define="
    16                           rendered python:context.application.getContent().renderEdit(layout_id='student_application_fe',
    17                                                          layout_mode='edit');"
    18                           >
    19 
    20    
     13      <tal:block
     14          tal:define="rendered python:context.getContent().renderEdit(
     15                layout_id='student_application_fe',
     16                layout_mode='edit',
     17                );">
    2118      <tal:block tal:content="structure rendered" />
    22 
    2319      </tal:block> 
    24     </tal:block>
    25     <tal:block condition="python:context.portal_type != 'Student'">
    26    
    27       This is not a student object
    28      
    29    
    30     </tal:block> 
    31  
    3220  </metal:block>
    33 
    34 
    35 
    3621  <metal:block fill-slot="sub">
    3722  </metal:block>
  • WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py

    r478 r479  
    55return html renderer + psm
    66"""
    7 import DateTime
    8 current = DateTime.DateTime()
    9 
    107type_name = 'StudentApplication'
    11 
    128ti = context.portal_types[type_name]
    13 
    149REQUEST.set('type_name',type_name)
    1510
    1611validate = REQUEST.has_key("cpsdocument_create_button")
    1712
    18 
    1913lt = context.portal_layouts
    2014pr = context.portal_registration
    2115
    22 res,psm,ds = lt.renderLayout(layout_id= 'student_check_pin',
    23                       schema_id= 'student_check_pin',
     16prefix = 'APP'
     17res,psm,ds = lt.renderLayout(layout_id= 'student_application_fe',
     18                      schema_id= 'student_application',
    2419                      context=context,
    2520                      mapping=validate and REQUEST,
    26                       ob={},
     21                      ob={'app_ac_prefix': prefix},
    2722                      layout_mode='create',
    2823                      formaction = "apply_admission",
     
    6055student = application.aq_parent
    6156if context.portal_workflow.getInfoFor(student,'review_state',None) == "created":
    62     student.invokeFactory('StudentClearance','clearance')
     57    #student.invokeFactory('StudentClearance','clearance')
    6358    student.invokeFactory('StudentPersonal','personal')
    6459    student.content_status_modify(workflow_action="enter_application_pin")
     60
    6561
    6662apdoc = application.getContent()
     
    8076student.personal.getContent().edit(mapping = dp)
    8177da = {}
    82 da['app_ac_pin'] = ds['pin']
     78da['app_ac_prefix'] = prefix
     79da['app_ac_batch_no'] = ds.get('app_ac_batch_no')
     80da['app_ac_pin'] = ds.get('app_ac_pin')
    8381apdoc.edit(mapping = da)
    8482# now display the passport form with jamb-data readonly
     83return context.REQUEST.RESPONSE.redirect("%s/application_form" % (student.application.absolute_url()))
    8584return student.application_form()
    8685
  • WAeUP_SRP/trunk/skins/waeup_student/student_edit.py

    r478 r479  
    3535# (We don't call getEditableContent here, validate does it when needed.)
    3636doc = context.getContent()
    37 is_valid, ds = doc.validate(request=REQUEST, proxy=context, cluster=cluster,
    38                             use_session=True)
    3937
    40 if action is None:
    41     ti = doc.getTypeInfo()
    42     action = ti.queryMethodID('edit', 'cpsdocument_edit_form')
    43     action = '/' + action
    44 
    45 if is_valid:
    46     comments = REQUEST.get('comments')
    47     context.cpsdocument_notify_modification(comments=comments)
    48     if cpsdocument_edit_and_view_button is not None:
    49         action = ''
    50     psm = 'psm_content_changed'
    51     args = {}
     38if context.portal_type == "StudentApplication":
     39    student = context.aq_parent
     40    if context.portal_workflow.getInfoFor(student,'review_state',None) == "application_pin_entered":
     41        student.content_status_modify(workflow_action="apply_for_admission")
     42        is_valid, ds = doc.validate(request=REQUEST,
     43                                    proxy=context,
     44                                    layout_id = "student_application_fe",
     45                                    layout_mode = 'edit',
     46                                    use_session=True)
     47       
     48        action = '/application_form'
     49       
     50        if is_valid:
     51            comments = REQUEST.get('comments')
     52            context.cpsdocument_notify_modification(comments=comments)
     53            if cpsdocument_edit_and_view_button is not None:
     54                action = ''
     55            psm = 'psm_content_changed'
     56            args = {}
     57        else:
     58            psm = 'psm_content_error'
     59            args = getFormUidUrlArg(REQUEST)
     60    else:
     61        psm = "Application applied waiting for results"
     62        action = "/view"
    5263else:
    53     psm = 'psm_content_error'
    54     args = getFormUidUrlArg(REQUEST)
    55 
     64    is_valid, ds = doc.validate(request=REQUEST, proxy=context, cluster=cluster,
     65                                use_session=True)
     66   
     67    if action is None:
     68        ti = doc.getTypeInfo()
     69        action = ti.queryMethodID('edit', 'cpsdocument_edit_form')
     70        action = '/' + action
     71   
     72    if is_valid:
     73        comments = REQUEST.get('comments')
     74        context.cpsdocument_notify_modification(comments=comments)
     75        if cpsdocument_edit_and_view_button is not None:
     76            action = ''
     77        psm = 'psm_content_changed'
     78        args = {}
     79    else:
     80        psm = 'psm_content_error'
     81        args = getFormUidUrlArg(REQUEST)
     82   
    5683args['portal_status_message'] = psm
    5784url = context.absolute_url() + action + '?' + urlencode(args)
Note: See TracChangeset for help on using the changeset viewer.