Changeset 742 for WAeUP_SRP/trunk/skins/waeup_student
- Timestamp:
- 24 Oct 2006, 16:32:10 (18 years ago)
- 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 28 28 if context.isManager() and 'students' in path_info: 29 29 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_id40 30 else: 41 student_id = member_id 31 student_id = member_id 42 32 else: 43 33 student_id = student.getId() 44 34 res = context.portal_catalog(id = student_id,portal_type='Student') 45 if not res or len(res) > 1:35 if not res:# or len(res) > 1: 46 36 return None 47 37 brain = res[-1] 48 38 student = brain.getObject() 49 39 student_path = brain.getPath() 50 info['review_state'] = wf.getInfoFor(student,'review_state', 'keiner')40 info['review_state'] = wf.getInfoFor(student,'review_state',None) 51 41 info['student'] = student 52 42 info['id'] = student.getId() … … 66 56 info['acco'] = acco 67 57 info['acco_doc'] = acco.getContent() 58 info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None) 68 59 else: 69 60 info['acco'] = None … … 96 87 row['s_edit_link'] = "%s/%s" % (student.absolute_url(),se_link) 97 88 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" 99 90 items.append(row) 100 91 info['items'] = items 92 request.set('student_id',student_id) 93 request.set('student_url',info['url']) 101 94 return 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; 2 2 global formaction string:apply_admission" /> 3 3 <!-- a layout_lib macro --> -
WAeUP_SRP/trunk/skins/waeup_student/reserve_accommodation.py
r701 r742 11 11 12 12 info = context.getStudentInfo() 13 validate = REQUEST.has_key("cpsdocument_create_button") 13 validate = REQUEST.has_key("cpsdocument_create_button") or\ 14 REQUEST.has_key("cpsdocument_edit_button") 14 15 15 16 lt = context.portal_layouts … … 19 20 info = context.getStudentInfo() 20 21 student = 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', 22 mode = 'create' 23 if 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' 28 d = {} 29 if 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 35 res,psm,ds = lt.renderLayout(layout_id= 'student_accommodation_fe', 24 36 schema_id= 'student_accommodation', 25 37 context=context, 26 38 mapping=validate and REQUEST, 27 ob= {},28 layout_mode= 'create',39 ob=d, 40 layout_mode=mode, 29 41 formaction = "reserve_accommodation", 30 42 button = "Book", … … 47 59 elif psm == 'valid': 48 60 s_id = ds.get('s_id') 49 pin = str(ds.get('acco_res_ac_pin'))50 51 pa = context.portal_accommodation52 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, 55 67 psm = bed, 56 68 firstlayout = True, … … 58 70 ds = ds, 59 71 ) 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()) 80 pin = str(ds.get('acco_main_sc_pin')) 81 pp = context.portal_pins 61 82 acco = 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) 83 ds.set('acco_maint_date', current) 66 84 acco.getContent().edit(mapping=ds) 85 wftool.doActionFor(acco,'pay_maintainance_fee',dest_container=acco) 67 86 return context.REQUEST.RESPONSE.redirect("%s/accommodation_view" % student.absolute_url()) 87 68 88 ##return context.accommodation_pin_form(rendered = res, 69 89 ## psm = "successfully reserved bed %s" % bed, -
WAeUP_SRP/trunk/skins/waeup_student/student_index.py
r723 r742 34 34 elif state == 'application_pin_entered': 35 35 return redirect("%s/passport_entry_view" % student.absolute_url()) 36 return redirect("%s/student_view" % student.absolute_url()) 36 37 37 38 -
WAeUP_SRP/trunk/skins/waeup_student/widget_scratch_card_pin_render.pt
r523 r742 1 1 <tal:block define="mode options/mode; 2 2 id here/getWidgetId; 3 id_p string:${id}_p; 3 4 id_b string:${id}_b; 4 5 id_n string:${id}_n; 5 prefix options/ prefix;6 prefix options/datastructure/?id_p; 6 7 batch options/datastructure/?id_b; 7 8 nr options/datastructure/?id_n;
Note: See TracChangeset for help on using the changeset viewer.