Changeset 7811 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 8 Mar 2012, 19:00:51 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/__init__.py
r7592 r7811 2 2 """ 3 3 # Make this a package. 4 from waeup. sirp.students.student import (4 from waeup.kofa.students.student import ( 5 5 Student, StudentFactory 6 6 ) 7 from waeup. sirp.students.container import StudentsContainer8 from waeup. sirp.students.studycourse import StudentStudyCourse9 from waeup. sirp.students.payments import StudentPaymentsContainer10 from waeup. sirp.students.accommodation import StudentAccommodation11 from waeup. sirp.students.dynamicroles import StudentPrincipalRoleManager7 from waeup.kofa.students.container import StudentsContainer 8 from waeup.kofa.students.studycourse import StudentStudyCourse 9 from waeup.kofa.students.payments import StudentPaymentsContainer 10 from waeup.kofa.students.accommodation import StudentAccommodation 11 from waeup.kofa.students.dynamicroles import StudentPrincipalRoleManager 12 12 13 13 -
main/waeup.kofa/trunk/src/waeup/kofa/students/accommodation.py
r7599 r7811 23 23 from zope.component.interfaces import IFactory 24 24 from zope.interface import implementedBy 25 from waeup. sirp.interfaces import academic_sessions_vocab26 from waeup. sirp.students.interfaces import (25 from waeup.kofa.interfaces import academic_sessions_vocab 26 from waeup.kofa.students.interfaces import ( 27 27 IStudentAccommodation, IStudentNavigation, IBedTicket) 28 from waeup. sirp.utils.helpers import attrs_to_fields28 from waeup.kofa.utils.helpers import attrs_to_fields 29 29 30 30 class StudentAccommodation(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/students/authentication.py
r7592 r7811 28 28 from zope.publisher.interfaces.http import IHTTPRequest 29 29 from zope.session.interfaces import ISession 30 from waeup. sirp.authentication import (31 SIRPPrincipalInfo, get_principal_role_manager)32 from waeup. sirp.interfaces import (30 from waeup.kofa.authentication import ( 31 KOFAPrincipalInfo, get_principal_role_manager) 32 from waeup.kofa.interfaces import ( 33 33 IAuthPluginUtility, IUserAccount, IPasswordValidator) 34 from waeup. sirp.students.interfaces import IStudent34 from waeup.kofa.students.interfaces import IStudent 35 35 36 36 class StudentAccount(grok.Adapter): … … 135 135 if not account.checkPassword(credentials['password']): 136 136 return None 137 return SIRPPrincipalInfo(id=account.name,137 return KOFAPrincipalInfo(id=account.name, 138 138 title=account.title, 139 139 description=account.description, -
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r7656 r7811 32 32 from zope.catalog.interfaces import ICatalog 33 33 from hurry.workflow.interfaces import IWorkflowState 34 from waeup. sirp.interfaces import (34 from waeup.kofa.interfaces import ( 35 35 IBatchProcessor, FatalCSVError, IObjectConverter, IUserAccount, 36 36 IObjectHistory) 37 from waeup. sirp.students.interfaces import (37 from waeup.kofa.students.interfaces import ( 38 38 IStudent, IStudentStudyCourse, 39 39 IStudentUpdateByRegNo, IStudentUpdateByMatricNo, 40 40 IStudentStudyLevel, ICourseTicket, 41 41 IStudentOnlinePayment) 42 from waeup. sirp.students.workflow import IMPORTABLE_STATES43 from waeup. sirp.utils.batching import BatchProcessor42 from waeup.kofa.students.workflow import IMPORTABLE_STATES 43 from waeup.kofa.utils.batching import BatchProcessor 44 44 45 45 class StudentProcessor(BatchProcessor): -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r7745 r7811 29 29 from zope.formlib.textwidgets import BytesDisplayWidget 30 30 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 31 from waeup. sirp.accesscodes import (31 from waeup.kofa.accesscodes import ( 32 32 invalidate_accesscode, get_access_code, create_accesscode) 33 from waeup. sirp.accesscodes.workflow import USED34 from waeup. sirp.browser import (35 SIRPPage, SIRPEditFormPage, SIRPAddFormPage, SIRPDisplayFormPage,36 ContactAdminForm, SIRPForm)37 from waeup. sirp.browser.interfaces import ICaptchaManager38 from waeup. sirp.browser.breadcrumbs import Breadcrumb39 from waeup. sirp.browser.resources import datepicker, datatable, tabs, warning40 from waeup. sirp.browser.layout import jsaction, action, UtilityView41 from waeup. sirp.interfaces import (42 I SIRPObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm,43 I SIRPUtils, IUniversity)44 from waeup. sirp.interfaces import MessageFactory as _45 from waeup. sirp.widgets.datewidget import (33 from waeup.kofa.accesscodes.workflow import USED 34 from waeup.kofa.browser import ( 35 KOFAPage, KOFAEditFormPage, KOFAAddFormPage, KOFADisplayFormPage, 36 ContactAdminForm, KOFAForm) 37 from waeup.kofa.browser.interfaces import ICaptchaManager 38 from waeup.kofa.browser.breadcrumbs import Breadcrumb 39 from waeup.kofa.browser.resources import datepicker, datatable, tabs, warning 40 from waeup.kofa.browser.layout import jsaction, action, UtilityView 41 from waeup.kofa.interfaces import ( 42 IKOFAObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm, 43 IKOFAUtils, IUniversity) 44 from waeup.kofa.interfaces import MessageFactory as _ 45 from waeup.kofa.widgets.datewidget import ( 46 46 FriendlyDateWidget, FriendlyDateDisplayWidget, 47 47 FriendlyDatetimeDisplayWidget) 48 from waeup. sirp.students.interfaces import (48 from waeup.kofa.students.interfaces import ( 49 49 IStudentsContainer, IStudent, IStudentClearance, 50 50 IStudentPersonal, IStudentBase, IStudentStudyCourse, … … 53 53 IStudentOnlinePayment, IBedTicket, IStudentsUtils, IStudentChangePassword 54 54 ) 55 from waeup. sirp.students.catalog import search56 from waeup. sirp.students.workflow import (ADMITTED, PAID,55 from waeup.kofa.students.catalog import search 56 from waeup.kofa.students.workflow import (ADMITTED, PAID, 57 57 CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, VALIDATED) 58 from waeup. sirp.students.studylevel import StudentStudyLevel, CourseTicket59 from waeup. sirp.students.vocabularies import StudyLevelSource60 from waeup. sirp.browser.resources import toggleall61 from waeup. sirp.hostels.hostel import NOT_OCCUPIED62 from waeup. sirp.utils.helpers import get_current_principal58 from waeup.kofa.students.studylevel import StudentStudyLevel, CourseTicket 59 from waeup.kofa.students.vocabularies import StudyLevelSource 60 from waeup.kofa.browser.resources import toggleall 61 from waeup.kofa.hostels.hostel import NOT_OCCUPIED 62 from waeup.kofa.utils.helpers import get_current_principal 63 63 64 64 def write_log_message(view, message): 65 ob_class = view.__implemented__.__name__.replace('waeup. sirp.','')65 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','') 66 66 view.context.getStudent().loggerInfo(ob_class, message) 67 67 return … … 155 155 @property 156 156 def title(self): 157 portal_language = getUtility(I SIRPUtils).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 160 return translate(self.context.level_title, 'waeup. sirp',160 return translate(self.context.level_title, 'waeup.kofa', 161 161 target_language=portal_language) 162 162 163 class StudentsContainerPage( SIRPPage):163 class StudentsContainerPage(KOFAPage): 164 164 """The standard view for student containers. 165 165 """ … … 194 194 return 195 195 196 class StudentsContainerManagePage( SIRPPage):196 class StudentsContainerManagePage(KOFAPage): 197 197 """The manage page for student containers. 198 198 """ … … 245 245 return 246 246 247 class StudentAddFormPage( SIRPAddFormPage):247 class StudentAddFormPage(KOFAAddFormPage): 248 248 """Add-form to add a student. 249 249 """ … … 265 265 return 266 266 267 class StudentBaseDisplayFormPage( SIRPDisplayFormPage):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 sirp_utils = getUtility(ISIRPUtils)313 success = sirp_utils.sendContactForm(312 kofa_utils = getUtility(IKOFAUtils) 313 success = kofa_utils.sendContactForm( 314 314 self.request.principal.title,email, 315 315 self.context.display_fullname,self.context.email, … … 323 323 return 324 324 325 class StudentBaseManageFormPage( SIRPEditFormPage):325 class StudentBaseManageFormPage(KOFAEditFormPage): 326 326 """ View to manage student base data 327 327 """ … … 388 388 return 389 389 390 class StudentClearanceDisplayFormPage( SIRPDisplayFormPage):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(I SIRPUtils).PORTAL_LANGUAGE418 return translate(_('Clearance Data'), 'waeup. sirp',417 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 418 return translate(_('Clearance Data'), 'waeup.kofa', 419 419 target_language=portal_language) 420 420 421 421 @property 422 422 def label(self): 423 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE423 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 424 424 return translate(_('Clearance Slip of '), 425 'waeup. sirp', target_language=portal_language) \425 'waeup.kofa', target_language=portal_language) \ 426 426 + ' %s' % self.context.display_fullname 427 427 … … 434 434 self.context.getStudent(), studentview) 435 435 436 class StudentClearanceManageFormPage( SIRPEditFormPage):436 class StudentClearanceManageFormPage(KOFAEditFormPage): 437 437 """ Page to edit student clearance data 438 438 """ … … 508 508 return 509 509 510 class StudentPersonalDisplayFormPage( SIRPDisplayFormPage):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( SIRPEditFormPage):525 class StudentPersonalManageFormPage(KOFAEditFormPage): 526 526 """ Page to edit student clearance data 527 527 """ … … 538 538 return 539 539 540 class StudyCourseDisplayFormPage( SIRPDisplayFormPage):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(I SIRPUtils).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( SIRPEditFormPage):574 class StudyCourseManageFormPage(KOFAEditFormPage): 575 575 """ Page to edit the student study course data 576 576 """ … … 645 645 return 646 646 647 class StudyLevelDisplayFormPage( SIRPDisplayFormPage):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(I SIRPUtils).PORTAL_LANGUAGE665 lang = self.request.cookies.get(' sirp.language', portal_language)666 level_title = translate(self.context.level_title, 'waeup. sirp',664 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 665 lang = self.request.cookies.get('kofa.language', portal_language) 666 level_title = translate(self.context.level_title, 'waeup.kofa', 667 667 target_language=lang) 668 668 return _('${a}: Study Level ${b}', mapping = { … … 688 688 @property 689 689 def title(self): 690 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE691 return translate(_('Level Data'), 'waeup. sirp',690 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 691 return translate(_('Level Data'), 'waeup.kofa', 692 692 target_language=portal_language) 693 693 694 694 @property 695 695 def content_title(self): 696 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE697 return translate(_('Course List'), 'waeup. sirp',696 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 697 return translate(_('Course List'), 'waeup.kofa', 698 698 target_language=portal_language) 699 699 700 700 @property 701 701 def label(self): 702 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE703 lang = self.request.cookies.get(' sirp.language', portal_language)704 level_title = translate(self.context.level_title, 'waeup. sirp',702 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 703 lang = self.request.cookies.get('kofa.language', portal_language) 704 level_title = translate(self.context.level_title, 'waeup.kofa', 705 705 target_language=lang) 706 706 return translate(_('Course Registration Slip '), 707 'waeup. sirp', target_language=portal_language) \707 'waeup.kofa', target_language=portal_language) \ 708 708 + ' %s' % level_title 709 709 710 710 def render(self): 711 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE712 Sem = translate(_('Sem.'), 'waeup. sirp', target_language=portal_language)713 Code = translate(_('Code'), 'waeup. sirp', target_language=portal_language)714 Title = translate(_('Title'), 'waeup. sirp', target_language=portal_language)715 Dept = translate(_('Dept.'), 'waeup. sirp', target_language=portal_language)716 Faculty = translate(_('Faculty'), 'waeup. sirp', target_language=portal_language)717 Cred = translate(_('Cred.'), 'waeup. sirp', target_language=portal_language)718 Mand = translate(_('Mand.'), 'waeup. sirp', target_language=portal_language)719 Score = translate(_('Score'), 'waeup. sirp', target_language=portal_language)711 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 712 Sem = translate(_('Sem.'), 'waeup.kofa', target_language=portal_language) 713 Code = translate(_('Code'), 'waeup.kofa', target_language=portal_language) 714 Title = translate(_('Title'), 'waeup.kofa', target_language=portal_language) 715 Dept = translate(_('Dept.'), 'waeup.kofa', target_language=portal_language) 716 Faculty = translate(_('Faculty'), 'waeup.kofa', target_language=portal_language) 717 Cred = translate(_('Cred.'), 'waeup.kofa', target_language=portal_language) 718 Mand = translate(_('Mand.'), 'waeup.kofa', target_language=portal_language) 719 Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language) 720 720 studentview = StudentBaseDisplayFormPage(self.context.getStudent(), 721 721 self.request) … … 735 735 tabledata=tabledata) 736 736 737 class StudyLevelManageFormPage( SIRPEditFormPage):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(I SIRPUtils).PORTAL_LANGUAGE765 lang = self.request.cookies.get(' sirp.language', portal_language)766 level_title = translate(self.context.level_title, 'waeup. sirp',764 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 765 lang = self.request.cookies.get('kofa.language', portal_language) 766 level_title = translate(self.context.level_title, 'waeup.kofa', 767 767 target_language=lang) 768 768 return _('Manage study level ${a}', … … 853 853 return 854 854 855 class CourseTicketAddFormPage( SIRPAddFormPage):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( SIRPDisplayFormPage):892 class CourseTicketDisplayFormPage(KOFADisplayFormPage): 893 893 """ Page to display course tickets 894 894 """ … … 906 906 'b':self.context.code}) 907 907 908 class CourseTicketManageFormPage( SIRPEditFormPage):908 class CourseTicketManageFormPage(KOFAEditFormPage): 909 909 """ Page to manage course tickets 910 910 """ … … 925 925 return 926 926 927 class PaymentsManageFormPage( SIRPEditFormPage):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( SIRPAddFormPage):984 class OnlinePaymentAddFormPage(KOFAAddFormPage): 985 985 """ Page to add an online payment ticket 986 986 """ … … 1039 1039 return 1040 1040 1041 class OnlinePaymentDisplayFormPage( SIRPDisplayFormPage):1041 class OnlinePaymentDisplayFormPage(KOFADisplayFormPage): 1042 1042 """ Page to view an online payment ticket 1043 1043 """ … … 1138 1138 1139 1139 1140 class AccommodationManageFormPage( SIRPEditFormPage):1140 class AccommodationManageFormPage(KOFAEditFormPage): 1141 1141 """ Page to manage bed tickets. 1142 1142 … … 1195 1195 return self.actions 1196 1196 1197 class BedTicketAddPage( SIRPPage):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(I SIRPUtils).PORTAL_LANGUAGE1289 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 1290 1290 bedticket.bed_coordinates = translate( 1291 bc, 'waeup. sirp',target_language=portal_language)1291 bc, 'waeup.kofa',target_language=portal_language) 1292 1292 key = str(acc_details['booking_session']) 1293 1293 self.context[key] = bedticket … … 1297 1297 return 1298 1298 1299 class BedTicketDisplayFormPage( SIRPDisplayFormPage):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(I SIRPUtils).PORTAL_LANGUAGE1328 return translate(_('Bed Allocation Data'), 'waeup. sirp',1327 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 1328 return translate(_('Bed Allocation Data'), 'waeup.kofa', 1329 1329 target_language=portal_language) 1330 1330 1331 1331 @property 1332 1332 def label(self): 1333 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE1333 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 1334 1334 return translate(_('Bed Allocation: '), 1335 'waeup. sirp', target_language=portal_language) \1335 'waeup.kofa', target_language=portal_language) \ 1336 1336 + ' %s' % self.context.bed_coordinates 1337 1337 … … 1405 1405 'c':room_nr, 'd':bed_nr, 1406 1406 'e':new_bed.bed_type}) 1407 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE1407 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 1408 1408 self.context.bed_coordinates = translate( 1409 bc, 'waeup. sirp',target_language=portal_language)1409 bc, 'waeup.kofa',target_language=portal_language) 1410 1410 self.flash(_('Student relocated: ${a}', 1411 1411 mapping = {'a':self.context.bed_coordinates})) … … 1416 1416 return 1417 1417 1418 class StudentHistoryPage( SIRPPage):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( SIRPEditFormPage):1433 class StudentBaseEditFormPage(KOFAEditFormPage): 1434 1434 """ View to edit student base data 1435 1435 """ … … 1447 1447 return 1448 1448 1449 class StudentChangePasswordPage( SIRPEditFormPage):1449 class StudentChangePasswordPage(KOFAEditFormPage): 1450 1450 """ View to manage student base data 1451 1451 """ … … 1473 1473 return 1474 1474 1475 class StudentFilesUploadPage( SIRPPage):1475 class StudentFilesUploadPage(KOFAPage): 1476 1476 """ View to upload files by student 1477 1477 """ … … 1490 1490 return 1491 1491 1492 class StartClearancePage( SIRPPage):1492 class StartClearancePage(KOFAPage): 1493 1493 grok.context(IStudent) 1494 1494 grok.name('start_clearance') … … 1593 1593 return 1594 1594 1595 class RequestClearancePage( SIRPPage):1595 class RequestClearancePage(KOFAPage): 1596 1596 grok.context(IStudent) 1597 1597 grok.name('request_clearance') … … 1624 1624 return 1625 1625 1626 class StartCourseRegistrationPage( SIRPPage):1626 class StartCourseRegistrationPage(KOFAPage): 1627 1627 grok.context(IStudentStudyCourse) 1628 1628 grok.name('start_course_registration') … … 1673 1673 return 1674 1674 1675 class AddStudyLevelFormPage( SIRPEditFormPage):1675 class AddStudyLevelFormPage(KOFAEditFormPage): 1676 1676 """ Page for students to add current study levels 1677 1677 """ … … 1710 1710 return 1711 1711 1712 class StudyLevelEditFormPage( SIRPEditFormPage):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(I SIRPUtils).PORTAL_LANGUAGE1735 lang = self.request.cookies.get(' sirp.language', portal_language)1736 level_title = translate(self.context.level_title, 'waeup. sirp',1734 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 1735 lang = self.request.cookies.get('kofa.language', portal_language) 1736 level_title = translate(self.context.level_title, 'waeup.kofa', 1737 1737 target_language=lang) 1738 1738 return _('Add and remove course tickets of study level ${a}', … … 1816 1816 return 1817 1817 1818 class ChangePasswordRequestPage( SIRPForm):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 sirp_utils = getUtility(ISIRPUtils)1854 pwd = sirp_utils.genPassword()1853 kofa_utils = getUtility(IKOFAUtils) 1854 pwd = kofa_utils.genPassword() 1855 1855 IUserAccount(student).setPassword(pwd) 1856 1856 # Send email with new redentials 1857 1857 msg = _('You have successfully changed your password for the') 1858 1858 login_url = self.url(grok.getSite(), 'login') 1859 success = sirp_utils.sendCredentials(1859 success = kofa_utils.sendCredentials( 1860 1860 IUserAccount(student),pwd,login_url,msg) 1861 1861 if success: … … 1866 1866 return 1867 1867 1868 class SetPasswordPage( SIRPPage):1869 grok.context(I SIRPObject)1868 class SetPasswordPage(KOFAPage): 1869 grok.context(IKOFAObject) 1870 1870 grok.name('setpassword') 1871 1871 grok.require('waeup.Anonymous') -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/accommodationmanagepage.pt
r7735 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <table class="display dataTableManage"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/basemanagepage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/basepage.pt
r7735 r7811 1 <table i18n:domain="waeup. sirp" class="form-table">1 <table i18n:domain="waeup.kofa" class="form-table"> 2 2 <tbody> 3 3 <tal:block repeat="widget view/widgets"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/change_password.pt
r7735 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <input type="hidden" name="student_id" value="" -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/changepw.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <table class="form-table"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/clearanceeditpage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/containermanagepage.pt
r7735 r7811 1 <form method="POST" i18n:domain="waeup. sirp">1 <form method="POST" i18n:domain="waeup.kofa"> 2 2 <br /> 3 3 <input class="btn primary" type="submit" name="search" -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/containerpage.pt
r7735 r7811 1 <form method="POST" i18n:domain="waeup. sirp">1 <form method="POST" i18n:domain="waeup.kofa"> 2 2 <br /> 3 3 <input class="btn primary" type="submit" name="search" -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/courseticketmanagepage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <table class="form-table"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/courseticketpage.pt
r7735 r7811 1 <table class="form-table" i18n:domain="waeup. sirp">1 <table class="form-table" i18n:domain="waeup.kofa"> 2 2 <tbody> 3 3 <tr> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/enterpin.pt
r7735 r7811 1 <form method="POST" i18n:domain="waeup. sirp">1 <form method="POST" i18n:domain="waeup.kofa"> 2 2 <table class="form-table"> 3 3 <tbody> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/fileupload.pt
r7735 r7811 1 <tr i18n:domain="waeup. sirp">1 <tr i18n:domain="waeup.kofa"> 2 2 <td class="fieldname"> 3 3 <span tal:replace="viewlet/label">FILENAME</span>: -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/imageupload.pt
r7738 r7811 1 <tr i18n:domain="waeup. sirp">1 <tr i18n:domain="waeup.kofa"> 2 2 <td class="fieldname"> 3 3 <span tal:replace="viewlet/label">FILENAME</span>: -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/paymentsmanagepage.pt
r7741 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <table class="display dataTableManage"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/setpassword.pt
r7738 r7811 1 <form i18n:domain="waeup. sirp" method="POST">1 <form i18n:domain="waeup.kofa" method="POST"> 2 2 <table class="form-table"> 3 3 <tbody> … … 29 29 tal:attributes="value view/set_button" /> 30 30 </form> 31 <div i18n:domain="waeup. sirp" >31 <div i18n:domain="waeup.kofa" > 32 32 <h3 i18n:translate="">Instructions:</h3> 33 33 <ul class="list" i18n:translate=""> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studycoursemanagepage.pt
r7738 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studycoursepage.pt
r7738 r7811 1 <table class="form-table" i18n:domain="waeup. sirp">1 <table class="form-table" i18n:domain="waeup.kofa"> 2 2 <thead> 3 3 </thead> … … 50 50 </table> 51 51 52 <h3 i18n:domain="waeup. sirp" i18n:translate="">Study Levels (Course Lists)</h3>52 <h3 i18n:domain="waeup.kofa" i18n:translate="">Study Levels (Course Lists)</h3> 53 53 54 <table i18n:domain="waeup. sirp">54 <table i18n:domain="waeup.kofa"> 55 55 <thead> 56 56 <tr> … … 70 70 71 71 <div tal:condition="python: not len(context.keys())" 72 i18n:domain="waeup. sirp" i18n:translate="">72 i18n:domain="waeup.kofa" i18n:translate=""> 73 73 There are no levels registered yet. 74 74 </div> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studyleveladdpage.pt
r7738 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <p i18n:translate="">Text to explain course registration procedure.</p> … … 10 10 </span> 11 11 </div> 12 </form> 12 </form> 13 13 14 14 -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studyleveleditpage.pt
r7738 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <h3 i18n:translate=""> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studylevelmanagepage.pt
r7738 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studylevelpage.pt
r7741 r7811 1 <table class="form-table" i18n:domain="waeup. sirp">1 <table class="form-table" i18n:domain="waeup.kofa"> 2 2 <thead> 3 3 </thead> … … 26 26 </table> 27 27 28 <h3 i18n:domain="waeup. sirp" i18n:translate="">Course Tickets</h3>28 <h3 i18n:domain="waeup.kofa" i18n:translate="">Course Tickets</h3> 29 29 30 <table class="display dataTable" i18n:domain="waeup. sirp">30 <table class="display dataTable" i18n:domain="waeup.kofa"> 31 31 <thead> 32 32 <tr> … … 62 62 63 63 64 <div i18n:domain="waeup. sirp"64 <div i18n:domain="waeup.kofa" 65 65 tal:condition="python: not len(context.keys())" i18n:translate=""> 66 66 The're no tickets added yet. -
main/waeup.kofa/trunk/src/waeup/kofa/students/catalog.py
r7692 r7811 24 24 from zope.catalog.interfaces import ICatalog 25 25 from zope.component import queryUtility 26 from waeup. sirp.interfaces import (26 from waeup.kofa.interfaces import ( 27 27 IUniversity, IQueryResultItem, academic_sessions_vocab) 28 from waeup. sirp.students.interfaces import (IStudent, ICourseTicket,28 from waeup.kofa.students.interfaces import (IStudent, ICourseTicket, 29 29 IStudentOnlinePayment) 30 from waeup. sirp.university.vocabularies import course_levels30 from waeup.kofa.university.vocabularies import course_levels 31 31 32 32 class StudentIndexes(grok.Indexes): -
main/waeup.kofa/trunk/src/waeup/kofa/students/container.py
r7652 r7811 20 20 """ 21 21 import grok 22 from waeup. sirp.students.interfaces import (22 from waeup.kofa.students.interfaces import ( 23 23 IStudentsContainer, IStudent) 24 from waeup. sirp.utils.logger import Logger24 from waeup.kofa.utils.logger import Logger 25 25 26 26 class StudentsContainer(grok.Container, Logger): … … 46 46 return 47 47 48 logger_name = 'waeup. sirp.${sitename}.students'48 logger_name = 'waeup.kofa.${sitename}.students' 49 49 logger_filename = 'students.log' 50 50 -
main/waeup.kofa/trunk/src/waeup/kofa/students/dynamicroles.py
r7336 r7811 27 27 AnnotationPrincipalPermissionManager,) 28 28 from zope.securitypolicy.principalrole import AnnotationPrincipalRoleManager 29 from waeup. sirp.students.interfaces import IStudent29 from waeup.kofa.students.interfaces import IStudent 30 30 31 31 # All components in here have the same context: Student instances -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r7723 r7811 21 21 from zope import schema 22 22 from zc.sourcefactory.contextual import BasicContextualSourceFactory 23 from waeup. sirp.interfaces import (24 I SIRPObject, academic_sessions_vocab, validate_email, ISIRPUtils)25 from waeup. sirp.interfaces import MessageFactory as _26 from waeup. sirp.schema import TextLineChoice27 from waeup. sirp.university.vocabularies import CourseSource, StudyModeSource28 from waeup. sirp.students.vocabularies import (23 from waeup.kofa.interfaces import ( 24 IKOFAObject, academic_sessions_vocab, validate_email, IKOFAUtils) 25 from waeup.kofa.interfaces import MessageFactory as _ 26 from waeup.kofa.schema import TextLineChoice 27 from waeup.kofa.university.vocabularies import CourseSource, StudyModeSource 28 from waeup.kofa.students.vocabularies import ( 29 29 CertificateSource, StudyLevelSource, 30 30 contextual_reg_num_source, contextual_mat_num_source, 31 31 GenderSource, nats_vocab, 32 32 ) 33 from waeup. sirp.payments.interfaces import IPaymentsContainer, IOnlinePayment33 from waeup.kofa.payments.interfaces import IPaymentsContainer, IOnlinePayment 34 34 35 35 # VerdictSource can't be placed into the vocabularies module because it … … 78 78 """ 79 79 80 class IStudentsContainer(I SIRPObject):80 class IStudentsContainer(IKOFAObject): 81 81 """A students container contains university students. 82 82 … … 117 117 """ 118 118 119 class IStudentNavigation(I SIRPObject):119 class IStudentNavigation(IKOFAObject): 120 120 """Interface needed for student navigation. 121 121 … … 126 126 """ 127 127 128 class IStudentBase(I SIRPObject):128 class IStudentBase(IKOFAObject): 129 129 """Representation of student base data. 130 130 … … 206 206 ) 207 207 208 class IStudentClearance(I SIRPObject):208 class IStudentClearance(IKOFAObject): 209 209 """Representation of student clearance data. 210 210 … … 234 234 ) 235 235 236 class IStudentPersonal(I SIRPObject):236 class IStudentPersonal(IKOFAObject): 237 237 """Representation of student personal data. 238 238 … … 268 268 ) 269 269 270 class IStudentStudyCourse(I SIRPObject):270 class IStudentStudyCourse(IKOFAObject): 271 271 """A container for student study levels. 272 272 … … 326 326 ) 327 327 328 class IStudentStudyLevel(I SIRPObject):328 class IStudentStudyLevel(IKOFAObject): 329 329 """A container for course tickets. 330 330 … … 348 348 ) 349 349 350 class ICourseTicket(I SIRPObject):350 class ICourseTicket(IKOFAObject): 351 351 """A course ticket. 352 352 … … 406 406 ) 407 407 408 class IStudentAccommodation(I SIRPObject):408 class IStudentAccommodation(IKOFAObject): 409 409 """A container for student accommodation objects. 410 410 411 411 """ 412 412 413 class IBedTicket(I SIRPObject):413 class IBedTicket(IKOFAObject): 414 414 """A ticket for accommodation booking. 415 415 … … 475 475 'p_item'].order 476 476 477 class IStudentChangePassword(I SIRPObject):477 class IStudentChangePassword(IKOFAObject): 478 478 """Interface needed for change pasword page. 479 479 -
main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py
r7599 r7811 22 22 from zope.component.interfaces import IFactory 23 23 from zope.interface import implementedBy 24 from waeup. sirp.students.interfaces import (24 from waeup.kofa.students.interfaces import ( 25 25 IStudentPaymentsContainer, IStudentNavigation, IStudentOnlinePayment) 26 from waeup. sirp.payments import PaymentsContainer, OnlinePayment27 from waeup. sirp.utils.helpers import attrs_to_fields26 from waeup.kofa.payments import PaymentsContainer, OnlinePayment 27 from waeup.kofa.utils.helpers import attrs_to_fields 28 28 29 29 class StudentPaymentsContainer(PaymentsContainer): -
main/waeup.kofa/trunk/src/waeup/kofa/students/student.py
r7677 r7811 26 26 from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo 27 27 from zope.securitypolicy.interfaces import IPrincipalRoleManager 28 from waeup. sirp.interfaces import (28 from waeup.kofa.interfaces import ( 29 29 IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler, 30 I SIRPUtils, CLEARANCE, registration_states_vocab)31 from waeup. sirp.image import SIRPImageFile32 from waeup. sirp.imagestorage import DefaultFileStoreHandler33 from waeup. sirp.students.interfaces import IStudent, IStudentNavigation34 from waeup. sirp.students.studycourse import StudentStudyCourse35 from waeup. sirp.students.payments import StudentPaymentsContainer36 from waeup. sirp.students.accommodation import StudentAccommodation37 from waeup. sirp.utils.helpers import attrs_to_fields38 from waeup. sirp.students.utils import generate_student_id30 IKOFAUtils, CLEARANCE, registration_states_vocab) 31 from waeup.kofa.image import KOFAImageFile 32 from waeup.kofa.imagestorage import DefaultFileStoreHandler 33 from waeup.kofa.students.interfaces import IStudent, IStudentNavigation 34 from waeup.kofa.students.studycourse import StudentStudyCourse 35 from waeup.kofa.students.payments import StudentPaymentsContainer 36 from waeup.kofa.students.accommodation import StudentAccommodation 37 from waeup.kofa.utils.helpers import attrs_to_fields 38 from waeup.kofa.students.utils import generate_student_id 39 39 40 40 class Student(grok.Container): … … 63 63 def display_fullname(self): 64 64 middlename = getattr(self, 'middlename', None) 65 sirp_utils = getUtility(ISIRPUtils)66 return sirp_utils.fullname(self.firstname, self.lastname, middlename)65 kofa_utils = getUtility(IKOFAUtils) 66 return kofa_utils.fullname(self.firstname, self.lastname, middlename) 67 67 68 68 @property … … 204 204 205 205 This chooser is registered as an adapter providing 206 :class:`waeup. sirp.interfaces.IFileStoreNameChooser`.206 :class:`waeup.kofa.interfaces.IFileStoreNameChooser`. 207 207 208 208 File store name choosers like this one are only convenience … … 211 211 manually setting up filenames for students. 212 212 213 .. seealso:: :mod:`waeup. sirp.imagestorage`213 .. seealso:: :mod:`waeup.kofa.imagestorage` 214 214 215 215 """ … … 284 284 StudentFileStoreHandler, self).createFile( 285 285 store, root, filename, file_id, file) 286 return file, path, SIRPImageFile(286 return file, path, KOFAImageFile( 287 287 file_obj.filename, file_obj.data) -
main/waeup.kofa/trunk/src/waeup/kofa/students/studycourse.py
r7665 r7811 23 23 from zope.component.interfaces import IFactory 24 24 from zope.interface import implementedBy 25 from waeup. sirp.students.interfaces import (25 from waeup.kofa.students.interfaces import ( 26 26 IStudentStudyCourse, IStudentNavigation, IStudentStudyLevel) 27 from waeup. sirp.students.studylevel import CourseTicket28 from waeup. sirp.utils.helpers import attrs_to_fields27 from waeup.kofa.students.studylevel import CourseTicket 28 from waeup.kofa.utils.helpers import attrs_to_fields 29 29 30 30 class StudentStudyCourse(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r7633 r7811 22 22 import grok 23 23 from zope.component.interfaces import IFactory 24 from waeup. sirp.students.interfaces import (24 from waeup.kofa.students.interfaces import ( 25 25 IStudentStudyLevel, IStudentNavigation, ICourseTicket) 26 from waeup. sirp.utils.helpers import attrs_to_fields27 from waeup. sirp.students.vocabularies import StudyLevelSource26 from waeup.kofa.utils.helpers import attrs_to_fields 27 from waeup.kofa.students.vocabularies import StudyLevelSource 28 28 29 29 class StudentStudyLevel(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_authentication.py
r7364 r7811 26 26 from zope.securitypolicy.role import Role 27 27 from zope.securitypolicy.interfaces import IRole, Allow 28 from waeup. sirp.authentication import get_principal_role_manager29 from waeup. sirp.interfaces import IAuthPluginUtility, IUserAccount30 from waeup. sirp.students.authentication import (28 from waeup.kofa.authentication import get_principal_role_manager 29 from waeup.kofa.interfaces import IAuthPluginUtility, IUserAccount 30 from waeup.kofa.students.authentication import ( 31 31 StudentsAuthenticatorSetup, StudentAccount) 32 from waeup. sirp.students.tests.test_browser import StudentsFullSetup33 from waeup. sirp.testing import FunctionalLayer32 from waeup.kofa.students.tests.test_browser import StudentsFullSetup 33 from waeup.kofa.testing import FunctionalLayer 34 34 35 35 class StudentsAuthenticatorSetupTests(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r7665 r7811 28 28 from zope.interface.verify import verifyClass, verifyObject 29 29 30 from waeup. sirp.app import University31 from waeup. sirp.university.faculty import Faculty32 from waeup. sirp.university.department import Department33 from waeup. sirp.students.batching import (30 from waeup.kofa.app import University 31 from waeup.kofa.university.faculty import Faculty 32 from waeup.kofa.university.department import Department 33 from waeup.kofa.students.batching import ( 34 34 StudentProcessor, StudentStudyCourseProcessor, 35 35 StudentStudyLevelProcessor, CourseTicketProcessor, 36 36 StudentOnlinePaymentProcessor) 37 from waeup. sirp.students.student import Student38 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase39 from waeup. sirp.interfaces import IBatchProcessor37 from waeup.kofa.students.student import Student 38 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 39 from waeup.kofa.interfaces import IBatchProcessor 40 40 41 41 STUDENT_SAMPLE_DATA = open( -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r7723 r7811 33 33 from zope.testbrowser.testing import Browser 34 34 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 35 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase36 from waeup. sirp.app import University37 from waeup. sirp.configuration import SessionConfiguration38 from waeup. sirp.students.student import Student39 from waeup. sirp.students.studylevel import StudentStudyLevel40 from waeup. sirp.university.faculty import Faculty41 from waeup. sirp.university.department import Department42 from waeup. sirp.interfaces import IUserAccount43 from waeup. sirp.authentication import LocalRoleSetEvent44 from waeup. sirp.hostels.hostel import Hostel, Bed, NOT_OCCUPIED35 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 36 from waeup.kofa.app import University 37 from waeup.kofa.configuration import SessionConfiguration 38 from waeup.kofa.students.student import Student 39 from waeup.kofa.students.studylevel import StudentStudyLevel 40 from waeup.kofa.university.faculty import Faculty 41 from waeup.kofa.university.department import Department 42 from waeup.kofa.interfaces import IUserAccount 43 from waeup.kofa.authentication import LocalRoleSetEvent 44 from waeup.kofa.hostels.hostel import Hostel, Bed, NOT_OCCUPIED 45 45 46 46 PH_LEN = 2059 # Length of placeholder file -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_catalog.py
r7640 r7811 23 23 from zope.component import queryUtility, createObject 24 24 from zope.component.hooks import setSite 25 from waeup. sirp.app import University26 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase27 from waeup. sirp.students.student import Student28 from waeup. sirp.students.studylevel import StudentStudyLevel, CourseTicket29 from waeup. sirp.university.faculty import Faculty30 from waeup. sirp.university.department import Department25 from waeup.kofa.app import University 26 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 27 from waeup.kofa.students.student import Student 28 from waeup.kofa.students.studylevel import StudentStudyLevel, CourseTicket 29 from waeup.kofa.university.faculty import Faculty 30 from waeup.kofa.university.department import Department 31 31 32 32 class CatalogTestSetup(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_container.py
r7256 r7811 23 23 from zope.interface.verify import verifyClass, verifyObject 24 24 from zope.component.hooks import setSite, clearSite 25 from waeup. sirp.app import University26 from waeup. sirp.university.department import Department27 from waeup. sirp.students.interfaces import (25 from waeup.kofa.app import University 26 from waeup.kofa.university.department import Department 27 from waeup.kofa.students.interfaces import ( 28 28 IStudentsContainer, 29 29 ) 30 from waeup. sirp.students.container import (30 from waeup.kofa.students.container import ( 31 31 StudentsContainer, 32 32 ) 33 from waeup. sirp.testing import (33 from waeup.kofa.testing import ( 34 34 FunctionalLayer, FunctionalTestCase, remove_logger) 35 35 … … 39 39 40 40 def setUp(self): 41 remove_logger('waeup. sirp.app.students')41 remove_logger('waeup.kofa.app.students') 42 42 super(StudentsContainerTestCase, self).setUp() 43 43 # Setup a sample site for each test … … 86 86 logger = self.app['students'].logger 87 87 assert logger is not None 88 assert logger.name == 'waeup. sirp.app.students'88 assert logger.name == 'waeup.kofa.app.students' 89 89 handlers = logger.handlers 90 90 assert len(handlers) == 1 … … 100 100 logger = self.app['students'].logger 101 101 assert logger is not None 102 assert logger.name == 'waeup. sirp.app.students'102 assert logger.name == 'waeup.kofa.app.students' 103 103 handlers = logger.handlers 104 104 assert len(handlers) == 1 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_dynamicroles.py
r7257 r7811 24 24 from zope.securitypolicy.tests.test_annotationprincipalrolemanager import ( 25 25 Test as APRMTest, Manageable) 26 from waeup. sirp.testing import FunctionalLayer27 from waeup. sirp.students.tests.test_browser import StudentsFullSetup28 from waeup. sirp.students import Student, StudentPrincipalRoleManager26 from waeup.kofa.testing import FunctionalLayer 27 from waeup.kofa.students.tests.test_browser import StudentsFullSetup 28 from waeup.kofa.students import Student, StudentPrincipalRoleManager 29 29 30 30 class StudentPrincipalRoleManagerTests(APRMTest): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_payment.py
r7193 r7811 20 20 """ 21 21 22 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase23 from waeup. sirp.students.payments import (22 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 23 from waeup.kofa.students.payments import ( 24 24 StudentOnlinePayment, StudentOnlinePaymentFactory) 25 from waeup. sirp.payments.interfaces import IOnlinePayment26 from waeup. sirp.students.interfaces import IStudentNavigation25 from waeup.kofa.payments.interfaces import IOnlinePayment 26 from waeup.kofa.students.interfaces import IStudentNavigation 27 27 28 28 class StudentOnlinePaymentFactoryTest(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_student.py
r7364 r7811 20 20 from zope.component.interfaces import IFactory 21 21 from zope.interface import verify 22 from waeup. sirp.students.student import Student, StudentFactory23 from waeup. sirp.students.studycourse import StudentStudyCourse24 from waeup. sirp.students.studylevel import StudentStudyLevel, CourseTicket25 from waeup. sirp.students.payments import StudentPaymentsContainer26 from waeup. sirp.students.accommodation import StudentAccommodation, BedTicket27 from waeup. sirp.applicants.interfaces import IApplicantBaseData28 from waeup. sirp.students.interfaces import (22 from waeup.kofa.students.student import Student, StudentFactory 23 from waeup.kofa.students.studycourse import StudentStudyCourse 24 from waeup.kofa.students.studylevel import StudentStudyLevel, CourseTicket 25 from waeup.kofa.students.payments import StudentPaymentsContainer 26 from waeup.kofa.students.accommodation import StudentAccommodation, BedTicket 27 from waeup.kofa.applicants.interfaces import IApplicantBaseData 28 from waeup.kofa.students.interfaces import ( 29 29 IStudent, IStudentStudyCourse, IStudentPaymentsContainer, IStudentAccommodation, 30 30 IStudentStudyLevel, ICourseTicket, IBedTicket) 31 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase32 from waeup. sirp.university.department import Department31 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 32 from waeup.kofa.university.department import Department 33 33 34 34 class StudentTest(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_utils.py
r7510 r7811 1 1 # -*- coding: utf-8 -*- 2 2 import unittest 3 from waeup. sirp.students.utils import formatted_text3 from waeup.kofa.students.utils import formatted_text 4 4 5 5 class FormatterTests(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_vocabularies.py
r7691 r7811 17 17 ## 18 18 import unittest 19 from waeup. sirp.students.vocabularies import StudyLevelSource20 from waeup. sirp.university.certificate import Certificate19 from waeup.kofa.students.vocabularies import StudyLevelSource 20 from waeup.kofa.university.certificate import Certificate 21 21 22 22 -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r7804 r7811 35 35 from zope.component import getUtility 36 36 from zope.formlib.form import setUpEditWidgets 37 from waeup. sirp.interfaces import IExtFileStore, ISIRPUtils38 from waeup. sirp.interfaces import MessageFactory as _39 from waeup. sirp.students.interfaces import IStudentsUtils37 from waeup.kofa.interfaces import IExtFileStore, IKOFAUtils 38 from waeup.kofa.interfaces import MessageFactory as _ 39 from waeup.kofa.students.interfaces import IStudentsUtils 40 40 41 41 SLIP_STYLE = [ … … 108 108 studentview.context, attr='passport.jpg') 109 109 if img is None: 110 from waeup. sirp.browser import DEFAULT_PASSPORT_IMAGE_PATH110 from waeup.kofa.browser import DEFAULT_PASSPORT_IMAGE_PATH 111 111 img = open(DEFAULT_PASSPORT_IMAGE_PATH, 'rb') 112 112 doc_img = Image(img.name, width=4*cm, height=4*cm, kind='bound') 113 113 data_left.append([doc_img]) 114 114 #data.append([Spacer(1, 12)]) 115 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE115 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 116 116 for widget in studentview.widgets: 117 117 if widget.name == 'form.adm_code': 118 118 continue 119 119 f_label = formatted_label(size=12) % translate( 120 widget.label.strip(), 'waeup. sirp',120 widget.label.strip(), 'waeup.kofa', 121 121 target_language=portal_language) 122 122 f_label = Paragraph(f_label, style["Normal"]) … … 164 164 story = [] 165 165 frame_footer = Frame(1*cm,0,width-(2*cm),1*cm) 166 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE166 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 167 167 right_text = translate(_('<font size=10>${a} Page ${b} of ${c}</font>', 168 168 mapping = {'a':text, 'b':pdf.getPageNumber(), 'c':number_of_pages}), 169 'waeup. sirp', target_language=portal_language)169 'waeup.kofa', target_language=portal_language) 170 170 story.append(Paragraph(right_text, style["Right"])) 171 171 frame_footer.addFromList(story,pdf) … … 256 256 pdf.setAuthor('%s (%s)' % (view.request.principal.title, 257 257 view.request.principal.id)) 258 pdf.setCreator('WAeUP SIRP')258 pdf.setCreator('WAeUP KOFA') 259 259 width, height = A4 260 260 footer_text = view.label … … 275 275 frame_body = Frame(1*cm,1*cm,width-(2*cm),height-(3.5*cm)) 276 276 story.append(Paragraph(view.label, style["Heading2"])) 277 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE277 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 278 278 if student is not None: 279 279 #story.append(Spacer(1, 12)) 280 280 bd_translation = translate(_('Base Data'), 281 'waeup. sirp', target_language=portal_language)281 'waeup.kofa', target_language=portal_language) 282 282 story.append(Paragraph(bd_translation, style["Heading3"])) 283 283 studenttable = render_student_data(studentview) … … 288 288 set_up_widgets(view) 289 289 data = [] 290 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE290 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 291 291 for widget in view.widgets: 292 292 f_label = '<font size=12>%s</font>:' % translate( 293 widget.label.strip(), 'waeup. sirp',293 widget.label.strip(), 'waeup.kofa', 294 294 target_language=portal_language) 295 295 f_label = Paragraph(f_label, style["Normal"]) … … 302 302 # Import browser components locally 303 303 # to avoid circular import 304 from waeup. sirp.students.viewlets import FileManager305 from waeup. sirp.browser import DEFAULT_IMAGE_PATH304 from waeup.kofa.students.viewlets import FileManager 305 from waeup.kofa.browser import DEFAULT_IMAGE_PATH 306 306 data = [] 307 307 # Collect viewlets … … 309 309 fm.update() 310 310 if fm.viewlets: 311 sc_translation = translate(_('Scanned Documents'), 'waeup. sirp',311 sc_translation = translate(_('Scanned Documents'), 'waeup.kofa', 312 312 target_language=portal_language) 313 313 story.append(Paragraph(sc_translation, style["Heading3"])) … … 315 315 for viewlet in fm.viewlets: 316 316 f_label = formatted_label(size=12) % translate( 317 viewlet.label, 'waeup. sirp',317 viewlet.label, 'waeup.kofa', 318 318 target_language=portal_language) 319 319 f_label = Paragraph(f_label, style["Normal"]) -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r7741 r7811 21 21 from zope.interface import Interface 22 22 from zope.i18n import translate 23 from waeup. sirp.interfaces import (24 I SIRPObject, IExtFileStore, IFileStoreNameChooser, ISIRPUtils)25 from waeup. sirp.interfaces import MessageFactory as _26 from waeup. sirp.utils.helpers import string_from_bytes, file_size27 from waeup. sirp.browser import DEFAULT_IMAGE_PATH28 from waeup. sirp.browser.viewlets import (23 from waeup.kofa.interfaces import ( 24 IKOFAObject, IExtFileStore, IFileStoreNameChooser, IKOFAUtils) 25 from waeup.kofa.interfaces import MessageFactory as _ 26 from waeup.kofa.utils.helpers import string_from_bytes, file_size 27 from waeup.kofa.browser import DEFAULT_IMAGE_PATH 28 from waeup.kofa.browser.viewlets import ( 29 29 PrimaryNavTab, ManageActionButton, AddActionButton) 30 from waeup. sirp.browser.layout import default_primary_nav_template31 from waeup. sirp.students.workflow import (ADMITTED, PAID,30 from waeup.kofa.browser.layout import default_primary_nav_template 31 from waeup.kofa.students.workflow import (ADMITTED, PAID, 32 32 CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, VALIDATED) 33 from waeup. sirp.students.browser import (33 from waeup.kofa.students.browser import ( 34 34 StudentClearanceManageFormPage, 35 35 write_log_message, StudentBaseManageFormPage, … … 40 40 CourseTicketDisplayFormPage, OnlinePaymentDisplayFormPage, 41 41 AccommodationManageFormPage, BedTicketDisplayFormPage,) 42 from waeup. sirp.students.interfaces import (42 from waeup.kofa.students.interfaces import ( 43 43 IStudentsContainer, IStudent, IStudentClearance, 44 44 IStudentStudyCourse, IStudentAccommodation, IStudentStudyLevel, … … 46 46 ) 47 47 48 from waeup. sirp.interfaces import MessageFactory as _49 50 grok.context(I SIRPObject) # Make ISIRPObject the default context48 from waeup.kofa.interfaces import MessageFactory as _ 49 50 grok.context(IKOFAObject) # Make IKOFAObject the default context 51 51 grok.templatedir('browser_templates') 52 52 … … 63 63 grok.baseclass() 64 64 grok.viewletmanager(StudentManageSidebar) 65 grok.context(I SIRPObject)65 grok.context(IKOFAObject) 66 66 grok.view(Interface) 67 67 grok.order(5) … … 73 73 def render(self): 74 74 url = self.view.url(self.context.getStudent(), self.link) 75 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE76 lang = self.request.cookies.get(' sirp.language', portal_language)77 text = translate(self.text, 'waeup. sirp',75 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 76 lang = self.request.cookies.get('kofa.language', portal_language) 77 text = translate(self.text, 'waeup.kofa', 78 78 target_language=lang) 79 79 return u'<li><a href="%s">%s</a></li>' % ( … … 465 465 """ 466 466 467 grok.context(I SIRPObject)467 grok.context(IKOFAObject) 468 468 grok.order(4) 469 469 grok.require('waeup.viewStudentsTab') -
main/waeup.kofa/trunk/src/waeup/kofa/students/vocabularies.py
r7691 r7811 25 25 from zc.sourcefactory.basic import BasicSourceFactory 26 26 from zc.sourcefactory.contextual import BasicContextualSourceFactory 27 from waeup. sirp.interfaces import SimpleSIRPVocabulary28 from waeup. sirp.interfaces import MessageFactory as _29 from waeup. sirp.students.lgas import LGAS30 from waeup. sirp.students.nats import NATS31 from waeup. sirp.university.vocabularies import course_levels27 from waeup.kofa.interfaces import SimpleKOFAVocabulary 28 from waeup.kofa.interfaces import MessageFactory as _ 29 from waeup.kofa.students.lgas import LGAS 30 from waeup.kofa.students.nats import NATS 31 from waeup.kofa.university.vocabularies import course_levels 32 32 33 lgas_vocab = Simple SIRPVocabulary(33 lgas_vocab = SimpleKOFAVocabulary( 34 34 *sorted([(x[1],x[0]) for x in LGAS])) 35 35 36 nats_vocab = Simple SIRPVocabulary(36 nats_vocab = SimpleKOFAVocabulary( 37 37 *sorted([(x[1],x[0]) for x in NATS])) 38 38 -
main/waeup.kofa/trunk/src/waeup/kofa/students/workflow.py
r7690 r7811 5 5 from hurry.workflow.workflow import Transition, WorkflowState, NullCondition 6 6 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 7 from waeup. sirp.interfaces import (8 IObjectHistory, I SIRPWorkflowInfo, ISIRPUtils,7 from waeup.kofa.interfaces import ( 8 IObjectHistory, IKOFAWorkflowInfo, IKOFAUtils, 9 9 CREATED, ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING, 10 10 REGISTERED, VALIDATED) 11 from waeup. sirp.interfaces import MessageFactory as _12 from waeup. sirp.workflow import SIRPWorkflow, SIRPWorkflowInfo13 from waeup. sirp.students.interfaces import IStudent, IStudentsUtils11 from waeup.kofa.interfaces import MessageFactory as _ 12 from waeup.kofa.workflow import KOFAWorkflow, KOFAWorkflowInfo 13 from waeup.kofa.students.interfaces import IStudent, IStudentsUtils 14 14 15 15 … … 156 156 UNLOCK_CLEARANCE_TRANS = ('reset3', 'reset4', 'start_clearance') 157 157 158 registration_workflow = SIRPWorkflow(REGISTRATION_TRANSITIONS)158 registration_workflow = KOFAWorkflow(REGISTRATION_TRANSITIONS) 159 159 160 160 class RegistrationWorkflowState(WorkflowState, grok.Adapter): … … 167 167 state_id = 'wf.registration.id' 168 168 169 class RegistrationWorkflowInfo( SIRPWorkflowInfo, grok.Adapter):169 class RegistrationWorkflowInfo(KOFAWorkflowInfo, grok.Adapter): 170 170 """Adapter to adapt Student objects to workflow info objects. 171 171 """ 172 172 grok.context(IStudent) 173 grok.provides(I SIRPWorkflowInfo)173 grok.provides(IKOFAWorkflowInfo) 174 174 175 175 def __init__(self, context):
Note: See TracChangeset for help on using the changeset viewer.