Changeset 11843
- Timestamp:
- 14 Oct 2014, 17:45:38 (10 years ago)
- Location:
- main/kofacustom.pcn/trunk/src/kofacustom/pcn
- Files:
-
- 9 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.pcn/trunk/src/kofacustom/pcn/applicants/browser.py
r11840 r11843 20 20 import grok 21 21 from waeup.kofa.applicants.browser import ( 22 ApplicantRegistrationPage, ApplicantsContainerPage) 22 ApplicantRegistrationPage, 23 ApplicantsContainerPage, 24 ApplicantDisplayFormPage, 25 ApplicantManageFormPage, 26 ApplicantEditFormPage) 23 27 from waeup.kofa.applicants.viewlets import ( 24 28 StudentCreateActionButton, 25 ApplicantsRootCreateStudentsActionButton 29 ApplicantsRootCreateStudentsActionButton, 26 30 ) 31 from kofacustom.pcn.applicants.interfaces import ( 32 ICustomApplicant, ICustomApplicantEdit) 27 33 from kofacustom.pcn.interfaces import MessageFactory as _ 28 34 … … 42 48 """ 43 49 return 50 51 class CustomApplicantDisplayFormPage(ApplicantDisplayFormPage): 52 """A display view for applicant data. 53 """ 54 grok.template('applicantdisplaypage') 55 56 @property 57 def form_fields(self): 58 form_fields = grok.AutoFields(ICustomApplicant).omit( 59 'locked', 'course_admitted', 'password', 'suspended') 60 return form_fields 61 62 class CustomApplicantManageFormPage(ApplicantManageFormPage): 63 """A full edit view for applicant data. 64 """ 65 grok.template('applicanteditpage') 66 67 @property 68 def form_fields(self): 69 form_fields = grok.AutoFields(ICustomApplicant) 70 form_fields['applicant_id'].for_display = True 71 return form_fields 72 73 class CustomApplicantEditFormPage(ApplicantEditFormPage): 74 """An applicant-centered edit view for applicant data. 75 """ 76 grok.template('applicanteditpage') 77 78 @property 79 def form_fields(self): 80 form_fields = grok.AutoFields(ICustomApplicantEdit).omit( 81 'locked', 'course_admitted', 82 'suspended' 83 ) 84 form_fields['applicant_id'].for_display = True 85 form_fields['reg_number'].for_display = True 86 return form_fields -
main/kofacustom.pcn/trunk/src/kofacustom/pcn/applicants/interfaces.py
r11832 r11843 18 18 """Customized interfaces of the university application package. 19 19 """ 20 20 from datetime import datetime 21 from grokcore.content.interfaces import IContainer 22 from zc.sourcefactory.contextual import BasicContextualSourceFactory 23 from zope import schema 24 from zope.component import queryUtility, getUtility 25 from zope.catalog.interfaces import ICatalog 26 from zope.interface import Interface, Attribute, implements, directlyProvides 27 from zope.schema.interfaces import ( 28 ValidationError, ISource, IContextSourceBinder) 29 from waeup.kofa.browser.interfaces import IApplicantBase 30 from waeup.kofa.schema import TextLineChoice, FormattedDate 31 from waeup.kofa.interfaces import ( 32 IKofaObject, validate_email, 33 SimpleKofaVocabulary) 34 from waeup.kofa.interfaces import MessageFactory as _ 35 from waeup.kofa.payments.interfaces import IOnlinePayment 36 from waeup.kofa.schema import PhoneNumber 37 from waeup.kofa.students.vocabularies import GenderSource, RegNumberSource 38 from waeup.kofa.university.vocabularies import ( 39 AppCatSource, CertificateSource, SpecialApplicationSource) 21 40 from waeup.kofa.applicants.interfaces import ( 22 IApplicantBaseData, 23 IApplicantOnlinePayment, 24 IApplicantEdit, 25 ) 41 contextual_reg_num_source, AppCatCertificateSource, 42 IApplicantOnlinePayment) 26 43 from kofacustom.pcn.interfaces import MessageFactory as _ 27 44 28 class ICustomApplicant(IApplicantBase Data):29 """ A customapplicant.45 class ICustomApplicant(IApplicantBase): 46 """The data for an applicant. 30 47 48 This is a base interface with no field 49 required. For use with processors, forms, etc., please use one of 50 the derived interfaces below, which set more fields to required 51 state, depending on use-case. 31 52 """ 32 53 33 class ICustomApplicantEdit(IApplicantEdit): 54 def writeLogMessage(view, comment): 55 """Adds an INFO message to the log file 56 """ 57 58 def createStudent(): 59 """Create a student object from applicatnt data 60 and copy applicant object. 61 """ 62 63 history = Attribute('Object history, a list of messages') 64 state = Attribute('The application state of an applicant') 65 display_fullname = Attribute('The fullname of an applicant') 66 application_date = Attribute('UTC datetime of submission, used for export only') 67 password = Attribute('Encrypted password of a applicant') 68 application_number = Attribute('The key under which the record is stored') 69 70 suspended = schema.Bool( 71 title = _(u'Account suspended'), 72 default = False, 73 required = False, 74 ) 75 76 applicant_id = schema.TextLine( 77 title = _(u'Applicant Id'), 78 required = False, 79 readonly = False, 80 ) 81 reg_number = TextLineChoice( 82 title = _(u'Registration Number'), 83 readonly = False, 84 required = True, 85 source = contextual_reg_num_source, 86 ) 87 firstname = schema.TextLine( 88 title = _(u'First Name'), 89 required = True, 90 ) 91 middlename = schema.TextLine( 92 title = _(u'Middle Name'), 93 required = False, 94 ) 95 lastname = schema.TextLine( 96 title = _(u'Last Name (Surname)'), 97 required = True, 98 ) 99 date_of_birth = FormattedDate( 100 title = _(u'Date of Birth'), 101 required = False, 102 #date_format = u'%d/%m/%Y', # Use grok-instance-wide default 103 show_year = True, 104 ) 105 sex = schema.Choice( 106 title = _(u'Sex'), 107 source = GenderSource(), 108 required = True, 109 ) 110 email = schema.ASCIILine( 111 title = _(u'Email Address'), 112 required = False, 113 constraint=validate_email, 114 ) 115 phone = PhoneNumber( 116 title = _(u'Phone'), 117 description = u'', 118 required = False, 119 ) 120 course1 = schema.Choice( 121 title = _(u'1st Choice Course of Study'), 122 source = AppCatCertificateSource(), 123 required = True, 124 ) 125 126 notice = schema.Text( 127 title = _(u'Notice'), 128 required = False, 129 ) 130 131 course_admitted = schema.Choice( 132 title = _(u'Admitted Course of Study'), 133 source = CertificateSource(), 134 required = False, 135 ) 136 locked = schema.Bool( 137 title = _(u'Form locked'), 138 default = False, 139 required = False, 140 ) 141 142 class ICustomApplicantEdit(ICustomApplicant): 34 143 """A custom applicant interface for editing. 35 144 … … 41 150 We cannot omit fields here. This has to be done in the 42 151 respective form page. 152 43 153 """ 154 155 email = schema.ASCIILine( 156 title = _(u'Email Address'), 157 required = True, 158 constraint=validate_email, 159 ) 160 course1 = schema.Choice( 161 title = _(u'1st Choice Course of Study'), 162 source = AppCatCertificateSource(), 163 required = True, 164 ) 165 course_admitted = schema.Choice( 166 title = _(u'Admitted Course of Study'), 167 source = CertificateSource(), 168 required = False, 169 readonly = True, 170 ) 171 notice = schema.Text( 172 title = _(u'Notice'), 173 required = False, 174 readonly = True, 175 ) 44 176 45 177 class ICustomApplicantOnlinePayment(IApplicantOnlinePayment): -
main/kofacustom.pcn/trunk/src/kofacustom/pcn/locales/en/LC_MESSAGES/waeup.kofa.po
r11839 r11843 16 16 17 17 msgid "Academic Section" 18 msgstr " PCN Offices"18 msgstr "Office Section" 19 19 20 20 msgid "Manage academic section" … … 154 154 155 155 msgid "No application record found." 156 msgstr "No registra ntrecord found."156 msgstr "No registration record found." 157 157 158 158 msgid "Manage application section" 159 msgstr "Manage registra ntsection"159 msgstr "Manage registration section" 160 160 161 161 msgid "Applicant Id" … … 166 166 167 167 msgid "Application Section" 168 msgstr "Registra ntSection"168 msgstr "Registration Section" 169 169 170 170 msgid "Application State" … … 205 205 206 206 msgid "Register for application" 207 msgstr " Subscribe"207 msgstr "Register" 208 208 209 209 msgid "View application record"
Note: See TracChangeset for help on using the changeset viewer.