Changeset 8736 for main/waeup.kofa/trunk/src
- Timestamp:
- 17 Jun 2012, 07:09:21 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/layout.py
r8548 r8736 282 282 """ 283 283 if IStudentNavigation.providedBy(self.context): 284 return self.context. getStudent().display_fullname284 return self.context.student.display_fullname 285 285 return 286 286 -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/staffsitelayout.pt
r8458 r8736 61 61 tal:condition="layout/getStudentName" class="wfstatus"> 62 62 <span i18n:translate="">Student Id:</span> 63 <span tal:replace="python:context. getStudent().student_id">63 <span tal:replace="python:context.student.student_id"> 64 64 ID 65 65 </span> 66 66 <span i18n:translate="">State:</span> 67 <span tal:replace="python:context. getStudent().translated_state">67 <span tal:replace="python:context.student.translated_state"> 68 68 STATE 69 69 </span> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/studentsitelayout.pt
r8458 r8736 64 64 tal:content="structure provider:breadcrumbs" /> 65 65 <span tal:condition="layout/getStudentName" class="wfstatus"> 66 <span tal:replace="python:context. getStudent().student_id">66 <span tal:replace="python:context.student.student_id"> 67 67 Id 68 68 </span> 69 69 | 70 <span tal:replace="python:context. getStudent().translated_state">70 <span tal:replace="python:context.student.translated_state"> 71 71 State 72 72 </span> -
main/waeup.kofa/trunk/src/waeup/kofa/students/accommodation.py
r8735 r8736 48 48 return 49 49 50 def getStudent(self): 50 @property 51 def student(self): 51 52 return self.__parent__ 52 53 … … 69 70 return 70 71 71 def getStudent(self): 72 return self.__parent__.__parent__ 72 @property 73 def student(self): 74 try: 75 return self.__parent__.__parent__ 76 except AttributeError: 77 return None 73 78 74 79 def writeLogMessage(self, view, message): -
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r8626 r8736 650 650 return 'Current session does not correspond.' 651 651 # Check if student is in state REGISTERED 652 if obj. getStudent().state != VALIDATED:652 if obj.student.state != VALIDATED: 653 653 return 'Student in wrong state.' 654 654 return None -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8735 r8736 431 431 432 432 def render(self): 433 studentview = StudentBaseDisplayFormPage(self.context. getStudent(),433 studentview = StudentBaseDisplayFormPage(self.context.student, 434 434 self.request) 435 435 students_utils = getUtility(IStudentsUtils) 436 436 return students_utils.renderPDF( 437 437 self, 'clearance.pdf', 438 self.context. getStudent(), studentview)438 self.context.student, studentview) 439 439 440 440 class StudentClearanceManageFormPage(KofaEditFormPage): … … 700 700 target_language=lang) 701 701 return _('${a}: Study Level ${b}', mapping = { 702 'a':self.context. getStudent().display_fullname,702 'a':self.context.student.display_fullname, 703 703 'b':level_title}) 704 704 … … 751 751 Mand = translate(_('Mand.'), 'waeup.kofa', target_language=portal_language) 752 752 Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language) 753 studentview = StudentBaseDisplayFormPage(self.context. getStudent(),753 studentview = StudentBaseDisplayFormPage(self.context.student, 754 754 self.request) 755 755 students_utils = getUtility(IStudentsUtils) … … 758 758 return students_utils.renderPDF( 759 759 self, 'course_registration.pdf', 760 self.context. getStudent(), studentview,760 self.context.student, studentview, 761 761 tableheader=[(Sem,'semester', 1.5),(Code,'code', 2.5), 762 762 (Title,'title', 5), … … 843 843 if str(self.context.__parent__.current_level) != self.context.__name__: 844 844 self.flash(_('This level does not correspond current level.')) 845 elif self.context. getStudent().state == REGISTERED:846 IWorkflowInfo(self.context. getStudent()).fireTransition(845 elif self.context.student.state == REGISTERED: 846 IWorkflowInfo(self.context.student).fireTransition( 847 847 'validate_courses') 848 848 self.flash(_('Course list has been validated.')) … … 867 867 self.redirect(self.url(self.context)) 868 868 return 869 elif self.context. getStudent().state == VALIDATED:870 IWorkflowInfo(self.context. getStudent()).fireTransition('reset8')869 elif self.context.student.state == VALIDATED: 870 IWorkflowInfo(self.context.student).fireTransition('reset8') 871 871 message = _('Course list request has been annulled.') 872 872 self.flash(message) 873 elif self.context. getStudent().state == REGISTERED:874 IWorkflowInfo(self.context. getStudent()).fireTransition('reset7')873 elif self.context.student.state == REGISTERED: 874 IWorkflowInfo(self.context.student).fireTransition('reset7') 875 875 message = _('Course list request has been rejected:') 876 876 self.flash(message) … … 880 880 return 881 881 args = {'subject':message} 882 self.redirect(self.url(self.context. getStudent()) +882 self.redirect(self.url(self.context.student) + 883 883 '/contactstudent?%s' % urlencode(args)) 884 884 return … … 938 938 def label(self): 939 939 return _('${a}: Course Ticket ${b}', mapping = { 940 'a':self.context. getStudent().display_fullname,940 'a':self.context.student.display_fullname, 941 941 'b':self.context.code}) 942 942 … … 1068 1068 def label(self): 1069 1069 return _('${a}: Online Payment Ticket ${b}', mapping = { 1070 'a':self.context. getStudent().display_fullname,1070 'a':self.context.student.display_fullname, 1071 1071 'b':self.context.p_id}) 1072 1072 … … 1129 1129 # self.redirect(self.url(self.context)) 1130 1130 # return 1131 studentview = StudentBaseDisplayFormPage(self.context. getStudent(),1131 studentview = StudentBaseDisplayFormPage(self.context.student, 1132 1132 self.request) 1133 1133 students_utils = getUtility(IStudentsUtils) 1134 1134 return students_utils.renderPDF(self, 'payment_slip.pdf', 1135 self.context. getStudent(), studentview, note=self.note)1135 self.context.student, studentview, note=self.note) 1136 1136 1137 1137 … … 1208 1208 1209 1209 def update(self, SUBMIT=None): 1210 student = self.context. getStudent()1210 student = self.context.student 1211 1211 students_utils = getUtility(IStudentsUtils) 1212 1212 acc_details = students_utils.getAccommodationDetails(student) … … 1285 1285 # expect an exception, but the owner might be different 1286 1286 if not invalidate_accesscode( 1287 pin,comment,self.context. getStudent().student_id):1287 pin,comment,self.context.student.student_id): 1288 1288 self.flash(_('You are not the owner of this access code.')) 1289 1289 return … … 1349 1349 1350 1350 def render(self): 1351 studentview = StudentBaseDisplayFormPage(self.context. getStudent(),1351 studentview = StudentBaseDisplayFormPage(self.context.student, 1352 1352 self.request) 1353 1353 students_utils = getUtility(IStudentsUtils) 1354 1354 return students_utils.renderPDF( 1355 1355 self, 'bed_allocation.pdf', 1356 self.context. getStudent(), studentview)1356 self.context.student, studentview) 1357 1357 1358 1358 class BedTicketRelocationPage(UtilityView, grok.View): … … 1366 1366 # of the bed has changed 1367 1367 def update(self): 1368 student = self.context. getStudent()1368 student = self.context.student 1369 1369 students_utils = getUtility(IStudentsUtils) 1370 1370 acc_details = students_utils.getAccommodationDetails(student) … … 1496 1496 1497 1497 def update(self): 1498 if self.context. getStudent().state != ADMITTED:1498 if self.context.student.state != ADMITTED: 1499 1499 emit_lock_message(self) 1500 1500 return … … 1676 1676 # expect an error, but the owner might be different 1677 1677 if not invalidate_accesscode( 1678 pin,comment,self.context. getStudent().student_id):1678 pin,comment,self.context.student.student_id): 1679 1679 self.flash(_('You are not the owner of this access code.')) 1680 1680 return 1681 if self.context. getStudent().state == CLEARED:1682 IWorkflowInfo(self.context. getStudent()).fireTransition(1681 if self.context.student.state == CLEARED: 1682 IWorkflowInfo(self.context.student).fireTransition( 1683 1683 'pay_first_school_fee') 1684 elif self.context. getStudent().state == RETURNING:1685 IWorkflowInfo(self.context. getStudent()).fireTransition(1684 elif self.context.student.state == RETURNING: 1685 IWorkflowInfo(self.context.student).fireTransition( 1686 1686 'pay_school_fee') 1687 elif self.context. getStudent().state == PAID:1688 IWorkflowInfo(self.context. getStudent()).fireTransition(1687 elif self.context.student.state == PAID: 1688 IWorkflowInfo(self.context.student).fireTransition( 1689 1689 'pay_pg_fee') 1690 1690 self.flash(_('Session started.')) … … 1710 1710 1711 1711 def update(self): 1712 if self.context. getStudent().state != PAID:1712 if self.context.student.state != PAID: 1713 1713 emit_lock_message(self) 1714 1714 return … … 1742 1742 1743 1743 def update(self): 1744 if self.context. getStudent().state != PAID:1744 if self.context.student.state != PAID: 1745 1745 emit_lock_message(self) 1746 1746 return … … 1799 1799 mapping = {'a':self.max_credits})) 1800 1800 return 1801 IWorkflowInfo(self.context. getStudent()).fireTransition(1801 IWorkflowInfo(self.context.student).fireTransition( 1802 1802 'register_courses') 1803 1803 self.flash(_('Course list has been registered.')) … … 1814 1814 1815 1815 def update(self): 1816 if self.context. getStudent().state != PAID:1816 if self.context.student.state != PAID: 1817 1817 emit_lock_message(self) 1818 1818 return … … 1823 1823 def addCourseTicket(self, **data): 1824 1824 # Safety belt 1825 if self.context. getStudent().state != PAID:1825 if self.context.student.state != PAID: 1826 1826 return 1827 1827 ticket = createObject(u'waeup.CourseTicket') -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r8576 r8736 146 146 value = value.code 147 147 if name == 'student_id' and context is not None: 148 student = context. getStudent()148 student = context.student 149 149 value = getattr(student, name, None) 150 150 return super( … … 181 181 """ 182 182 if name == 'student_id' and context is not None: 183 student = context. getStudent()183 student = context.student 184 184 value = getattr(student, name, None) 185 185 return super( … … 214 214 """ 215 215 if context is not None: 216 student = context. getStudent()216 student = context.student 217 217 if name == 'student_id' and student is not None: 218 218 value = getattr(student, name, None) … … 251 251 """ 252 252 if context is not None: 253 student = context. getStudent()253 student = context.student 254 254 if name in ['student_id'] and student is not None: 255 255 value = getattr(student, name, None) -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r8735 r8736 132 132 133 133 """ 134 def getStudent(): 135 """Return student object. 136 137 """ 134 student = Attribute('Student object of context.') 138 135 139 136 def writeLogMessage(view, message): -
main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py
r8735 r8736 40 40 return 41 41 42 def getStudent(self): 42 @property 43 def student(self): 43 44 return self.__parent__ 44 45 … … 58 59 return 59 60 60 def getStudent(self): 61 @property 62 def student(self): 61 63 try: 62 64 return self.__parent__.__parent__ … … 68 70 69 71 def _createActivationCodes(self): 70 student = self. getStudent()72 student = self.student 71 73 if self.p_category == 'clearance': 72 74 # Create CLR access code … … 132 134 def display_fullname(self): 133 135 "Name of payee." 134 return self.context. getStudent().display_fullname136 return self.context.student.display_fullname 135 137 136 138 @property 137 139 def id(self): 138 140 "Id of payee" 139 return self.context. getStudent().student_id141 return self.context.student.student_id 140 142 141 143 @property 142 144 def faculty(self): 143 145 "Faculty of payee" 144 return self.context. getStudent().faccode146 return self.context.student.faccode 145 147 146 148 @property 147 149 def department(self): 148 150 "Department of payee" 149 return self.context. getStudent().depcode151 return self.context.student.depcode 150 152 151 153 # Student online payments must be importable. So we might need a factory. -
main/waeup.kofa/trunk/src/waeup/kofa/students/student.py
r8735 r8736 96 96 return history 97 97 98 def getStudent(self): 98 @property 99 def student(self): 99 100 return self 100 101 -
main/waeup.kofa/trunk/src/waeup/kofa/students/studycourse.py
r8735 r8736 40 40 return 41 41 42 def getStudent(self): 42 @property 43 def student(self): 43 44 return self.__parent__ 44 45 … … 51 52 if certificate == None: 52 53 return False 53 if self. getStudent().state in (CLEARED, RETURNING):54 if self.student.state in (CLEARED, RETURNING): 54 55 return True 55 if self. getStudent().state == PAID \56 and self. getStudent().is_postgrad:56 if self.student.state == PAID \ 57 and self.student.is_postgrad: 57 58 return True 58 59 return False -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r8735 r8736 41 41 return 42 42 43 def getStudent(self): 44 return getattr(getattr(self, '__parent__', None), '__parent__', None) 43 @property 44 def student(self): 45 try: 46 return self.__parent__.__parent__ 47 except AttributeError: 48 return None 45 49 46 50 def writeLogMessage(self, view, message): … … 101 105 return 102 106 103 def getStudent(self): 107 @property 108 def student(self): 104 109 """Get the associated student object. 105 110 """ 106 # XXX: shouldn't that be an attribute?107 111 try: 108 112 return self.__parent__.__parent__.__parent__ -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r8735 r8736 74 74 75 75 def render(self): 76 url = self.view.url(self.context. getStudent(), self.link)76 url = self.view.url(self.context.student, self.link) 77 77 # Here we know that the cookie has been set 78 78 lang = self.request.cookies.get('kofa.language') … … 89 89 def render(self): 90 90 slip = getUtility(IExtFileStore).getFileByContext( 91 self.context. getStudent(), attr=self.link)91 self.context.student, attr=self.link) 92 92 if slip: 93 93 url = self.view.url(self.context,self.link) … … 266 266 @property 267 267 def target_url(self): 268 if self.context. getStudent().state != REGISTERED or \268 if self.context.student.state != REGISTERED or \ 269 269 str(self.context.__parent__.current_level) != self.context.__name__: 270 270 return '' … … 282 282 @property 283 283 def target_url(self): 284 if self.context. getStudent().state not in (VALIDATED, REGISTERED) or \284 if self.context.student.state not in (VALIDATED, REGISTERED) or \ 285 285 str(self.context.__parent__.current_level) != self.context.__name__: 286 286 return '' … … 456 456 @property 457 457 def target_url(self): 458 student = self.view.context. getStudent()458 student = self.view.context.student 459 459 condition1 = student.state != PAID 460 460 condition2 = str(student['studycourse'].current_level) in \ … … 474 474 @property 475 475 def target_url(self): 476 student = self.view.context. getStudent()476 student = self.view.context.student 477 477 condition1 = student.state != PAID 478 478 condition2 = student[ … … 545 545 '/students/%s' % self.request.principal.id) 546 546 #app_slip = getUtility(IExtFileStore).getFileByContext( 547 # self.context. getStudent(), 'application_slip')547 # self.context.student, 'application_slip') 548 548 targets = [] 549 549 #if app_slip: -
main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
r8735 r8736 693 693 # (applyData does this only for the context) 694 694 if 'certificate' in changed_fields: 695 notify(grok.ObjectModifiedEvent(view.context. getStudent()))695 notify(grok.ObjectModifiedEvent(view.context.student)) 696 696 fields_string = ' + '.join(changed_fields) 697 697 view.flash(_('Form has been saved.'))
Note: See TracChangeset for help on using the changeset viewer.