Changeset 1297 for WAeUP_SRP/trunk/skins
- Timestamp:
- 15 Jan 2007, 09:57:20 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_accommodation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_accommodation/acco_folder_view.pt
r913 r1297 35 35 <td tal:content="bt/total" /> 36 36 <td tal:content="bt/reserved" /> 37 <td tal:condition="bt/full|nothing"> 38 <strong>Fully booked</strong> 39 </td> 37 40 </tr> 38 41 </table> -
WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoFolderInfo.py
r1138 r1297 48 48 'total': total, 49 49 'reserved': free, 50 'full': free == total, 50 51 }) 51 52 bt_list.append({'name': "Total", -
WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py
r1269 r1297 19 19 20 20 request = context.REQUEST 21 #from Products.zdb import set_trace;set_trace()22 21 23 22 wf = context.portal_workflow … … 34 33 bt_list = [] 35 34 bt_names = context.getBedTypeNames() 36 reserved = pa.uniqueValuesFor('student') 35 all_booked = pa.uniqueValuesFor('student') 36 booked_list = [] 37 #from Products.zdb import set_trace;set_trace() 37 38 for bt in bed_types: 38 39 total = len(pa(bed_type=bt,hall=context.getId())) 39 40 if total <= 1: 40 41 continue 41 free = len(pa.searchResults({'bed_type': bt,42 'student': reserved,43 'hall': context.getId()}) )42 booked = pa.searchResults({'bed_type': bt, 43 'student':all_booked, 44 'hall': context.getId()}) 44 45 bt_list.append({'name': bt_names[bt], 45 46 'total': total, 46 'reserved': free,47 'reserved': len(booked), 47 48 }) 49 booked_list.extend(booked) 48 50 info['bed_types'] = bt_list 49 51 res_list = [] 50 52 students_url = "%s/campus/students" % (context.portal_url()) 51 if reserved: 52 for st in reserved: 53 if st: 54 res = pa(hall=context.getId(),student=st) 55 if not res: 56 continue 57 d = {} 58 d['student'] = st 59 d['student_url'] ='%s/%s' % (students_url,st) 60 bed = context.formatBed(res[0].bed).split('/') 61 d['bed'] = " / ".join(bed[1:]) 62 erg = context.students_catalog(id = st) 63 if erg: 64 sd = context.getFormattedStudentEntry(erg[0]) 65 d.update(sd) 66 res_list.append(d) 53 for sbrain in booked_list: 54 d = {} 55 st = sbrain.student 56 if not st: 57 continue 58 d['student'] = st 59 d['student_url'] ='%s/%s' % (students_url,st) 60 bed = context.formatBed(sbrain.bed).split('/') 61 d['bed'] = " / ".join(bed[1:]) 62 erg = context.students_catalog(id = st) 63 if erg: 64 sd = context.getFormattedStudentEntry(erg[0]) 65 d.update(sd) 66 res_list.append(d) 67 67 res_list.sort(cmp_bed) 68 68 info['reserved'] = res_list
Note: See TracChangeset for help on using the changeset viewer.