Ignore:
Timestamp:
8 Nov 2006, 08:32:36 (18 years ago)
Author:
joachim
Message:

added email to checkadmission-form, first draft of clearance_edit

Location:
WAeUP_SRP/trunk/skins/waeup_student
Files:
4 added
1 deleted
5 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/application_edit.py

    r784 r788  
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=REQUEST, cluster=None, cpsdocument_edit_and_view_button=None, action=None
     7##parameters=REQUEST,proceed=None, cpsdocument_edit_button=None, action=None
    88##title=
    99# $Id$
     
    1717
    1818# Until ajax posts directly to its own script...
    19 if 'ajax_edit' in REQUEST.form:
    20     return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster)
     19##if 'ajax_edit' in REQUEST.form:
     20##    return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster)
    2121
    2222# Check flexible controls
     
    3333clear_doc = info['clear_doc']
    3434state = context.getStudentInfo()['review_state']
    35 
    36 if context.portal_type == "Student":
    37     if app_doc.passport is None:
    38         is_valid, ds = app_doc.validate(request=REQUEST,
    39                                     proxy=app_doc,
    40                                     layout_id = "student_application_fe",
    41                                     layout_mode = 'edit',
    42                                     use_session=True)
    43         action = "/application_edit"
    44         if is_valid:
    45             if app_doc.passport is not None:
    46                 psm = 'You successfully uploaded your passport image.'
    47                 args = {'apply_button': 'Apply',}
    48             else:
    49                 psm = "You didn't upload a passport image."
    50                 args = {}
    51         else:
    52             psm = 'psm_content_error'
    53             args = getFormUidUrlArg(REQUEST)
    54     elif 'apply_admission' not in REQUEST.form:
    55         is_valid, ds = app_doc.validate(request=REQUEST,
    56                                     proxy=app_doc,
    57                                     layout_id = "student_application_fe",
    58                                     layout_mode = 'edit',
    59                                     use_session=True)
    60         action = "/application_edit"
    61         if is_valid:
    62             args = {}
    63             if 'apply_admission' not in REQUEST.form:
    64                 args = {'apply_button': 'Apply',}
    65                 psm = 'You successfully uploaded your passport image.'
    66             else:
    67                 psm = 'You applied for admission.'
    68         else:
    69             args = getFormUidUrlArg(REQUEST)
    70             psm = 'psm_content_error'
    71     else:
    72         psm = ''
    73         args = {}
    74         if info['review_state'] == "student_created":
    75             student.content_status_modify(workflow_action="apply_for_admission")
    76             wftool.doActionFor(app,'close',dest_container= app)
    77             psm = 'You applied for admission.'
    78             action = "/application_view"
    79         elif info['review_state'] == "admitted":
    80             student.content_status_modify(workflow_action="enter_clearance_pin")
    81             #wftool.doActionFor(info['clear'],'open',dest_container=info['clear'])
    82             app_doc = info['app_doc']
    83             dc = {}
    84             dc['email'] = app_doc.app_email
    85             info['clear_doc'].edit(mapping = dc)
    86             wftool.doActionFor(app,'close',dest_container= app)
    87             psm = 'You successfully started the clearance process.'
    88             action = "/clearance_edit"
    89         else:
    90             action = "/clearance_view"
    91 
    92 else:
    93     is_valid, ds = app_doc.validate(request=REQUEST, proxy=context, cluster=cluster,
     35is_valid, ds = app_doc.validate(request=REQUEST,
     36                                schema_id = 'student_application',
     37                                layout_id = 'student_application_fe',
     38                                proxy=app,
    9439                                use_session=True)
    9540
    96     if action is None:
    97         ti = app.getTypeInfo()
    98         action = ti.queryMethodID('edit', 'cpsdocument_edit_form')
    99         action = '/' + action
    100 
     41psm = ""
     42args = {}
     43action = "/application_edit_view"
     44if cpsdocument_edit_button:
    10145    if is_valid:
    102         comments = REQUEST.get('comments')
    103         context.cpsdocument_notify_modification(comments=comments)
    104         if cpsdocument_edit_and_view_button is not None:
    105             action = ''
    106         psm = 'psm_content_changed'
    107         args = {}
     46        if app_doc.passport is not None:
     47            args['proceed'] = 'Continue to Clearance'
     48            psm = 'You successfully uploaded your passport image.'
     49        else:
     50            psm = "You didn't upload a passport image."
     51elif proceed:
     52    if is_valid:
     53        action = "/request_clearance"
    10854    else:
    10955        psm = 'psm_content_error'
    110         args = getFormUidUrlArg(REQUEST)
    111 
    11256args['portal_status_message'] = psm
    113 url = context.absolute_url() + action + '?' + urlencode(args)
     57url = app.absolute_url() + action + '?' + urlencode(args)
    11458REQUEST.RESPONSE.redirect(url)
  • WAeUP_SRP/trunk/skins/waeup_student/check_admission.py

    r785 r788  
    55"""
    66import DateTime
     7from urllib import urlencode
    78current = DateTime.DateTime()
    89pr = context.portal_registration
    9 
    10 
    1110type_name = 'StudentApplication'
    1211ti = context.portal_types[type_name]
     
    4544elif psm == 'valid':
    4645    s_id = ds.get('s_id')
     46    email = ds.get('app_email')
    4747    student = getattr(context.campus.students, s_id)
    4848    review_state = wf.getInfoFor(student,'review_state',None)
     
    5151        return redirect(url)
    5252    pin = str(ds.get('app_ac_pin'))
    53     return redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s"
    54           % (context.absolute_url(),s_id,pin.split('-')[2],pin))
    55 return
     53    args = {}
     54    args['__ac_name'] = s_id
     55    args['__ac_password'] = pin.split('-')[2]
     56    args['pin'] = pin
     57    args['email'] = email
     58    url = "%s/logged_in?%s" % (context.absolute_url(),urlencode(args))
     59    return redirect(url)
  • WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_view.pt

    r786 r788  
    11<tal:block define="
    22           info context/getStudentInfo;
    3            res python:info['clear_doc'].renderEditDetailed(request=request,
    4                                                       schema_id='student_clearance',
    5                                                       layout_id='student_clearance_fe',
    6                                                       layout_mode='edit',);
    7            rendered_main python: res[0];
     3           rendered_main python:info['clear_doc'].render(request=request,
     4                                               layout_mode = 'edit',
     5                                               schema_id='student_clearance',
     6                                               layout_id='student_clearance_fe',
     7                                               layout_mode='edit',);
    88           form_action string:clearance_edit;
    99           edition python:True;
     10           creation python:False;
    1011           metadata nothing;
    1112    ">
    1213<metal:block define-macro="edit_form">
    1314<metal:block use-macro="here/content_lib_master/macros/master">
     15  <metal:block fill-slot="style_slot">
     16    <link rel="Stylesheet" type="text/css" href=""
     17      tal:attributes="href string:${base_url}document.css" />
    1418
     19    <metal:block define-macro="widgets_javascript">
     20    <!-- XXX this has to move to CPSSchemas -->
     21    <style type="text/css"
     22      tal:content="string:@import url(${base_url}calendar-win2k-1.css);"></style>
     23    <script type="text/javascript" src="calendar.js"
     24      tal:attributes="src string:${base_url}calendar.js"></script>
     25    <script type="text/javascript" src="lang/calendar-en.js"
     26      tal:define="local cpsmcat/getSelectedLanguage"
     27      tal:attributes="src string:${base_url}lang/calendar-${local}.js"></script>
     28    <script type="text/javascript" src="calendar-setup.js"
     29      tal:attributes="src string:${base_url}calendar-setup.js"></script>
     30    <script type="text/javascript" src="prototype.js"
     31      tal:attributes="src string:${base_url}prototype.js"></script>
     32    <script type="text/javascript" src="effects.js"
     33      tal:attributes="src string:${base_url}effects.js"></script>
     34    <script type="text/javascript" src="controls.js"
     35      tal:attributes="src string:${base_url}controls.js"></script>
     36    <script type="text/javascript" src="cpsdocument.js"
     37      tal:attributes="src string:${base_url}cpsdocument.js"></script>
     38    <tal:block condition="python:modules['Products.CPSUtil.integration'].isProductPresent('Products.FCKeditor')">
     39      <script type="text/javascript">
     40        var popup_editor_form = 'popup_fckeditor_form';
     41        var width = 640;
     42        var height = 520;
     43      </script>
     44    </tal:block>
     45    <tal:block condition="python:modules['Products.CPSUtil.integration'].isProductPresent('Products.Epoz')">
     46      <script type="text/javascript">
     47        var popup_editor_form = 'popup_rte_form';
     48        var width = 640;
     49        var height = 480;
     50      </script>
     51    </tal:block>
     52    <script type="text/javascript">
     53     function popup_rte(input_id, label_edit) {
     54       var args, value;
     55       value = document.getElementById(input_id).value;
     56       args = '?input_id='+input_id+'&amp;label_edit='+escape(label_edit);
     57       str_window_features = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,dependent=1,width=' + width + ',height=' + height;
     58       popup = window.open(popup_editor_form + args, input_id, str_window_features);
     59       if (!popup.opener) {
     60         popup.opener = window;
     61       }
     62       return false;
     63     }
     64   </script>
     65   </metal:block>
     66  </metal:block>
    1567
    16   <metal:block fill-slot="header">
    17     <h3>
    18       Edit your Clearance Data!
    19     </h3>
    20   </metal:block>
     68    <h1> Edit your clearance Data</h1>
    2169
    2270  <metal:block fill-slot="main">
     
    2876          <tal:block define="getFormUidHtml nocall:modules/Products.CPSDocument.utils/getFormUidHtml"
    2977                     replace="structure python:getFormUidHtml(request)"/>
    30          
    3178          <input type="hidden" id="button_placeholder" name="button_placeholder" value="" />
    3279          <div id="rendered_main" tal:content="structure rendered_main">
     
    3481          </div>
    3582        </div>
    36          
    37                
     83        <metal:block use-macro="here/cpsdocument_edit_buttons/macros/buttons"/>
    3884      </div>
    3985    </form>
     86    <div id="ajax_psm" style="display:none">
     87      ajax feedback
     88    </div>
    4089  </metal:block>
    4190
  • WAeUP_SRP/trunk/skins/waeup_student/clearance_pin_form.pt

    r766 r788  
    2020          <ul>
    2121            <li>Buy a Clearance Scratch Card.</li>
    22             <li>Enter your JAMB registration number and the Clearance PIN above.</li>
    23             <li>Upload your passport picture.</li>
    2422            <li>Apply</li>
    2523          </ul>
  • WAeUP_SRP/trunk/skins/waeup_student/defer_view.pt

    r785 r788  
    3030      <table tal:define="sc python: info['course_doc']">
    3131        <tr>
     32          <td tal:content="sc/title" /> <td>ID: <span tal:content="sc/study_course" /></td>
     33        </tr>
     34        <tr>
    3235          <td tal:content="sc/title" /> <td tal:content="sc/study_course" />
    3336        </tr>
    3437      </table>
    35         <span tal:condition="python:0" tal:omit-tag=""
    36               tal:content="structure python: info['course_doc'].render(proxy=info['course_doc'],
    37               layout_mode='view_student_course',
    38               layout_id='student_study_course')"
    39               />
    4038     
    4139      <form action="." method="post" class="group"
     
    5149                       (cpsmcat('confirm that you defer'), )"
    5250                       />
    53                 <input type="submit" name="request_clearance:method"
    54                        class="context" value="request Clearance"
     51                <input type="submit" name="application_edit:method"
     52                       class="context" value="upload Passport"
    5553                       />
    5654            </td>
  • WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt

    r710 r788  
    66  ds options/datastructure;
    77  dm ds/getDataModel;
    8   formaction options/formaction|string:student_edit;
     8  formaction options/formaction|string:application_edit;
    99  creation creation|nothing;
    1010  metadata metadata|nothing;
     
    1212  ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None);
    1313  cpsmcat nocall:here/translation_service;
    14   apply request/apply_button|nothing;
     14  proceed options/proceed|nothing;
    1515  widgets python:context.getRenderedWidgets(layout);
    1616  ">
     
    121121         id="cpsdocument_edit_button"
    122122         tal:condition="not:creation" />
    123   <input type="submit" class="standalone" name="apply_admission"
     123  <input type="submit" class="standalone" name="proceed"
    124124         value="apply for admission"
    125125         id="cpsdocument_edit_and_view_button"
    126          tal:condition="apply"
    127          tal:attributes="value apply"/>
     126         tal:condition="proceed"
     127         tal:attributes="value proceed"/>
    128128  <input type="submit"
    129129         class="standalone"
  • WAeUP_SRP/trunk/skins/waeup_student/student_index.py

    r785 r788  
    3333        return redirect("%s/application_view" % student.absolute_url())
    3434    elif state in ('application_pin_entered',):
    35         return redirect("%s/application_edit" % student.absolute_url())
     35        return redirect("%s/application_edit" % info['app'].absolute_url())
    3636    elif state in ('admitted',):
    3737        return redirect("%s/defer_view" % student.absolute_url())
Note: See TracChangeset for help on using the changeset viewer.