Changeset 13133 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 2 Jul 2015, 10:06:52 (10 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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.