Changeset 16120 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 15 Jun 2020, 07:58:00 (5 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r16086 r16120 1150 1150 notice = '' 1151 1151 pnav = 4 1152 buttonname = _(' Submit')1152 buttonname = _('Request now') 1153 1153 with_ac = True 1154 1154 … … 1215 1215 return 1216 1216 1217 class TOStudentTranscriptRequestPage(StudentTranscriptRequestPage): 1218 """ Page to request transcript by student 1219 """ 1220 grok.context(IStudent) 1221 grok.name('request_transcript_for_student') 1222 grok.require('waeup.processTranscript') 1223 grok.template('transcriptrequest') 1224 label = _('Request transcript for student') 1225 with_ac = False 1226 1217 1227 class StudentTranscriptSignView(UtilityView, grok.View): 1218 1228 """ View to sign transcript … … 1263 1273 grok.template('transcriptprocess') 1264 1274 label = _('Validate transcript') 1265 buttonname = _('Save comment and validate transcript') 1275 buttonname1 = _('Save comment') 1276 buttonname2 = _('Save comment and validate transcript') 1266 1277 pnav = 4 1267 1278 … … 1287 1298 return levelremarks 1288 1299 1289 def update(self, SUBMIT=None ):1300 def update(self, SUBMIT=None, SAVE=None): 1290 1301 super(StudentTranscriptValidateFormPage, self).update() 1291 1302 if self.context.student.state != TRANSREQ: … … 1303 1314 else: 1304 1315 self.signees = '' 1305 if SUBMIT is None: 1306 return 1307 # Fire transition 1308 IWorkflowInfo(self.context.student).fireTransition('validate_transcript') 1309 self.flash(_('Transcript validated.')) 1310 comment = self.request.form.get('comment', '').replace('\r', '') 1311 tz = getattr(queryUtility(IKofaUtils), 'tzinfo', pytz.utc) 1312 today = now(tz).strftime('%d/%m/%Y %H:%M:%S %Z') 1313 old_transcript_comment = getattr( 1314 self.context, 'transcript_comment', None) 1315 if old_transcript_comment == None: 1316 old_transcript_comment = '' 1317 self.context.transcript_comment = '''On %s %s wrote: 1316 if SUBMIT is None and SAVE is None: 1317 return 1318 if SAVE or SUBMIT: 1319 # Save comment and append old comment 1320 comment = self.request.form.get('comment', '').replace('\r', '') 1321 tz = getattr(queryUtility(IKofaUtils), 'tzinfo', pytz.utc) 1322 today = now(tz).strftime('%d/%m/%Y %H:%M:%S %Z') 1323 old_transcript_comment = getattr( 1324 self.context, 'transcript_comment', None) 1325 if old_transcript_comment == None: 1326 old_transcript_comment = '' 1327 self.context.transcript_comment = '''On %s %s wrote: 1318 1328 1319 1329 %s 1320 1330 1321 %s''' % (today, self.request.principal.id, comment, 1322 old_transcript_comment) 1323 self.context.writeLogMessage( 1324 self, 'comment: %s' % comment.replace('\n', '<br>')) 1331 %s''' % (today, self.request.principal.id, comment, old_transcript_comment) 1332 self.context.writeLogMessage( 1333 self, 'comment: %s' % comment.replace('\n', '<br>')) 1334 if SUBMIT: 1335 # Fire transition 1336 IWorkflowInfo(self.context.student).fireTransition('validate_transcript') 1337 self.flash(_('Transcript validated.')) 1325 1338 self.redirect(self.url(self.context) + '/transcript') 1326 1339 return … … 1334 1347 grok.template('transcriptprocess') 1335 1348 label = _('Release transcript') 1336 buttonname = _('Save comment and release transcript') 1349 buttonname1 = None 1350 buttonname2 = _('Save comment and release transcript') 1337 1351 pnav = 4 1338 1352 -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/transcriptprocess.pt
r15333 r16120 40 40 <td colspan="2"> 41 41 <br /> 42 <input type="submit" name="SUBMIT" class="btn btn-primary" 43 tal:attributes="value view/buttonname" /> 42 <input 43 data-toggle="tooltip" 44 title="Comments will be added to the correspondence. 45 They can't be edited or removed after saving." 46 onclick="return window.confirm('Are you really sure?')" 47 type="submit" name="SAVE" class="btn btn-primary" 48 tal:condition="view/buttonname1" 49 tal:attributes="value view/buttonname1" /> 50 <input 51 data-toggle="tooltip" 52 title="Comments will be added to the correspondence. 53 They can't be edited or removed after saving and 54 transcript validation." 55 onclick="return window.confirm('Are you really sure?')" 56 type="submit" name="SUBMIT" class="btn btn-primary" 57 tal:attributes="value view/buttonname2" /> 44 58 </td> 45 59 </tr> -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r15998 r16120 637 637 ) 638 638 639 transcript_remark = schema.Text Line(639 transcript_remark = schema.Text( 640 640 title = _(u'Transcript Remark'), 641 641 required = False, -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r16086 r16120 2125 2125 2126 2126 def test_process_transcript(self): 2127 IWorkflowState(self.student).setState(' transcript requested')2127 IWorkflowState(self.student).setState('graduated') 2128 2128 notify(grok.ObjectModifiedEvent(self.student)) 2129 2129 self.student['studycourse'].transcript_comment = ( … … 2145 2145 self.browser.getControl("Login").click() 2146 2146 self.assertMatches('...You logged in...', self.browser.contents) 2147 # Officer can request transcript for students 2148 self.browser.open(self.student_path) 2149 self.browser.getLink("Request transcript for student").click() 2150 self.browser.getControl("Request now").click() 2151 self.assertEqual(self.student.state, 'transcript requested') 2147 2152 # Officer can see his roles 2148 2153 self.browser.getLink("My Roles").click() … … 3621 3626 self.browser.getControl(name="comment").value = 'Comment line 1 \nComment line2' 3622 3627 self.browser.getControl(name="address").value = 'Address line 1 \nAddress line2' 3623 self.browser.getControl(" Submit").click()3628 self.browser.getControl("Request now").click() 3624 3629 self.assertMatches('...Transcript processing has been started...', 3625 3630 self.browser.contents) -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r16085 r16120 764 764 return self.view.url(self.view.context, self.target) 765 765 766 class TORequestTranscriptActionButton(RequestTranscriptActionButton): 767 grok.require('waeup.processTranscript') 768 text = _('Request transcript for student') 769 target = 'request_transcript_for_student' 770 766 771 767 772 class ValidateTranscriptActionButton(ManageActionButton):
Note: See TracChangeset for help on using the changeset viewer.