Changeset 7145 for main/waeup.sirp/trunk/src/waeup/sirp/students
- Timestamp:
- 19 Nov 2011, 17:56:03 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7144 r7145 52 52 from waeup.sirp.students.vocabularies import StudyLevelSource 53 53 from waeup.sirp.students.utils import ( 54 get PaymentDetails, getAccommodationDetails, selectBed,55 render PDF, validatePassword)54 get_payment_details, get_accommodation_details, select_bed, 55 render_pdf, validatePassword) 56 56 from waeup.sirp.browser.resources import toggleall 57 57 from waeup.sirp.authentication import get_principal_role_manager … … 77 77 return 78 78 79 def emit LockMessage(view):79 def emit_lock_message(view): 80 80 view.flash('The requested form is locked (read-only).') 81 81 view.redirect(view.url(view.context)) … … 678 678 studentview = StudentBaseDisplayFormPage(self.context.getStudent(), 679 679 self.request) 680 return render PDF(self,'Course Registration', 'course_registration.pdf',680 return render_pdf(self,'Course Registration', 'course_registration.pdf', 681 681 self.context.getStudent, studentview) 682 682 … … 951 951 952 952 # To be sepezified in customization packages 953 def get PaymentDetails(self, category, student):954 return get PaymentDetails(category, student)953 def get_payment_details(self, category, student): 954 return get_payment_details(category, student) 955 955 956 956 @grok.action('Create ticket') … … 965 965 self.redirect(self.url(self.context)) 966 966 return 967 pay_details = self.get PaymentDetails(967 pay_details = self.get_payment_details( 968 968 p_category,student) 969 969 if pay_details['error']: … … 1119 1119 studentview = StudentBaseDisplayFormPage(self.context.getStudent(), 1120 1120 self.request) 1121 return render PDF(self,'Payment', 'payment_receipt.pdf',1121 return render_pdf(self,'Payment', 'payment_receipt.pdf', 1122 1122 self.context.getStudent, studentview) 1123 1123 … … 1229 1229 1230 1230 # To be sepezified in customization packages 1231 def get AccommodationDetails(self, student):1232 return get AccommodationDetails(student)1231 def get_accommodation_details(self, student): 1232 return get_accommodation_details(student) 1233 1233 1234 1234 # To be sepezified in customization packages 1235 def select Bed(self, available_beds):1236 return select Bed(available_beds)1235 def select_bed(self, available_beds): 1236 return select_bed(available_beds) 1237 1237 1238 1238 def update(self, SUBMIT=None): 1239 1239 student = self.context.getStudent() 1240 acc_details = self.get AccommodationDetails(student)1240 acc_details = self.get_accommodation_details(student) 1241 1241 if not student.state in acc_details['allowed_states']: 1242 1242 self.flash("You are in the wrong registration state.") … … 1275 1275 entry for entry in entries if entry.owner == NOT_OCCUPIED] 1276 1276 if available_beds: 1277 bed = self.select Bed(available_beds)1277 bed = self.select_bed(available_beds) 1278 1278 bed.bookBed(student.student_id) 1279 1279 else: … … 1356 1356 studentview = StudentBaseDisplayFormPage(self.context.getStudent(), 1357 1357 self.request) 1358 return render PDF(self,'Bed Allocation', 'bed_allocation.pdf',1358 return render_pdf(self,'Bed Allocation', 'bed_allocation.pdf', 1359 1359 self.context.getStudent, studentview) 1360 1360 … … 1376 1376 1377 1377 # To be sepezified in customization packages 1378 def get AccommodationDetails(self, student):1379 return get AccommodationDetails(student)1378 def get_accommodation_details(self, student): 1379 return get_accommodation_details(student) 1380 1380 1381 1381 # To be sepezified in customization packages 1382 def select Bed(self, available_beds):1383 return select Bed(available_beds)1382 def select_bed(self, available_beds): 1383 return select_bed(available_beds) 1384 1384 1385 1385 # Relocate student if student parameters have changed or the bed_type … … 1387 1387 def update(self): 1388 1388 student = self.context.getStudent() 1389 acc_details = self.get AccommodationDetails(student)1389 acc_details = self.get_accommodation_details(student) 1390 1390 if self.context.bed != None and \ 1391 1391 'reserved' in self.context.bed.bed_type: … … 1414 1414 entry for entry in entries if entry.owner == NOT_OCCUPIED] 1415 1415 if available_beds: 1416 new_bed = self.select Bed(available_beds)1416 new_bed = self.select_bed(available_beds) 1417 1417 new_bed.bookBed(student.student_id) 1418 1418 else: … … 1548 1548 def update(self): 1549 1549 if self.context.getStudent().state != 'admitted': 1550 emit LockMessage(self)1550 emit_lock_message(self) 1551 1551 return 1552 1552 super(StudentFilesUploadPage, self).update() … … 1662 1662 def update(self): 1663 1663 if self.context.clearance_locked: 1664 emit LockMessage(self)1664 emit_lock_message(self) 1665 1665 return 1666 1666 return super(StudentClearanceEditFormPage, self).update() … … 1819 1819 def update(self): 1820 1820 if self.context.getStudent().state != 'school fee paid': 1821 emit LockMessage(self)1821 emit_lock_message(self) 1822 1822 return 1823 1823 super(AddStudyLevelFormPage, self).update() -
main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py
r7144 r7145 41 41 # To be specified in customization packages, see also the view which 42 42 # calls the function. 43 def get PaymentDetails(category, student):43 def get_payment_details(category, student): 44 44 d = {} 45 45 d['p_item'] = u'' … … 63 63 d['amount'] = academic_session.clearance_fee 64 64 elif category == 'bed_allocation': 65 d['p_item'] = get AccommodationDetails(student)['bt']65 d['p_item'] = get_accommodation_details(student)['bt'] 66 66 d['amount'] = academic_session.booking_fee 67 67 return d … … 69 69 # To be specified in customization packages, see also the view which 70 70 # calls the function. 71 def get AccommodationDetails(student):71 def get_accommodation_details(student): 72 72 d = {} 73 73 d['error'] = u'' … … 99 99 # I the standard configuration we select the first bed found, 100 100 # but can also randomize the selection if we like. 101 def select Bed(available_beds):101 def select_bed(available_beds): 102 102 return available_beds[0] 103 103 … … 110 110 ) 111 111 112 def render StudentData(student, studentview):112 def render_student_data(student, studentview): 113 113 setUpWidgets(studentview, ignore_request=True) 114 114 data = [] … … 127 127 # To be specified in customization packages, see also view which 128 128 # calls the function. 129 def render PDF(view, subject='', filename='slip.pdf', student=None, studentview=None):129 def render_pdf(view, subject='', filename='slip.pdf', student=None, studentview=None): 130 130 # (0,0),(-1,-1) = whole table 131 131 # (0,0),(0,-1) = first column … … 156 156 if student: 157 157 story.append(Spacer(1, 18)) 158 studenttable = render StudentData(student, studentview)158 studenttable = render_student_data(student, studentview) 159 159 story.append(studenttable) 160 160 story.append(Spacer(1, 18))
Note: See TracChangeset for help on using the changeset viewer.