Changeset 785 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
6 Nov 2006, 14:22:15 (18 years ago)
Author:
joachim
Message:

check admission added,
several modifications to getStudentInfo,
request_clearance not yet implemented.

Location:
WAeUP_SRP/trunk/skins
Files:
6 added
5 edited
1 moved

Legend:

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

    r770 r785  
    6060                da['app_ac_date'] = current
    6161                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)
     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)
    6868        elif "Manager" in member.getRoles():
    6969            pass
  • WAeUP_SRP/trunk/skins/waeup_default/portlet_session_info.pt

    r774 r785  
    66  <tal:block condition="context/isStudent">
    77       <strong>
    8          <span tal:condition="info/is_student" tal:content="python:info['student_doc'].Title()" />
     8         <span tal:condition="info/is_student|nothing" tal:content="python:info['student_doc'].Title()" />
    99       </strong>
    1010  </tal:block>
  • WAeUP_SRP/trunk/skins/waeup_student/check_admission.py

    r782 r785  
    1212ti = context.portal_types[type_name]
    1313REQUEST.set('type_name',type_name)
    14 
     14redirect = REQUEST.RESPONSE.redirect
     15wf = context.portal_workflow
    1516validate = REQUEST.has_key("cpsdocument_create_button")
    1617
     
    2425                      ob={},
    2526                      layout_mode='create',
    26                       formaction = "request_clearance",
    27                       button = "Request Clearance",
     27                      formaction = "check_admission",
     28                      button = "Check Admission",
    2829                      )
    2930if psm == 'invalid':
    30     return context.clearance_pin_form(rendered = res,
     31    return context.check_admission_pin_form(rendered = res,
    3132                                 psm = "Please correct your input.",
    3233                                 #psm = "%s, %s" % (psm,ds),
     
    3637                                 )
    3738elif psm == '':
    38     return context.clearance_pin_form(rendered = res,
     39    return context.check_admission_pin_form(rendered = res,
    3940                                 psm = None,
    4041                                 firstlayout = True,
     
    4445elif psm == 'valid':
    4546    s_id = ds.get('s_id')
     47    student = getattr(context.campus.students, s_id)
     48    review_state = wf.getInfoFor(student,'review_state',None)
     49    if review_state == "finally_rejected":
     50        url = "%s/campus/students/%s/pume/finally_rejected_view" % (context.portal_url(),s_id)
     51        return redirect(url)
    4652    pin = str(ds.get('app_ac_pin'))
    47     return context.REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s"
     53    return redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s"
    4854          % (context.absolute_url(),s_id,pin.split('-')[2],pin))
    4955return
    50 
    51 
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py

    r770 r785  
    2828    if context.isManager() and 'students' in path_info:
    2929        student_id = path_info[path_info.index('students')+1]
     30    elif member_id == "Anonymous User":
     31        return None
    3032    else:
    3133        student_id = member_id
    3234else:
    3335    student_id = student.getId()
    34 res = context.portal_catalog(id = student_id,portal_type='Student')
    35 if not res:# or len(res) > 1:
     36student_path = "/srp/campus/students/%s" % student_id
     37student = context.restrictedTraverse(student_path,default=None)
     38if student is None or student.portal_type != 'Student':
    3639    return None
    37 brain = res[-1]
    38 student = brain.getObject()
    39 student_path = brain.getPath()
     40##res = context.portal_catalog(id = student_id,portal_type='Student')
     41##if not res:# or len(res) > 1:
     42##    return None
     43##brain = res[-1]
     44##student = brain.getObject()
    4045info['review_state'] = wf.getInfoFor(student,'review_state',None)
    4146info['student'] = student
     
    4752info['per'] = student.personal
    4853info['per_doc'] = student.personal.getContent()
     54course = getattr(student,'study_course',None)
     55info['course'] = course
     56if course:
     57    info['course_doc'] = student.study_course.getContent()
    4958info['sex'] = 'male'
    5059if info['per_doc'].sex:
    5160    info['sex'] = 'female'
    52 res = context.portal_catalog(container_path=student_path,
    53                              portal_type='StudentAccommodation')
    54 if res:
    55     acco = res[0].getObject()
    56     info['acco'] = acco
     61##res = context.portal_catalog(container_path=student_path,
     62##                             portal_type='StudentAccommodation')
     63##if res:
     64##    acco = res[0].getObject()
     65acco = getattr(student,'accommodation',None)
     66if acco.portal_type != "StudentAccomodation":
     67    acco = None
     68info['acco'] = acco
     69if acco is not None:
    5770    info['acco_doc'] = acco.getContent()
    5871    info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
    59 else:
    60     info['acco'] = None
    61 res = context.portal_catalog(container_path=student_path,
    62                              portal_type='StudentClearance')
    63 if res:
    64     clear = res[0].getObject()
    65     info['clear'] = clear
     72##res = context.portal_catalog(container_path=student_path,
     73##                             portal_type='StudentClearance')
     74##if res:
     75##    clear = res[0].getObject()
     76##    info['clear'] = clear
     77clear = getattr(student,'clearance',None)
     78info['clear'] = clear
     79if clear is not None:
    6680    info['clear_doc'] = clear.getContent()
    6781    info['clear_review_state'] = wf.getInfoFor(clear,'review_state',None)
    68 else:
    69     info['clear'] = None
    7082
    71 res = context.portal_catalog(container_path=student_path,
    72                              portal_type='StudentPume')
    73 if res:
    74     pume = res[0].getObject()
    75     info['pume'] = clear
     83##res = context.portal_catalog(container_path=student_path,
     84##                             portal_type='StudentPume')
     85##if res:
     86##    pume = res[0].getObject()
     87##    info['pume'] = clear
     88pume = getattr(student,'pume',None)
     89info['pume'] = pume
     90if pume is not None:
    7691    info['pume_doc'] = pume.getContent()
    7792    info['pume_review_state'] = wf.getInfoFor(pume,'review_state',None)
  • WAeUP_SRP/trunk/skins/waeup_student/portlet_student_workflow_display.pt

    r684 r785  
    1111                   
    1212                   
    13 <table class="registration">
     13<table class="registration" tal:condition="info|nothing">
    1414 
    1515  <span tal:condition="python:path('info/review_state')=='application_pin_entered'">
  • WAeUP_SRP/trunk/skins/waeup_student/student_index.py

    r770 r785  
    3232    if state == 'admission_applied':
    3333        return redirect("%s/application_view" % student.absolute_url())
    34     elif state in ('application_pin_entered','admitted'):
     34    elif state in ('application_pin_entered',):
    3535        return redirect("%s/application_edit" % student.absolute_url())
     36    elif state in ('admitted',):
     37        return redirect("%s/defer_view" % student.absolute_url())
    3638    elif state == 'clearance_pin_entered':
    3739        return redirect("%s/student_view" % info['clear'].absolute_url())
Note: See TracChangeset for help on using the changeset viewer.