Changeset 8262 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 24 Apr 2012, 15:27:00 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8258 r8262 1184 1184 """ 1185 1185 grok.context(IStudentOnlinePayment) 1186 grok.name('payment_ receipt.pdf')1186 grok.name('payment_slip.pdf') 1187 1187 grok.require('waeup.viewStudent') 1188 1188 form_fields = grok.AutoFields(IStudentOnlinePayment) … … 1190 1190 form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 1191 1191 prefix = 'form' 1192 title = 'Payment Data'1193 1192 note = None 1194 1193 1195 1194 @property 1195 def title(self): 1196 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1197 return translate(_('Payment Data'), 'waeup.kofa', 1198 target_language=portal_language) 1199 1200 @property 1196 1201 def label(self): 1197 return 'Online Payment Receipt %s' % self.context.p_id 1202 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1203 return translate(_('Online Payment Slip'), 1204 'waeup.kofa', target_language=portal_language) \ 1205 + ' %s' % self.context.p_id 1198 1206 1199 1207 def render(self): 1200 if self.context.p_state != 'paid':1201 self.flash('Ticket not yet paid.')1202 self.redirect(self.url(self.context))1203 return1208 #if self.context.p_state != 'paid': 1209 # self.flash('Ticket not yet paid.') 1210 # self.redirect(self.url(self.context)) 1211 # return 1204 1212 studentview = StudentBaseDisplayFormPage(self.context.getStudent(), 1205 1213 self.request) 1206 1214 students_utils = getUtility(IStudentsUtils) 1207 return students_utils.renderPDF(self, 'payment_ receipt.pdf',1215 return students_utils.renderPDF(self, 'payment_slip.pdf', 1208 1216 self.context.getStudent(), studentview, note=self.note) 1209 1217 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8252 r8262 1271 1271 payment_url = self.browser.url 1272 1272 1273 # The pdf payment receiptcan't yet be opened1274 self.browser.open(payment_url + '/payment_receipt.pdf')1275 self.assertMatches('...Ticket not yet paid...',1276 self.browser.contents)1273 # The pdf payment slip can't yet be opened 1274 #self.browser.open(payment_url + '/payment_slip.pdf') 1275 #self.assertMatches('...Ticket not yet paid...', 1276 # self.browser.contents) 1277 1277 1278 1278 # The same payment (with same p_item, p_session and p_category) … … 1307 1307 self.browser.contents) 1308 1308 1309 # Managers can open the pdf payment receipt1309 # Managers can open the pdf payment slip 1310 1310 self.browser.open(payment_url) 1311 self.browser.getLink("Download payment receipt").click()1311 self.browser.getLink("Download payment slip").click() 1312 1312 self.assertEqual(self.browser.headers['Status'], '200 Ok') 1313 1313 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') … … 1384 1384 ac.owner = self.student_id 1385 1385 1386 # Students can open the pdf payment receipt1387 self.browser.open(payment_url + '/payment_ receipt.pdf')1386 # Students can open the pdf payment slip 1387 self.browser.open(payment_url + '/payment_slip.pdf') 1388 1388 self.assertEqual(self.browser.headers['Status'], '200 Ok') 1389 1389 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r8135 r8262 319 319 grok.require('waeup.viewStudent') 320 320 icon = 'actionicon_pdf.png' 321 text = _('Download payment receipt')322 target = 'payment_ receipt.pdf'323 324 @property 325 def target_url(self): 326 if self.context.p_state != 'paid':327 return ''321 text = _('Download payment slip') 322 target = 'payment_slip.pdf' 323 324 @property 325 def target_url(self): 326 #if self.context.p_state != 'paid': 327 # return '' 328 328 return self.view.url(self.view.context, self.target) 329 329
Note: See TracChangeset for help on using the changeset viewer.