Changeset 766 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
27 Oct 2006, 16:35:27 (18 years ago)
Author:
joachim
Message:

added request_clearance

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

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py

    r753 r766  
    5151            info = context.getStudentInfo()
    5252            student = info['student']
    53             if info['review_state'] == "student_created":
    54                 student.content_status_modify(workflow_action="enter_application_pin")
     53            if info['review_state'] in ("student_created","admitted"):
     54                student.content_status_modify(workflow_action="enter_clearance_pin")
    5555                wftool.doActionFor(info['app'],'open',dest_container=info['app'])
    5656                da = {}
    5757                pin = request.get('pin')
     58                app_doc = info['app_doc']
    5859                da['app_ac_pin'] = pin
    5960                da['app_ac_date'] = current
    60                 info['app_doc'].edit(mapping = da)
     61                app_doc.edit(mapping = da)
     62                dc = {}
     63                dc['clr_ac_pin'] = pin
     64                dc['entry_date'] = current
     65                dc['session'] = "%s" % current.year()
     66                dc['lga'] = app_doc.jamb_lga
     67                info['clear_doc'].edit(mapping = dc)
    6168        elif "Manager" in member.getRoles():
    6269            pass
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py

    r750 r766  
    5959else:
    6060    info['acco'] = None
     61res = context.portal_catalog(container_path=student_path,
     62                             portal_type='StudentClearance')
     63if res:
     64    clear = res[0].getObject()
     65    info['clear'] = clear
     66    info['clear_doc'] = clear.getContent()
     67    info['clear_review_state'] = wf.getInfoFor(clear,'review_state',None)
     68else:
     69    info['clear'] = None
    6170
    6271items = []
    6372s_edit_links = {'StudentApplication': 'student_edit',
    6473              'StudentAccommodation': '',
     74              'StudentClearance': '',
    6575              'StudentPersonal': '',
    6676              }
    6777s_view_links = {'StudentApplication': None,
    6878              'StudentAccommodation': 'accommodation_view',
     79              'StudentClearance': None,
    6980              'StudentPersonal': None,
    7081              'StudentApplication': 'application_view',
  • WAeUP_SRP/trunk/skins/waeup_student/passport_entry_view.pt

    r711 r766  
    1818      <span tal:condition="info"
    1919            tal:define="review_state info/review_state">
    20         <h3>Upload your Passport Picture!</h3>
     20        <h3>Upload or Change your Passport Picture!</h3>
    2121        <br />
    2222        <span tal:omit-tag="" tal:replace="structure rendered_main"/>
  • WAeUP_SRP/trunk/skins/waeup_student/student_edit.py

    r710 r766  
    99# $Id$
    1010"""
    11 Called when a document form is posted.
    12 
    13 Validates data, then:
    14 
    15  - if there's no error, updates the object and redirects to it,
    16 
    17  - if there's an error, puts data in session and redirects to edit form.
    18 
    19 A form uid is propagated during the redirect to uniquely identify the
    20 form in the session.
    2111"""
    2212wftool = context.portal_workflow
    2313from urllib import urlencode
    2414from Products.CPSDocument.utils import getFormUidUrlArg
     15import DateTime
     16current = DateTime.DateTime()
    2517
    2618# Until ajax posts directly to its own script...
     
    3830app = info['app']
    3931app_doc = info['app_doc']
     32clear = info['clear']
     33clear_doc = info['clear_doc']
    4034state = context.getStudentInfo()['review_state']
    4135
     
    7771    else:
    7872        args = {}
    79         student.content_status_modify(workflow_action="apply_for_admission")
    80         wftool.doActionFor(app,'close',dest_container= app)
    81         psm = 'You applied for admission.'
    82         action = "/application_view"
     73        if info['review_state'] == "student_created":
     74            student.content_status_modify(workflow_action="apply_for_admission")
     75            wftool.doActionFor(app,'close',dest_container= app)
     76            psm = 'You applied for admission.'
     77            action = "/application_view"
     78        elif info['review_state'] == "clearance_pin_entered":
     79            student.content_status_modify(workflow_action="request_clearance")
     80            #wftool.doActionFor(info['clear'],'open',dest_container=info['clear'])
     81            da = {}
     82            pin = REQUEST.get('pin')
     83            da['app_ac_pin'] = pin
     84            da['app_ac_date'] = current
     85            app_doc = info['app_doc']
     86            app_doc.edit(mapping = da)
     87            dc = {}
     88            dc['email'] = app_doc.appl_email
     89            dc['mobil'] = app_doc.appl_mobile
     90            dc['passport'] = app_doc.passport
     91            info['clear_doc'].edit(mapping = dc)
     92            wftool.doActionFor(app,'close',dest_container= app)
     93            psm = 'You requested clearance.'
     94            action = "/clearance_view"
     95        else:
     96            psm = ''
     97            action = "/clearance_view"
     98           
    8399else:
    84100    is_valid, ds = app_doc.validate(request=REQUEST, proxy=context, cluster=cluster,
  • WAeUP_SRP/trunk/skins/waeup_student/student_index.py

    r765 r766  
    3232    if state == 'admission_applied':
    3333        return redirect("%s/application_view" % student.absolute_url())
    34     elif state == 'application_pin_entered':
     34    elif state in ('application_pin_entered','clearance_pin_entered'):
    3535        return redirect("%s/passport_entry_view" % student.absolute_url())
     36    elif state == 'request_clearance':
     37        return redirect("%s/student_view" % info['clear'].absolute_url())
    3638    elif context.portal_type == 'StudentStudyLevel':
    3739        return context.study_level_student_view()
    3840    return redirect("%s/student_view" % student.absolute_url())
    39 
    40 
Note: See TracChangeset for help on using the changeset viewer.