Ignore:
Timestamp:
13 Feb 2007, 14:14:44 (18 years ago)
Author:
joachim
Message:

more documentation

M profiles/default/schemas/acco_hall.xml
M profiles/default/schemas/schema.xsl
M profiles/default/workflows/waeup_student_wf/definition.xml
M profiles/default/layouts/layout.xsl
M profiles/default/layouts/acco_bed_booking.xml
M profiles/default/layouts/acco_hall.xml
M profiles/default/types/Student.xml
M profiles/default/types/AccoFolder.xml
M profiles/default/types/AccoHall.xml
M doc/srp_documentation.mm

reserved bed functionallity,
pay hostel-fee for reserved bed

D skins/waeup_student/reserve_accommodation.py
M skins/waeup_accommodation/book_reserved_bed.py
A skins/waeup_accommodation/reserve_accommodation.py

Location:
WAeUP_SRP/trunk/skins/waeup_accommodation
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_accommodation/book_reserved_bed.py

    r1410 r1412  
    1616
    1717mode = 'create'
    18 validate = REQUEST.has_key("cpsdocument_edit_button")
     18validate = REQUEST.has_key("cpsdocument_edit_button") and\
     19           REQUEST.get("cpsdocument_edit_button").startswith('reserve')
    1920d = {}
    20 res,psm,ds = lt.renderLayout(layout_id= 'acco_bed_booking',
     21rendered,psm,ds = lt.renderLayout(layout_id= 'acco_bed_booking',
    2122                      schema_id= 'acco_bed_booking',
    2223                      context=context,
     
    2829if psm == 'invalid':
    2930    psm = "Please correct your input."
    30     return context.book_reserved_bed_form(rendered = res,
     31    return context.book_reserved_bed_form(rendered = rendered,
    3132                                 psm = psm,
    3233                                 #psm = "%s, %s" % (psm,ds),
     
    3738                                 )
    3839elif psm == '':
    39     return context.book_reserved_bed_form(rendered = res,
     40    return context.book_reserved_bed_form(rendered = rendered,
    4041                                 psm = psm,
    4142                                 mode = mode,
     
    4647elif psm == 'valid':
    4748    pass
     49#from Products.zdb import set_trace;set_trace()
    4850hall_id = context.getId()
    4951doc = context.getContent()
     
    6163        break
    6264    bed_brain = res[0]
     65    already = acco_cat(student=sid)
     66    if already:
     67        psm = "Student %s already reserved bed %s" % (sid, already[0].bed)
     68        break
    6369    if not bed_brain.bed_type.endswith("reserved"):
    6470        psm = "Not a reserved bed %s" % bid
     
    7278    break
    7379if psm != '':
    74     return context.book_reserved_bed_form(rendered = res,
     80    return context.book_reserved_bed_form(rendered = rendered,
    7581                                 psm = psm,
    7682                                 mode = mode,
     
    8086                                 )
    8187acco_cat.modifyRecord(bed = bid, student = sid)
    82 logger.info('"%s","booked reserved bed %s for","%s"' % (member,bed,sid))
    83 return context.book_reserved_bed_form(rendered = res,
     88logger.info('"%s","booked reserved bed %s for","%s"' % (member,bid,sid))
     89return context.book_reserved_bed_form(rendered = "",
    8490                                 psm = "Bed reserved for %s %s" % (sid,student.name),
    8591                                 mode = mode,
    8692                                 formaction = "book_reserved_bed",
    87                                  button = "reserve bed",
     93                                 button = "next reservation",
    8894                                 ds = ds,
    8995                                 )
  • WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_accommodation.py

    r1411 r1412  
    7777        pin = str(ds.get('acco_res_sc_pin'))
    7878        pa = context.portal_accommodation
    79         code,bed = pa.searchAndReserveBed(s_id,"%s" % (info['student_status']))
    80         #code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
    81         if code == -1:
    82             return context.accommodation_pin_edit_form(rendered = res,
    83                                  psm = "%s" % bed,
    84                                  mode = mode,
    85                                  ds = ds,
    86                                  )
    87         elif code == -2:
    88             return context.accommodation_pin_edit_form(rendered = res,
    89                                  psm = "No bed available. Your category is already fully booked.",
    90                                  mode = mode,
    91                                  ds = ds,
    92                                  )
     79        already = pa(student=s_id)
     80        if not already:
     81            code,bed = pa.searchAndReserveBed(s_id,"%s" % (info['student_status']))
     82            #code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
     83            if code == -1:
     84                return context.accommodation_pin_edit_form(rendered = res,
     85                                     psm = "%s" % bed,
     86                                     mode = mode,
     87                                     ds = ds,
     88                                     )
     89            elif code == -2:
     90                return context.accommodation_pin_edit_form(rendered = res,
     91                                     psm = "No bed available. Your category is already fully booked.",
     92                                     mode = mode,
     93                                     ds = ds,
     94                                     )
     95        else:
     96            bed = already[0].bed
    9397        student.invokeFactory('StudentAccommodation',acco_id)
    9498        acco = getattr(student,acco_id)
Note: See TracChangeset for help on using the changeset viewer.