Changeset 635 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
10 Oct 2006, 08:23:10 (18 years ago)
Author:
joachim
Message:

halls can now be deleted, first steps for accommodation reservation

Location:
WAeUP_SRP/trunk/skins
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_view.pt

    r630 r635  
    9393                       % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
    9494                       />
    95                 <input type="submit" name="folder_delete:method" value="button_delete"
     95                <input type="submit" name="hall_delete:method" value="button_delete"
    9696                       class="destructive" i18n:attributes="value"
    9797                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
    9898                       (cpsmcat('description_confirm_delete'), )"
    9999                       />
    100                 <input tal:condition="python: context.portal_type not in ('Semester','Certificate')"
     100                <input tal:condition="python: 0 and context.portal_type not in ('Semester','Certificate')"
    101101                       type="submit" name="id_rename_form:method"
    102102                       class="context" value="Change Object ID" i18n:attributes="value"
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallsInfo.py

    r627 r635  
    2121info['is_manager'] = context.isManager()
    2222info['is_student'] = context.isStudent()
    23 info['action'] = "%s" % context.campus.absolute_url()
     23info['action'] = "%s" % context.absolute_url()
    2424info['choosen_ids'] = request.get('ids',[])
    2525items = []
     
    4949        if st:
    5050            res = pa(student=st)
    51             bt_list.append({'student': st, 'bed': res[0].bed })
     51            res_list.append({'student': st, 'bed': res[0].bed })
    5252info['reserved'] = res_list
    5353
  • WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py

    r629 r635  
    99pr = context.portal_registration
    1010
    11 
    12 type_name = 'StudentApplication'
    13 ti = context.portal_types[type_name]
    14 REQUEST.set('type_name',type_name)
    15 
     11info = context.getStudentInfo()
    1612validate = REQUEST.has_key("cpsdocument_create_button")
    1713
     
    2521                      ob={},
    2622                      layout_mode='create',
    27                       formaction = "acco_reserve",
     23                      formaction = "reserve_acco",
    2824                      button = "book Bed",
    2925                      )
    3026if psm == 'invalid':
    3127    return context.acco_reserve_form(rendered = res,
    32                                  psm = "Please correct your input.",
    33                                  #psm = "%s, %s" % (psm,ds),
     28                                 #psm = "Please correct your input.",
     29                                 psm = "%s, %s" % (psm,ds),
    3430                                 firstlayout = True,
    3531                                 lastlayout = True,
     
    4541elif psm == 'valid':
    4642    s_id = ds.get('s_id')
    47     pin = str(ds.get('app_ac_pin'))
    48     return context.REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s"
    49           % (context.absolute_url(),s_id,pin.split('-')[2],pin))
     43    pin = str(ds.get('acco_res_ac_pin'))
     44    pa = context.portal_accommodation
     45    code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
     46    if code < 0:
     47        return context.acco_reserve_form(rendered = res,
     48                                 psm = bed,
     49                                 firstlayout = True,
     50                                 lastlayout = True,
     51                                 ds = ds,
     52                                 )
     53    else:
     54        return context.acco_reserve_form(rendered = res,
     55                                 psm = "successfully reserved bed %s" % bed,
     56                                 firstlayout = True,
     57                                 lastlayout = True,
     58                                 ds = ds,
     59                                 )
    5060
    5161
    52 return
    53 
    54 
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py

    r603 r635  
    3939info['per'] = student.personal
    4040info['per_doc'] = student.personal.getContent()
     41info['sex'] = 'male'
     42if info['per_doc'].sex:
     43    info['sex'] = 'female'
    4144return info
  • WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt

    r537 r635  
    66  ds options/datastructure;
    77  dm ds/getDataModel;
    8   formaction formaction|string:student_edit;
     8  formaction options/formaction|string:student_edit;
    99  creation creation|nothing;
    1010  metadata metadata|nothing;
Note: See TracChangeset for help on using the changeset viewer.