Changeset 639 for WAeUP_SRP/trunk
- Timestamp:
- 10 Oct 2006, 13:48:43 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Students.py
r606 r639 456 456 ###) 457 457 458 class StudentAccommodation(CPSDocument): ###( 459 """ 460 WAeUP Student container for the various student data 461 """ 462 meta_type = 'StudentAccommodation' 463 portal_type = meta_type 464 security = ClassSecurityInfo() 465 466 security.declareProtected(View,"Title") 467 def Title(self): 468 """compose title""" 469 content = self.getContent() 470 #return "Accommodation Data for %s %s" % (content.firstname,content.lastname) 471 return "Accommodation Data for Session %s" % content.session 472 473 474 InitializeClass(StudentAccommodation) 475 476 def addStudentAccommodation(container, id, REQUEST=None, **kw): 477 """Add a Students personal data.""" 478 ob = StudentAccommodation(id, **kw) 479 return CPSBase_adder(container, ob, REQUEST=REQUEST) 480 481 ###) 482 458 483 class StudentPersonal(CPSDocument): ###( 459 484 """ -
WAeUP_SRP/trunk/__init__.py
r622 r639 42 42 ("StudentsFolder", 43 43 "Student", 44 "StudentAccommodation", 44 45 "StudentStudyCourse", 45 46 "StudentCourseResult", -
WAeUP_SRP/trunk/profiles/default/types/Student.xml
r542 r639 12 12 <property name="filter_content_types">True</property> 13 13 <property name="allowed_content_types"> 14 <element value="StudentAccommodation"/> 14 15 <element value="StudentDocuments"/> 15 16 <element value="StudentPersonal"/> -
WAeUP_SRP/trunk/profiles/default/workflows.xml
r622 r639 64 64 <bound-workflow workflow_id="waeup_student_wf"/> 65 65 </type> 66 <type type_id="StudentAccommodation"> 67 <bound-workflow workflow_id="waeup_student_subobject_wf"/> 68 </type> 66 69 <type type_id="StudentApplication"> 67 70 <bound-workflow workflow_id="waeup_student_subobject_wf"/> -
WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py
r636 r639 14 14 lt = context.portal_layouts 15 15 pr = context.portal_registration 16 16 session = current.year() 17 acco_id = 'Acco_%s' % session 18 info = context.getStudentInfo() 19 student = info['student'] 20 if info['acco']: 21 return student.hostal_reservation_slip() 17 22 res,psm,ds = lt.renderLayout(layout_id= 'student_acco_reserve', 18 23 schema_id= 'student_acco_reserve', … … 44 49 pa = context.portal_accommodation 45 50 code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status'))) 46 if code < 0:51 if code < -10: 47 52 return context.reserve_acco_form(rendered = res, 48 53 psm = bed, … … 51 56 ds = ds, 52 57 ) 53 else: 54 return context.reserve_acco_form(rendered = res, 58 student.invokeFactory('StudentAccommodation',acco_id) 59 acco = getattr(student,acco_id) 60 ds['acco_res_date'] = current 61 ds['bed'] = bed 62 ds['session'] = session 63 acco.getContent().edit(mapping=ds) 64 return student.hostal_reservation_slip() 65 return context.reserve_acco_form(rendered = res, 55 66 psm = "successfully reserved bed %s" % bed, 56 67 firstlayout = True, … … 59 70 ) 60 71 61 -
WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
r635 r639 23 23 info['is_manager'] = context.isManager 24 24 member_id = str(member) 25 if student is None: 26 students = getattr(context,'students',None) 27 if students is None: 28 students = getattr(context.campus,'students',None) 29 student = getattr(students,member_id,None) 30 if student is None: 31 return None 25 res = context.portal_catalog(portal_type='Student',id=member_id) 26 if not res: 27 return None 28 brain = res[0] 29 student = brain.getObject() 30 student_path = brain.getPath() 31 ##if student is None: 32 ## students = getattr(context,'students',None) 33 ## if students is None: 34 ## students = getattr(context.campus,'students',None) 35 ## student = getattr(students,member_id,None) 36 ## if student is None: 37 ## return None 32 38 info['review_state'] = wf.getInfoFor(student,'review_state','keiner') 33 39 #info['wf_state'] = 'keiner' … … 42 48 if info['per_doc'].sex: 43 49 info['sex'] = 'female' 50 res = context.portal_catalog(container_path=student_path, 51 portal_type='StudentAccommodation') 52 if res: 53 acco = res[0].getObject() 54 info['acco'] = acco 55 info['acco_doc'] = acco.getContent() 56 else: 57 info['acco'] = None 44 58 return info
Note: See TracChangeset for help on using the changeset viewer.