Changeset 7819 for main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
- Timestamp:
- 8 Mar 2012, 22:28:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r7811 r7819 33 33 from waeup.kofa.accesscodes.workflow import USED 34 34 from waeup.kofa.browser import ( 35 K OFAPage, KOFAEditFormPage, KOFAAddFormPage, KOFADisplayFormPage,36 ContactAdminForm, K OFAForm)35 KofaPage, KofaEditFormPage, KofaAddFormPage, KofaDisplayFormPage, 36 ContactAdminForm, KofaForm) 37 37 from waeup.kofa.browser.interfaces import ICaptchaManager 38 38 from waeup.kofa.browser.breadcrumbs import Breadcrumb … … 40 40 from waeup.kofa.browser.layout import jsaction, action, UtilityView 41 41 from waeup.kofa.interfaces import ( 42 IK OFAObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm,43 IK OFAUtils, IUniversity)42 IKofaObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm, 43 IKofaUtils, IUniversity) 44 44 from waeup.kofa.interfaces import MessageFactory as _ 45 45 from waeup.kofa.widgets.datewidget import ( … … 155 155 @property 156 156 def title(self): 157 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE157 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 158 158 # There is no request attribute, thus we can only translate 159 159 # to the default (portal) language … … 161 161 target_language=portal_language) 162 162 163 class StudentsContainerPage(K OFAPage):163 class StudentsContainerPage(KofaPage): 164 164 """The standard view for student containers. 165 165 """ … … 194 194 return 195 195 196 class StudentsContainerManagePage(K OFAPage):196 class StudentsContainerManagePage(KofaPage): 197 197 """The manage page for student containers. 198 198 """ … … 245 245 return 246 246 247 class StudentAddFormPage(K OFAAddFormPage):247 class StudentAddFormPage(KofaAddFormPage): 248 248 """Add-form to add a student. 249 249 """ … … 265 265 return 266 266 267 class StudentBaseDisplayFormPage(K OFADisplayFormPage):267 class StudentBaseDisplayFormPage(KofaDisplayFormPage): 268 268 """ Page to display student base data 269 269 """ … … 310 310 usertype = getattr(self.request.principal, 311 311 'user_type', 'system').title() 312 kofa_utils = getUtility(IK OFAUtils)312 kofa_utils = getUtility(IKofaUtils) 313 313 success = kofa_utils.sendContactForm( 314 314 self.request.principal.title,email, … … 323 323 return 324 324 325 class StudentBaseManageFormPage(K OFAEditFormPage):325 class StudentBaseManageFormPage(KofaEditFormPage): 326 326 """ View to manage student base data 327 327 """ … … 388 388 return 389 389 390 class StudentClearanceDisplayFormPage(K OFADisplayFormPage):390 class StudentClearanceDisplayFormPage(KofaDisplayFormPage): 391 391 """ Page to display student clearance data 392 392 """ … … 415 415 @property 416 416 def title(self): 417 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE417 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 418 418 return translate(_('Clearance Data'), 'waeup.kofa', 419 419 target_language=portal_language) … … 421 421 @property 422 422 def label(self): 423 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE423 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 424 424 return translate(_('Clearance Slip of '), 425 425 'waeup.kofa', target_language=portal_language) \ … … 434 434 self.context.getStudent(), studentview) 435 435 436 class StudentClearanceManageFormPage(K OFAEditFormPage):436 class StudentClearanceManageFormPage(KofaEditFormPage): 437 437 """ Page to edit student clearance data 438 438 """ … … 508 508 return 509 509 510 class StudentPersonalDisplayFormPage(K OFADisplayFormPage):510 class StudentPersonalDisplayFormPage(KofaDisplayFormPage): 511 511 """ Page to display student personal data 512 512 """ … … 523 523 mapping = {'a':self.context.display_fullname}) 524 524 525 class StudentPersonalManageFormPage(K OFAEditFormPage):525 class StudentPersonalManageFormPage(KofaEditFormPage): 526 526 """ Page to edit student clearance data 527 527 """ … … 538 538 return 539 539 540 class StudyCourseDisplayFormPage(K OFADisplayFormPage):540 class StudyCourseDisplayFormPage(KofaDisplayFormPage): 541 541 """ Page to display the student study course data 542 542 """ … … 556 556 def current_mode(self): 557 557 if self.context.certificate is not None: 558 studymodes_dict = getUtility(IK OFAUtils).getStudyModesDict()558 studymodes_dict = getUtility(IKofaUtils).getStudyModesDict() 559 559 return studymodes_dict[self.context.certificate.study_mode] 560 560 return … … 572 572 return 573 573 574 class StudyCourseManageFormPage(K OFAEditFormPage):574 class StudyCourseManageFormPage(KofaEditFormPage): 575 575 """ Page to edit the student study course data 576 576 """ … … 645 645 return 646 646 647 class StudyLevelDisplayFormPage(K OFADisplayFormPage):647 class StudyLevelDisplayFormPage(KofaDisplayFormPage): 648 648 """ Page to display student study levels 649 649 """ … … 662 662 @property 663 663 def label(self): 664 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE664 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 665 665 lang = self.request.cookies.get('kofa.language', portal_language) 666 666 level_title = translate(self.context.level_title, 'waeup.kofa', … … 688 688 @property 689 689 def title(self): 690 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE690 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 691 691 return translate(_('Level Data'), 'waeup.kofa', 692 692 target_language=portal_language) … … 694 694 @property 695 695 def content_title(self): 696 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE696 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 697 697 return translate(_('Course List'), 'waeup.kofa', 698 698 target_language=portal_language) … … 700 700 @property 701 701 def label(self): 702 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE702 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 703 703 lang = self.request.cookies.get('kofa.language', portal_language) 704 704 level_title = translate(self.context.level_title, 'waeup.kofa', … … 709 709 710 710 def render(self): 711 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE711 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 712 712 Sem = translate(_('Sem.'), 'waeup.kofa', target_language=portal_language) 713 713 Code = translate(_('Code'), 'waeup.kofa', target_language=portal_language) … … 735 735 tabledata=tabledata) 736 736 737 class StudyLevelManageFormPage(K OFAEditFormPage):737 class StudyLevelManageFormPage(KofaEditFormPage): 738 738 """ Page to edit the student study level data 739 739 """ … … 762 762 @property 763 763 def label(self): 764 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE764 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 765 765 lang = self.request.cookies.get('kofa.language', portal_language) 766 766 level_title = translate(self.context.level_title, 'waeup.kofa', … … 853 853 return 854 854 855 class CourseTicketAddFormPage(K OFAAddFormPage):855 class CourseTicketAddFormPage(KofaAddFormPage): 856 856 """Add a course ticket. 857 857 """ … … 890 890 self.redirect(self.url(self.context)) 891 891 892 class CourseTicketDisplayFormPage(K OFADisplayFormPage):892 class CourseTicketDisplayFormPage(KofaDisplayFormPage): 893 893 """ Page to display course tickets 894 894 """ … … 906 906 'b':self.context.code}) 907 907 908 class CourseTicketManageFormPage(K OFAEditFormPage):908 class CourseTicketManageFormPage(KofaEditFormPage): 909 909 """ Page to manage course tickets 910 910 """ … … 925 925 return 926 926 927 class PaymentsManageFormPage(K OFAEditFormPage):927 class PaymentsManageFormPage(KofaEditFormPage): 928 928 """ Page to manage the student payments 929 929 … … 982 982 self.redirect(self.url(self.context, '@@addop')) 983 983 984 class OnlinePaymentAddFormPage(K OFAAddFormPage):984 class OnlinePaymentAddFormPage(KofaAddFormPage): 985 985 """ Page to add an online payment ticket 986 986 """ … … 1039 1039 return 1040 1040 1041 class OnlinePaymentDisplayFormPage(K OFADisplayFormPage):1041 class OnlinePaymentDisplayFormPage(KofaDisplayFormPage): 1042 1042 """ Page to view an online payment ticket 1043 1043 """ … … 1138 1138 1139 1139 1140 class AccommodationManageFormPage(K OFAEditFormPage):1140 class AccommodationManageFormPage(KofaEditFormPage): 1141 1141 """ Page to manage bed tickets. 1142 1142 … … 1195 1195 return self.actions 1196 1196 1197 class BedTicketAddPage(K OFAPage):1197 class BedTicketAddPage(KofaPage): 1198 1198 """ Page to add an online payment ticket 1199 1199 """ … … 1287 1287 'c':room_nr, 'd':bed_nr, 1288 1288 'e':bed.bed_type}) 1289 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE1289 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1290 1290 bedticket.bed_coordinates = translate( 1291 1291 bc, 'waeup.kofa',target_language=portal_language) … … 1297 1297 return 1298 1298 1299 class BedTicketDisplayFormPage(K OFADisplayFormPage):1299 class BedTicketDisplayFormPage(KofaDisplayFormPage): 1300 1300 """ Page to display bed tickets 1301 1301 """ … … 1325 1325 @property 1326 1326 def title(self): 1327 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE1327 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1328 1328 return translate(_('Bed Allocation Data'), 'waeup.kofa', 1329 1329 target_language=portal_language) … … 1331 1331 @property 1332 1332 def label(self): 1333 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE1333 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1334 1334 return translate(_('Bed Allocation: '), 1335 1335 'waeup.kofa', target_language=portal_language) \ … … 1405 1405 'c':room_nr, 'd':bed_nr, 1406 1406 'e':new_bed.bed_type}) 1407 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE1407 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1408 1408 self.context.bed_coordinates = translate( 1409 1409 bc, 'waeup.kofa',target_language=portal_language) … … 1416 1416 return 1417 1417 1418 class StudentHistoryPage(K OFAPage):1418 class StudentHistoryPage(KofaPage): 1419 1419 """ Page to display student clearance data 1420 1420 """ … … 1431 1431 # Pages for students only 1432 1432 1433 class StudentBaseEditFormPage(K OFAEditFormPage):1433 class StudentBaseEditFormPage(KofaEditFormPage): 1434 1434 """ View to edit student base data 1435 1435 """ … … 1447 1447 return 1448 1448 1449 class StudentChangePasswordPage(K OFAEditFormPage):1449 class StudentChangePasswordPage(KofaEditFormPage): 1450 1450 """ View to manage student base data 1451 1451 """ … … 1473 1473 return 1474 1474 1475 class StudentFilesUploadPage(K OFAPage):1475 class StudentFilesUploadPage(KofaPage): 1476 1476 """ View to upload files by student 1477 1477 """ … … 1490 1490 return 1491 1491 1492 class StartClearancePage(K OFAPage):1492 class StartClearancePage(KofaPage): 1493 1493 grok.context(IStudent) 1494 1494 grok.name('start_clearance') … … 1593 1593 return 1594 1594 1595 class RequestClearancePage(K OFAPage):1595 class RequestClearancePage(KofaPage): 1596 1596 grok.context(IStudent) 1597 1597 grok.name('request_clearance') … … 1624 1624 return 1625 1625 1626 class StartCourseRegistrationPage(K OFAPage):1626 class StartCourseRegistrationPage(KofaPage): 1627 1627 grok.context(IStudentStudyCourse) 1628 1628 grok.name('start_course_registration') … … 1673 1673 return 1674 1674 1675 class AddStudyLevelFormPage(K OFAEditFormPage):1675 class AddStudyLevelFormPage(KofaEditFormPage): 1676 1676 """ Page for students to add current study levels 1677 1677 """ … … 1710 1710 return 1711 1711 1712 class StudyLevelEditFormPage(K OFAEditFormPage):1712 class StudyLevelEditFormPage(KofaEditFormPage): 1713 1713 """ Page to edit the student study level data by students 1714 1714 """ … … 1732 1732 @property 1733 1733 def label(self): 1734 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE1734 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1735 1735 lang = self.request.cookies.get('kofa.language', portal_language) 1736 1736 level_title = translate(self.context.level_title, 'waeup.kofa', … … 1816 1816 return 1817 1817 1818 class ChangePasswordRequestPage(K OFAForm):1818 class ChangePasswordRequestPage(KofaForm): 1819 1819 """Captcha'd page for students to request a password change. 1820 1820 """ … … 1851 1851 student = list(results)[0] 1852 1852 # Change password 1853 kofa_utils = getUtility(IK OFAUtils)1853 kofa_utils = getUtility(IKofaUtils) 1854 1854 pwd = kofa_utils.genPassword() 1855 1855 IUserAccount(student).setPassword(pwd) … … 1866 1866 return 1867 1867 1868 class SetPasswordPage(K OFAPage):1869 grok.context(IK OFAObject)1868 class SetPasswordPage(KofaPage): 1869 grok.context(IKofaObject) 1870 1870 grok.name('setpassword') 1871 1871 grok.require('waeup.Anonymous')
Note: See TracChangeset for help on using the changeset viewer.