Changeset 821
- Timestamp:
- 9 Nov 2006, 21:37:29 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/University.py
r197 r821 1 1 from Globals import InitializeClass,HTMLFile 2 2 from AccessControl import ClassSecurityInfo 3 from Products.ZCatalog.ZCatalog import ZCatalog 3 4 4 5 from Products.CMFCore.utils import getToolByName … … 21 22 security = ClassSecurityInfo() 22 23 23 security.declarePublic('waeup_url') 24 def waeup_url(self): 25 """ return the base_url""" 26 return "%s/sections/waeup" % self.portal_url 27 return self.REQUEST 28 24 security.declarePublic('getHallTitle') 25 def getHallTitle(self,hall): 26 """get the Hall Title""" 27 res = ZCatalog.searchResults(self.portal_catalog,portal_type="AccoHall",id=hall) 28 if res and len(res) == 1: 29 return res[0].Title 30 return hall 31 29 32 InitializeClass(University) 30 33 -
WAeUP_SRP/trunk/skins/waeup_accommodation/formatBed.py
r805 r821 1 ## Script (Python) "students_indext" 2 ##bind container=container 3 ##bind context=context 4 ##bind namespace= 5 ##bind script=script 6 ##bind subpath=traverse_subpath 1 7 ##parameters=bed=None,mode=None,datastructure=None 8 ##title= 2 9 # $Id$ 3 10 """ … … 10 17 return '' 11 18 hall,block,room,letter = bed.split('_') 12 res = context.portal_catalog(portal_type="AccoHall",id=hall) 13 if res and len(res) == 1: 14 hall_title = res[0].Title 19 hall_title = context.restrictedTraverse("%s/campus/getHallTitle" % 20 (context.portal_url.getPortalPath()))(hall) 15 21 return " %s / Block %s / Room %s / Bed %s" % (hall_title,block,room,letter) -
WAeUP_SRP/trunk/skins/waeup_student/accommodation_pin_form.pt
r805 r821 2 2 portal_status_message options/psm; 3 3 data_storage options/ds; 4 jamb options/jamb/getContent|nothing;4 mode options/mode; 5 5 edition python:1;" 6 6 > … … 14 14 </metal:block> 15 15 <metal:block fill-slot="main"> 16 <h3>Book Your Accommodation! </h3> 16 <h3 tal:condition="python: mode == 'create'">Book Your Accommodation! </h3> 17 <h3 tal:condition="python: mode == 'edit'">Pay Your Accommodation Maintainance Fee! </h3> 17 18 <br /> 18 19 <div tal:replace="structure rendered_main" /> 19 20 <p>Instructions :</p> 20 <ul >21 <ul tal:condition="python: mode == 'create'"> 21 22 <li>Buy a Hostel Application Scratch Card.</li> 23 <li>Enter the PIN above.</li> 24 <li>Print the Hostel Allocation Slip.</li> 25 </ul> 26 <ul tal:condition="python: mode == 'edit'"> 27 <li>Buy a Hostel Maintainance Scratch Card.</li> 22 28 <li>Enter the PIN above.</li> 23 29 <li>Print the Hostel Allocation Slip.</li> -
WAeUP_SRP/trunk/skins/waeup_student/reserve_accommodation.py
r805 r821 11 11 12 12 info = context.getStudentInfo() 13 validate = REQUEST.has_key("cpsdocument_create_button") or\14 REQUEST.has_key("cpsdocument_edit_button")13 validate = REQUEST.has_key("cpsdocument_create_button") 14 # REQUEST.has_key("cpsdocument_edit_button") 15 15 16 16 lt = context.portal_layouts … … 22 22 mode = 'create' 23 23 if info.has_key('acco') and info['acco']: 24 validate = REQUEST.has_key("cpsdocument_edit_button") 24 25 if info['acco_review_state'] == "maintenance_fee_payed": 25 26 return context.REQUEST.RESPONSE.redirect("%s/accommodation_view" % info['acco'].absolute_url()) … … 27 28 mode = 'edit' 28 29 d = {} 30 button = "Bookaccommodation" 29 31 if mode == 'edit': 30 32 info = context.getStudentInfo() 31 33 d['acco_res_date'] = info['acco_doc'].acco_res_date 32 34 d['acco_res_sc_pin'] = info['acco_doc'].acco_res_sc_pin 35 d['student_status'] = info['acco_doc'].student_status 33 36 d['bed'] = info['acco_doc'].bed 34 37 d['session'] = info['acco_doc'].session 38 button = "Pay Maintainance Fee" 35 39 res,psm,ds = lt.renderLayout(layout_id= 'student_accommodation_fe', 36 40 schema_id= 'student_accommodation', … … 40 44 layout_mode=mode, 41 45 formaction = "reserve_accommodation", 42 button = "Book",46 button = button 43 47 ) 44 48 if psm == 'invalid': … … 46 50 psm = "Please correct your input.", 47 51 #psm = "%s, %s" % (psm,ds), 48 firstlayout = True, 49 lastlayout = True, 52 mode = mode, 50 53 ds = ds, 51 54 ) … … 53 56 return context.accommodation_pin_form(rendered = res, 54 57 psm = None, 55 firstlayout = True, 56 lastlayout = True, 58 mode = mode, 57 59 ds = ds, 58 60 ) … … 66 68 return context.accommodation_pin_form(rendered = res, 67 69 psm = bed, 68 firstlayout = True, 69 lastlayout = True, 70 mode = mode, 70 71 ds = ds, 71 72 ) … … 86 87 return context.REQUEST.RESPONSE.redirect("%s/accommodation_view" % student.absolute_url()) 87 88 88 ##return context.accommodation_pin_form(rendered = res,89 ## psm = "successfully reserved bed %s" % bed,90 ## firstlayout = True,91 ## lastlayout = True,92 ## ds = ds,93 ## )94 89
Note: See TracChangeset for help on using the changeset viewer.