Ignore:
Timestamp:
24 Oct 2006, 16:32:10 (18 years ago)
Author:
joachim
Message:

added pay-hostel-maintainance fee

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

Legend:

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

    r741 r742  
    2828    if context.isManager() and 'students' in path_info:
    2929        student_id = path_info[path_info.index('students')+1]
    30 ##        if context.portal_type == 'Student':
    31 ##            student_id = context.getId()
    32 ##        elif context.aq_parent.portal_type == 'Student':
    33 ##            student_id = context.aq_parent.getId()
    34 ##        elif context.aq_parent.aq_parent.portal_type == 'Student':
    35 ##            student_id = context.aq_parent.aq_parent.getId()
    36 ##        elif context.aq_parent.aq_parent.aq_parent.portal_type == 'Student':
    37 ##            student_id = context.aq_parent.aq_parent.aq_parent.getId()
    38 ##        else:
    39 ##            student_id = member_id
    4030    else:
    41         student_id = member_id
     31        student_id = member_id 
    4232else:
    4333    student_id = student.getId()
    4434res = context.portal_catalog(id = student_id,portal_type='Student')
    45 if not res or len(res) > 1:
     35if not res:# or len(res) > 1:
    4636    return None
    4737brain = res[-1]
    4838student = brain.getObject()
    4939student_path = brain.getPath()
    50 info['review_state'] = wf.getInfoFor(student,'review_state','keiner')
     40info['review_state'] = wf.getInfoFor(student,'review_state',None)
    5141info['student'] = student
    5242info['id'] = student.getId()
     
    6656    info['acco'] = acco
    6757    info['acco_doc'] = acco.getContent()
     58    info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
    6859else:
    6960    info['acco'] = None
     
    9687        row['s_edit_link'] = "%s/%s" % (student.absolute_url(),se_link)
    9788    row['review_state'] = so.review_state
    98     row['display'] = so.review_state in ('opened','closed')
     89    row['display'] = so.review_state in ('opened','closed',) or so.portal_type == "StudentAccommodation"
    9990    items.append(row)
    10091info['items'] = items
     92request.set('student_id',student_id)
     93request.set('student_url',info['url'])
    10194return info
  • WAeUP_SRP/trunk/skins/waeup_student/layout_student_acco_edit.pt

    r741 r742  
    1 <tal:block define="global creation python:1;
     1<tal:block define="global creation python:0;
    22                   global formaction string:apply_admission" />
    33<!-- a layout_lib macro -->
  • WAeUP_SRP/trunk/skins/waeup_student/reserve_accommodation.py

    r701 r742  
    1111
    1212info = context.getStudentInfo()
    13 validate = REQUEST.has_key("cpsdocument_create_button")
     13validate = REQUEST.has_key("cpsdocument_create_button") or\
     14           REQUEST.has_key("cpsdocument_edit_button")
    1415
    1516lt = context.portal_layouts
     
    1920info = context.getStudentInfo()
    2021student = info['student']
    21 if info['acco']:
    22     return context.REQUEST.RESPONSE.redirect("%s/accommodation_view" % info['acco'].absolute_url())
    23 res,psm,ds = lt.renderLayout(layout_id= 'student_accommodation',
     22mode = 'create'
     23if info.has_key('acco') and info['acco']:
     24    if info['acco_review_state'] == "maintainance_fee_payed":
     25        return context.REQUEST.RESPONSE.redirect("%s/accommodation_view" % info['acco'].absolute_url())
     26    else:
     27        mode = 'edit'
     28d = {}
     29if mode == 'edit':
     30    info = context.getStudentInfo()
     31    d['acco_res_date'] = info['acco_doc'].acco_res_date
     32    d['acco_res_sc_pin'] = info['acco_doc'].acco_res_sc_pin
     33    d['bed'] = info['acco_doc'].bed
     34    d['session'] = info['acco_doc'].session
     35res,psm,ds = lt.renderLayout(layout_id= 'student_accommodation_fe',
    2436                      schema_id= 'student_accommodation',
    2537                      context=context,
    2638                      mapping=validate and REQUEST,
    27                       ob={},
    28                       layout_mode='create',
     39                      ob=d,
     40                      layout_mode=mode,
    2941                      formaction = "reserve_accommodation",
    3042                      button = "Book",
     
    4759elif psm == 'valid':
    4860    s_id = ds.get('s_id')
    49     pin = str(ds.get('acco_res_ac_pin'))
    50 
    51     pa = context.portal_accommodation
    52     code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
    53     if code < 0:
    54         return context.accommodation_pin_form(rendered = res,
     61    if mode == 'create':
     62        pin = str(ds.get('acco_res_sc_pin'))
     63        pa = context.portal_accommodation
     64        code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
     65        if code < 0:
     66            return context.accommodation_pin_form(rendered = res,
    5567                                 psm = bed,
    5668                                 firstlayout = True,
     
    5870                                 ds = ds,
    5971                                 )
    60 student.invokeFactory('StudentAccommodation',acco_id)
     72        student.invokeFactory('StudentAccommodation',acco_id)
     73        acco = getattr(student,acco_id)
     74        ds.set('acco_res_date', current)
     75        ds.set('bed', bed)
     76        ds.set('session', session)
     77        acco.getContent().edit(mapping=ds)
     78        #wftool.doActionFor(acco,'pay_maintainance_fee',dest_container=acco)
     79        return context.REQUEST.RESPONSE.redirect("%s/accommodation_view" % student.absolute_url())
     80pin = str(ds.get('acco_main_sc_pin'))
     81pp = context.portal_pins
    6182acco = getattr(student,acco_id)
    62 wftool.doActionFor(acco,'open',dest_container=acco)
    63 ds.set('acco_res_date', current)
    64 ds.set('bed', bed)
    65 ds.set('session', session)
     83ds.set('acco_maint_date', current)
    6684acco.getContent().edit(mapping=ds)
     85wftool.doActionFor(acco,'pay_maintainance_fee',dest_container=acco)
    6786return context.REQUEST.RESPONSE.redirect("%s/accommodation_view" % student.absolute_url())
     87
    6888##return context.accommodation_pin_form(rendered = res,
    6989##                                 psm = "successfully reserved bed %s" % bed,
  • WAeUP_SRP/trunk/skins/waeup_student/student_index.py

    r723 r742  
    3434    elif state == 'application_pin_entered':
    3535        return redirect("%s/passport_entry_view" % student.absolute_url())
     36    return redirect("%s/student_view" % student.absolute_url())
    3637
    3738
  • WAeUP_SRP/trunk/skins/waeup_student/widget_scratch_card_pin_render.pt

    r523 r742  
    11<tal:block define="mode options/mode;
    22                   id here/getWidgetId;
     3                   id_p string:${id}_p;
    34                   id_b string:${id}_b;
    45                   id_n string:${id}_n;
    5                    prefix options/prefix;
     6                   prefix options/datastructure/?id_p;
    67                   batch options/datastructure/?id_b;
    78                   nr options/datastructure/?id_n;
Note: See TracChangeset for help on using the changeset viewer.