Changeset 13133
- Timestamp:
- 2 Jul 2015, 10:06:52 (9 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/docs/source/userdocs/customization.rst
r13132 r13133 109 109 The central `KofaUtils` utility contains not only most dictionaries 110 110 used for sources (see :py:class:`API 111 <waeup.kofa.utils.utils.KofaUtils>`) but also configuration112 attributes like111 <waeup.kofa.utils.utils.KofaUtils>`) but also **configuration 112 attributes** like 113 113 114 114 .. autoattribute:: waeup.kofa.utils.utils.KofaUtils.PORTAL_LANGUAGE … … 121 121 :noindex: 122 122 123 Customizable utility methodsare:124 125 .. automethod:: waeup.kofa.utils.utils.KofaUtils.sendContactForm ()126 :noindex: 127 128 .. automethod:: waeup.kofa.utils.utils.KofaUtils.fullname ()129 :noindex: 130 131 .. automethod:: waeup.kofa.utils.utils.KofaUtils.genPassword ()132 :noindex: 133 134 .. automethod:: waeup.kofa.utils.utils.KofaUtils.sendCredentials ()135 :noindex: 136 137 .. automethod:: waeup.kofa.utils.utils.KofaUtils.getPaymentItem ()138 :noindex: 139 140 Students Util s141 -------------- 142 143 `StudentsUtils` contains the following configuration attributes:123 Customizable **utility methods** are: 124 125 .. automethod:: waeup.kofa.utils.utils.KofaUtils.sendContactForm 126 :noindex: 127 128 .. automethod:: waeup.kofa.utils.utils.KofaUtils.fullname 129 :noindex: 130 131 .. automethod:: waeup.kofa.utils.utils.KofaUtils.genPassword 132 :noindex: 133 134 .. automethod:: waeup.kofa.utils.utils.KofaUtils.sendCredentials 135 :noindex: 136 137 .. automethod:: waeup.kofa.utils.utils.KofaUtils.getPaymentItem 138 :noindex: 139 140 Students Utilities 141 ------------------ 142 143 `StudentsUtils` contains the following **configuration attributes**: 144 144 145 145 .. autoattribute:: waeup.kofa.students.utils.StudentsUtils.STUDENT_ID_PREFIX … … 161 161 :noindex: 162 162 163 Customizable utility methods are: 164 165 .. automethod:: waeup.kofa.students.utils.StudentsUtils.getReturningData() 166 :noindex: 167 168 .. automethod:: waeup.kofa.students.utils.StudentsUtils.setReturningData() 169 :noindex: 170 171 .. automethod:: waeup.kofa.students.utils.StudentsUtils.setPaymentDetails() 172 :noindex: 173 174 .. automethod:: waeup.kofa.students.utils.StudentsUtils.setBalanceDetails() 175 :noindex: 176 177 .. automethod:: waeup.kofa.students.utils.StudentsUtils.increaseMatricInteger() 178 :noindex: 179 180 .. automethod:: waeup.kofa.students.utils.StudentsUtils.constructMatricNumber() 181 :noindex: 182 183 .. automethod:: waeup.kofa.students.utils.StudentsUtils.setMatricNumber() 184 :noindex: 185 186 .. automethod:: waeup.kofa.students.utils.StudentsUtils.getAccommodationDetails() 187 :noindex: 188 189 .. automethod:: waeup.kofa.students.utils.StudentsUtils.selectBed() 190 :noindex: 191 192 .. automethod:: waeup.kofa.students.utils.StudentsUtils.renderPDFAdmissionLetter() 193 :noindex: 194 195 .. automethod:: waeup.kofa.students.utils.StudentsUtils.getPDFCreator() 196 :noindex: 197 198 .. automethod:: waeup.kofa.students.utils.StudentsUtils.renderPDF() 199 :noindex: 200 201 .. automethod:: waeup.kofa.students.utils.StudentsUtils.renderPDFTranscript() 202 :noindex: 203 204 .. automethod:: waeup.kofa.students.utils.StudentsUtils.maxCredits() 205 :noindex: 206 207 .. automethod:: waeup.kofa.students.utils.StudentsUtils.getBedCoordinates() 208 :noindex: 209 210 211 Applicants Utils 212 ---------------- 213 214 163 Customizable **utility methods** are: 164 165 .. automethod:: waeup.kofa.students.utils.StudentsUtils.getReturningData 166 :noindex: 167 168 .. automethod:: waeup.kofa.students.utils.StudentsUtils.setReturningData 169 :noindex: 170 171 .. automethod:: waeup.kofa.students.utils.StudentsUtils.setPaymentDetails 172 :noindex: 173 174 .. automethod:: waeup.kofa.students.utils.StudentsUtils.setBalanceDetails 175 :noindex: 176 177 .. automethod:: waeup.kofa.students.utils.StudentsUtils.increaseMatricInteger 178 :noindex: 179 180 .. automethod:: waeup.kofa.students.utils.StudentsUtils.constructMatricNumber 181 :noindex: 182 183 .. automethod:: waeup.kofa.students.utils.StudentsUtils.setMatricNumber 184 :noindex: 185 186 .. automethod:: waeup.kofa.students.utils.StudentsUtils.getAccommodationDetails 187 :noindex: 188 189 .. automethod:: waeup.kofa.students.utils.StudentsUtils.selectBed 190 :noindex: 191 192 .. automethod:: waeup.kofa.students.utils.StudentsUtils.renderPDFAdmissionLetter 193 :noindex: 194 195 .. automethod:: waeup.kofa.students.utils.StudentsUtils.getPDFCreator 196 :noindex: 197 198 .. automethod:: waeup.kofa.students.utils.StudentsUtils.renderPDF 199 :noindex: 200 201 .. automethod:: waeup.kofa.students.utils.StudentsUtils.renderPDFTranscript 202 :noindex: 203 204 .. automethod:: waeup.kofa.students.utils.StudentsUtils.maxCredits 205 :noindex: 206 207 .. automethod:: waeup.kofa.students.utils.StudentsUtils.getBedCoordinates 208 :noindex: 209 210 211 Applicants Utililties 212 --------------------- 213 214 `ApplicantsUtils` contains the following **configuration attributes**: 215 216 .. autoattribute:: waeup.kofa.applicants.utils.ApplicantsUtils.APP_TYPES_DICT 217 :noindex: 218 219 .. autoattribute:: waeup.kofa.applicants.utils.ApplicantsUtils.SEPARATORS_DICT 220 :noindex: 221 222 Customizable **utility methods** are: 223 224 .. automethod:: waeup.kofa.applicants.utils.ApplicantsUtils.setPaymentDetails 225 :noindex: 226 227 .. automethod:: waeup.kofa.applicants.utils.ApplicantsUtils.getApplicantsStatistics 228 :noindex: 229 230 .. automethod:: waeup.kofa.applicants.utils.ApplicantsUtils.sortCertificates 231 :noindex: 232 233 .. automethod:: waeup.kofa.applicants.utils.ApplicantsUtils.getCertTitle 234 :noindex: -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r13123 r13133 378 378 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 379 379 self.context.description_dict = html2dict(description, portal_language) 380 # Always refresh title. So we can change titles381 # if APP_TYPES_DICT has been edited.382 apptypes_dict = getUtility(IApplicantsUtils).APP_TYPES_DICT383 title = apptypes_dict[self.context.prefix][0]384 #self.context.title = u'%s %s/%s' % (385 # title, self.context.year, self.context.year + 1)386 380 self.flash(_('Form has been saved.')) 387 381 fields_string = ' + '.join(changed_fields) -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r13104 r13133 97 97 application_category=(appcat,appcat)) 98 98 resultlist = getUtility( 99 IApplicantsUtils). filterCertificates(context, result)99 IApplicantsUtils).sortCertificates(context, result) 100 100 return resultlist 101 101 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/utils.py
r13123 r13133 33 33 grok.implements(IApplicantsUtils) 34 34 35 #: A dictionary containing application type names, titles and 36 #: access code prefixes (meanwhile deprecated). 35 37 APP_TYPES_DICT = { 36 38 'app': ['General Studies', 'APP'], … … 38 40 } 39 41 42 #: A dictionary which maps widget names to headlines. 43 #: The headline is rendered in forms and on pdf slips above the 44 #: respective display or input widget. 40 45 SEPARATORS_DICT = { 41 46 'form.course1': _(u'Desired Study Courses'), … … 45 50 def setPaymentDetails(self, container, payment, applicant): 46 51 """Set the payment data of an applicant. 52 In contrast to its `StudentsUtils` counterpart, the payment ticket 53 must exist and is an argument of this method. 47 54 """ 48 55 timestamp = ("%d" % int(time()*10000))[1:] … … 75 82 76 83 def getApplicantsStatistics(self, container): 77 """Count applicants in containers.84 """Count applicants in applicants containers. 78 85 """ 79 86 state_stats = {INITIALIZED:0, STARTED:0, PAID:0, SUBMITTED:0, … … 90 97 return state_stats, None 91 98 92 def filterCertificates(self, context, resultset): 93 """Filter and sort certificates in AppCatCertificateSource. 99 def sortCertificates(self, context, resultset): 100 """Sort already filtered certificates in `AppCatCertificateSource`. 101 Display also current course even if certificate in the academic 102 section has been removed. 94 103 """ 95 104 resultlist = sorted(resultset, key=lambda value: value.code) 96 105 curr_course = context.course1 97 106 if curr_course is not None and curr_course not in resultlist: 98 # display also current course even if certificate has been removed99 107 resultlist = [curr_course,] + resultlist 100 108 return resultlist 101 109 102 110 def getCertTitle(self, context, value): 103 """Compose the titles in AppCatCertificateSource.111 """Compose the titles in `AppCatCertificateSource`. 104 112 """ 105 113 return "%s - %s" % (value.code, value.title)
Note: See TracChangeset for help on using the changeset viewer.