Changeset 7819 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 8 Mar 2012, 22:28:46 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
r7811 r7819 27 27 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 28 28 from waeup.kofa.app import University 29 from waeup.kofa.image import K OFAImageFile29 from waeup.kofa.image import KofaImageFile 30 30 from waeup.kofa.imagestorage import DefaultFileStoreHandler 31 31 from waeup.kofa.interfaces import ( 32 IObjectHistory, IFileStoreHandler, IFileStoreNameChooser, IK OFAUtils,32 IObjectHistory, IFileStoreHandler, IFileStoreNameChooser, IKofaUtils, 33 33 IExtFileStore, IPDF, IUserAccount) 34 34 from waeup.kofa.students.vocabularies import RegNumNotInSource … … 76 76 def display_fullname(self): 77 77 middlename = getattr(self, 'middlename', None) 78 kofa_utils = getUtility(IK OFAUtils)78 kofa_utils = getUtility(IKofaUtils) 79 79 return kofa_utils.fullname(self.firstname, self.lastname, middlename) 80 80 … … 291 291 ApplicantImageStoreHandler, self).createFile( 292 292 store, root, filename, file_id, file) 293 return file, path, K OFAImageFile(293 return file, path, KofaImageFile( 294 294 file_obj.filename, file_obj.data) 295 295 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r7811 r7819 35 35 from waeup.kofa.applicants.workflow import INITIALIZED, STARTED, PAID, SUBMITTED 36 36 from waeup.kofa.browser import ( 37 K OFAPage, KOFAEditFormPage, KOFAAddFormPage, KOFADisplayFormPage,37 KofaPage, KofaEditFormPage, KofaAddFormPage, KofaDisplayFormPage, 38 38 DEFAULT_PASSPORT_IMAGE_PATH) 39 39 from waeup.kofa.browser.interfaces import ICaptchaManager … … 44 44 from waeup.kofa.browser.resources import datepicker, tabs, datatable, warning 45 45 from waeup.kofa.interfaces import ( 46 IK OFAObject, ILocalRolesAssignable, IExtFileStore, IPDF,47 IFileStoreNameChooser, IPasswordValidator, IUserAccount, IK OFAUtils)46 IKofaObject, ILocalRolesAssignable, IExtFileStore, IPDF, 47 IFileStoreNameChooser, IPasswordValidator, IUserAccount, IKofaUtils) 48 48 from waeup.kofa.interfaces import MessageFactory as _ 49 49 from waeup.kofa.permissions import get_users_with_local_roles … … 56 56 from waeup.kofa.widgets.restwidget import ReSTDisplayWidget 57 57 58 grok.context(IK OFAObject) # Make IKOFAObject the default context59 60 class ApplicantsRootPage(K OFAPage):58 grok.context(IKofaObject) # Make IKofaObject the default context 59 60 class ApplicantsRootPage(KofaPage): 61 61 grok.context(IApplicantsRoot) 62 62 grok.name('index') … … 70 70 return 71 71 72 class ApplicantsRootManageFormPage(K OFAEditFormPage):72 class ApplicantsRootManageFormPage(KofaEditFormPage): 73 73 grok.context(IApplicantsRoot) 74 74 grok.name('manage') … … 141 141 return del_local_roles(self,3,**data) 142 142 143 class ApplicantsContainerAddFormPage(K OFAAddFormPage):143 class ApplicantsContainerAddFormPage(KofaAddFormPage): 144 144 grok.context(IApplicantsRoot) 145 145 grok.require('waeup.manageApplication') … … 215 215 return self.context.p_id 216 216 217 class ApplicantsContainerPage(K OFADisplayFormPage):217 class ApplicantsContainerPage(KofaDisplayFormPage): 218 218 """The standard view for regular applicant containers. 219 219 """ … … 232 232 @property 233 233 def introduction(self): 234 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE234 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 235 235 lang = self.request.cookies.get('kofa.language', portal_language) 236 236 html = self.context.description_dict.get(lang,'') … … 246 246 return "%s" % self.context.title 247 247 248 class ApplicantsContainerManageFormPage(K OFAEditFormPage):248 class ApplicantsContainerManageFormPage(KofaEditFormPage): 249 249 grok.context(IApplicantsContainer) 250 250 grok.name('manage') … … 349 349 return del_local_roles(self,3,**data) 350 350 351 class ApplicantAddFormPage(K OFAAddFormPage):351 class ApplicantAddFormPage(KofaAddFormPage): 352 352 """Add-form to add an applicant. 353 353 """ … … 372 372 return 373 373 374 class ApplicantDisplayFormPage(K OFADisplayFormPage):374 class ApplicantDisplayFormPage(KofaDisplayFormPage): 375 375 grok.context(IApplicant) 376 376 grok.name('index') … … 484 484 485 485 486 class OnlinePaymentDisplayFormPage(K OFADisplayFormPage):486 class OnlinePaymentDisplayFormPage(KofaDisplayFormPage): 487 487 """ Page to view an online payment ticket 488 488 """ … … 547 547 @property 548 548 def title(self): 549 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE549 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 550 550 return translate(_('Payment Data'), 'waeup.kofa', 551 551 target_language=portal_language) … … 553 553 @property 554 554 def label(self): 555 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE555 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 556 556 return translate(_('Online Payment Receipt'), 557 557 'waeup.kofa', target_language=portal_language) \ … … 582 582 #@property 583 583 #def label(self): 584 # portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE584 # portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 585 585 # container_title = self.context.__parent__.title 586 586 # label = translate('Application Record', … … 638 638 return True 639 639 640 class ApplicantManageFormPage(K OFAEditFormPage):640 class ApplicantManageFormPage(KofaEditFormPage): 641 641 """A full edit view for applicant data. 642 642 """ … … 883 883 return image 884 884 885 class ApplicantRegistrationPage(K OFAAddFormPage):885 class ApplicantRegistrationPage(KofaAddFormPage): 886 886 """Captcha'd registration page for applicants. 887 887 """ … … 926 926 self.applyData(applicant, **data) 927 927 self.context.addApplicant(applicant) 928 kofa_utils = getUtility(IK OFAUtils)928 kofa_utils = getUtility(IKofaUtils) 929 929 password = kofa_utils.genPassword() 930 930 IUserAccount(applicant).setPassword(password) … … 941 941 return 942 942 943 class ApplicantRegistrationEmailSent(K OFAPage):943 class ApplicantRegistrationEmailSent(KofaPage): 944 944 """Landing page after successful registration. 945 945 """ -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r7811 r7819 29 29 from waeup.kofa.schema import TextLineChoice 30 30 from waeup.kofa.interfaces import ( 31 IK OFAObject, year_range, validate_email, academic_sessions_vocab)31 IKofaObject, year_range, validate_email, academic_sessions_vocab) 32 32 from waeup.kofa.interfaces import MessageFactory as _ 33 33 from waeup.kofa.payments.interfaces import IOnlinePayment … … 178 178 pass 179 179 180 class IApplicantsRoot(IK OFAObject, IContainer):180 class IApplicantsRoot(IKofaObject, IContainer): 181 181 """A container for university applicants containers. 182 182 """ 183 183 pass 184 184 185 class IApplicantsContainer(IK OFAObject):185 class IApplicantsContainer(IKofaObject): 186 186 """An applicants container contains university applicants. 187 187 … … 352 352 'provider'].order = IApplicantsContainer['provider'].order 353 353 354 class IApplicantBaseData(IK OFAObject):354 class IApplicantBaseData(IKofaObject): 355 355 """The data for an applicant. 356 356 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/pdf.py
r7811 r7819 34 34 from waeup.kofa.applicants.interfaces import IApplicant 35 35 from waeup.kofa.browser import DEFAULT_PASSPORT_IMAGE_PATH 36 from waeup.kofa.interfaces import IExtFileStore, IPDF, IK OFAUtils36 from waeup.kofa.interfaces import IExtFileStore, IPDF, IKofaUtils 37 37 from waeup.kofa.interfaces import MessageFactory as _ 38 38 … … 54 54 def title(self): 55 55 container_title = self.context.__parent__.title 56 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE56 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 57 57 ar_translation = translate(_('Application Record'), 58 58 'waeup.kofa', target_language=portal_language) … … 107 107 if dept is None: 108 108 return data 109 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE109 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 110 110 dp_translation = translate(_('Department:'), 111 111 'waeup.kofa', target_language=portal_language) … … 145 145 pdf.setAuthor('%s (%s)' % (view.request.principal.title, 146 146 view.request.principal.id)) 147 pdf.setCreator('K OFA')147 pdf.setCreator('Kofa') 148 148 width, height = A4 149 149 style = getSampleStyleSheet() … … 171 171 # Render widget fields 172 172 widgets = self._setUpWidgets() 173 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE173 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 174 174 for widget in widgets: # self.widgets: 175 175 f_label = '<font size=12>%s</font>:' % translate( -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/root.py
r7811 r7819 23 23 from hurry.query.interfaces import IQuery 24 24 from zope.component import getUtility 25 from waeup.kofa.interfaces import IK OFAPluggable25 from waeup.kofa.interfaces import IKofaPluggable 26 26 from waeup.kofa.applicants.interfaces import IApplicantsRoot 27 27 from waeup.kofa.utils.logger import Logger … … 46 46 47 47 class ApplicantsPlugin(grok.GlobalUtility): 48 """A K OFAPlugin that creates an applicants root in portal.48 """A KofaPlugin that creates an applicants root in portal. 49 49 50 50 This plugin should be called by a typical … … 53 53 the main site configuration. 54 54 55 Implements :class:`waeup.kofa.interfaces.IK OFAPluggable`55 Implements :class:`waeup.kofa.interfaces.IKofaPluggable` 56 56 """ 57 57 grok.name('applicants') 58 grok.implements(IK OFAPluggable)58 grok.implements(IKofaPluggable) 59 59 log_prefix = 'ApplicantsPlugin' 60 60 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicant.py
r7811 r7819 26 26 from zope.interface import verify, implements 27 27 from zope.location.interfaces import ILocation 28 from waeup.kofa.image.interfaces import IK OFAImageFile28 from waeup.kofa.image.interfaces import IKofaImageFile 29 29 from waeup.kofa.imagestorage import DefaultStorage 30 30 from waeup.kofa.interfaces import IFileStoreHandler, IFileStoreNameChooser … … 38 38 class FakeImageLocation(object): 39 39 implements(ILocation) 40 adapts(IK OFAImageFile)40 adapts(IKofaImageFile) 41 41 def __init__(self, context): 42 42 pass -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py
r7811 r7819 18 18 import grok 19 19 from hurry.workflow.interfaces import IWorkflowState 20 from waeup.kofa.interfaces import IK OFAObject20 from waeup.kofa.interfaces import IKofaObject 21 21 from waeup.kofa.students.viewlets import PrimaryStudentNavTab 22 22 from waeup.kofa.browser.viewlets import ManageActionButton, PrimaryNavTab … … 32 32 from waeup.kofa.interfaces import MessageFactory as _ 33 33 34 grok.context(IK OFAObject) # Make IKOFAObject the default context34 grok.context(IKofaObject) # Make IKofaObject the default context 35 35 grok.templatedir('browser_templates') 36 36 … … 38 38 """Applicants tab in primary navigation. 39 39 """ 40 grok.context(IK OFAObject)40 grok.context(IKofaObject) 41 41 grok.order(3) 42 42 grok.require('waeup.viewApplicantsTab') -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/workflow.py
r7811 r7819 22 22 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 23 23 from waeup.kofa.applicants.interfaces import IApplicantBaseData 24 from waeup.kofa.interfaces import IObjectHistory, IK OFAWorkflowInfo, IKOFAUtils24 from waeup.kofa.interfaces import IObjectHistory, IKofaWorkflowInfo, IKofaUtils 25 25 from waeup.kofa.interfaces import MessageFactory as _ 26 from waeup.kofa.workflow import K OFAWorkflow, KOFAWorkflowInfo26 from waeup.kofa.workflow import KofaWorkflow, KofaWorkflowInfo 27 27 28 28 INITIALIZED = 'initialized' … … 137 137 ) 138 138 139 application_workflow = K OFAWorkflow(APPLICATION_TRANSITIONS)139 application_workflow = KofaWorkflow(APPLICATION_TRANSITIONS) 140 140 141 141 class ApplicationWorkflowState(WorkflowState, grok.Adapter): … … 148 148 state_id = 'wf.application.id' 149 149 150 class ApplicationWorkflowInfo(K OFAWorkflowInfo, grok.Adapter):150 class ApplicationWorkflowInfo(KofaWorkflowInfo, grok.Adapter): 151 151 """Adapter to adapt Applicant objects to workflow info objects. 152 152 """ 153 153 grok.context(IApplicantBaseData) 154 grok.provides(IK OFAWorkflowInfo)154 grok.provides(IKofaWorkflowInfo) 155 155 156 156 def __init__(self, context):
Note: See TracChangeset for help on using the changeset viewer.