- Timestamp:
- 6 Sep 2018, 11:16:55 (6 years ago)
- Location:
- main/waeup.kofa/branches/henrik-transcript-workflow
- Files:
-
- 1 added
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/henrik-transcript-workflow/docs/source/userdocs/datacenter/export.rst
r15051 r15128 282 282 .. autoattribute:: waeup.kofa.students.export.SessionPaymentsOverviewExporter.fields 283 283 .. autoattribute:: waeup.kofa.students.export.SessionPaymentsOverviewExporter.title 284 .. autoattribute:: waeup.kofa.students.export.SessionPaymentsOverviewExporter.curr_year285 284 .. automethod:: waeup.kofa.students.export.SessionPaymentsOverviewExporter.mangle_value() 286 285 -
main/waeup.kofa/branches/henrik-transcript-workflow/docs/source/userdocs/datacenter/import_stages.rst
r12998 r15128 8 8 :ref:`Data Center Doctests <datacenter_txt>` 9 9 10 The term 'data import' actually understates the range of func nctions10 The term 'data import' actually understates the range of functions 11 11 importers really have. As already stated, many importers do not only 12 12 restore data once backed up by exporters or, in other words, take -
main/waeup.kofa/branches/henrik-transcript-workflow/docs/source/userdocs/students/workflow.rst
r13610 r15128 28 28 29 29 a 30 created ------- admitted 31 b | 32 +----------------+ 33 | e 34 +------------------------------------------------------+ 35 | c d | 36 clearance started ------- clearance requested ------- cleared 37 | 38 f | 39 +--------+---------------------------------------------+ 40 | | 41 | h school fee paid -------- returning -------------+ 42 | | \ l | | 43 +--------+ g \ _ _ _ m | k | 44 | \ | | 45 courses registered ------ courses validated | 46 | i | | 47 | | n | 48 | j | | 49 | graduated | 50 | | | 51 | | o | 52 | | | 53 | transcript requested | 54 a: admit | | 55 -a: reset1 +---------------------------------+ 56 b: start_clearance 57 -b: reset2 58 c: request_clearance 59 -c: reset3 (= reject request) 60 d: clear 61 -d: N/A 30 created ------- admitted 31 b | 32 +----------------+ 33 | e 34 +------------------------------------------------------+ 35 | c d | 36 clearance started ------- clearance requested ------- cleared 37 | 38 f | 39 +--------+---------------------------------------------+ 40 | | 41 | h school fee paid -------- returning -------------+ 42 | | \ l | | 43 +--------+ g \ _ _ _ m | k | 44 | \ | | 45 courses registered ------ courses validated | 46 | i | | 47 | | n | 48 | j | | 49 | graduated | 50 | | | 51 | | o | 52 | | | 53 | transcript requested | 54 a: admit | | | 55 -a: reset1 | | p | 56 b: start_clearance | | | 57 -b: reset2 | transcript validated | 58 c: request_clearance | | | 59 -c: reset3 | | q | 60 (= reject request) | | | 61 d: clear | transcript released | 62 -d: N/A +---------------------------------+ 62 63 e: N/A 63 64 -e: reset4 (= annul clearance) … … 81 82 -n: N/A 82 83 o: request_transcript 83 -o: process_transcript 84 84 -o: reset10 (= reject request) 85 p: validate_transcript 86 -p: N/A 87 q: release_transcript 88 -q: N/A 85 89 86 90 Student registration starts with the first login of the student into -
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/interfaces.py
r14699 r15128 56 56 VALIDATED = 'courses validated' 57 57 GRADUATED = 'graduated' 58 TRANSCRIPT = 'transcript requested' 58 TRANSREQ = 'transcript requested' 59 TRANSVAL = 'transcript validated' 60 TRANSREL = 'transcript released' 59 61 60 62 … … 103 105 (_('returning'), RETURNING), 104 106 (_('graduated'), GRADUATED), 105 (_('transcript requested'), TRANSCRIPT), 107 (_('transcript requested'), TRANSREQ), 108 (_('transcript validated'), TRANSVAL), 109 (_('transcript released'), TRANSREL), 106 110 ) 107 111 -
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/browser.py
r15116 r15128 78 78 from waeup.kofa.students.workflow import ( 79 79 ADMITTED, PAID, CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, 80 VALIDATED, GRADUATED, TRANS CRIPT, FORBIDDEN_POSTGRAD_TRANS80 VALIDATED, GRADUATED, TRANSREQ, TRANSVAL, TRANSREL, FORBIDDEN_POSTGRAD_TRANS 81 81 ) 82 82 … … 1146 1146 return 1147 1147 1148 class StudentTranscriptRe questProcessFormPage(KofaEditFormPage):1149 """ Page to process transcript requests1148 class StudentTranscriptReleasesFormPage(KofaEditFormPage): 1149 """ Page to release transcript 1150 1150 """ 1151 1151 grok.context(IStudent) 1152 grok.name(' process_transcript_request')1152 grok.name('release_transcript') 1153 1153 grok.require('waeup.viewTranscript') 1154 grok.template('transcript process')1154 grok.template('transcriptrelease') 1155 1155 form_fields = grok.AutoFields(IStudentTranscript) 1156 label = _(' Process transcript request')1157 buttonname = _('Save comment and mark as processed')1156 label = _('Release transcript') 1157 buttonname = _('Save comment and mark as released') 1158 1158 pnav = 4 1159 1159 1160 1160 def update(self, SUBMIT=None): 1161 super(StudentTranscriptRe questProcessFormPage, self).update()1162 if self.context.state != TRANS CRIPT:1161 super(StudentTranscriptReleasesFormPage, self).update() 1162 if self.context.state != TRANSVAL: 1163 1163 self.flash(_('Student is in wrong state.'), type="warning") 1164 1164 self.redirect(self.url(self.context)) … … 1171 1171 if SUBMIT is None: 1172 1172 return 1173 IWorkflowInfo(self.context).fireTransition('process_transcript') 1174 self.flash(_('Transcript request processed.')) 1173 # Fire transition 1174 IWorkflowInfo(self.context).fireTransition('release_transcript') 1175 self.flash(_('Transcript released.')) 1175 1176 comment = self.request.form.get('comment', '').replace('\r', '') 1176 1177 tz = getattr(queryUtility(IKofaUtils), 'tzinfo', pytz.utc) … … 1187 1188 self.context.writeLogMessage( 1188 1189 self, 'comment: %s' % comment.replace('\n', '<br>')) 1189 subject = _('Transcript processed') 1190 args = {'subject':subject, 'body':comment} 1191 self.redirect(self.url(self.context) + 1192 '/contactstudent?%s' % urlencode(args)) 1190 # Show and produce transcript file 1191 self.redirect(self.url(self.context) + '/studycourse/transcript.pdf') 1192 1193 #subject = _('Transcript released') 1194 #args = {'subject':subject, 'body':comment} 1195 #self.redirect(self.url(self.context) + 1196 # '/contactstudent?%s' % urlencode(args)) 1197 1193 1198 return 1194 1199 … … 1276 1281 def _signatures(self): 1277 1282 return None 1283 1284 def _save_file(self): 1285 if self.context.student.state == TRANSREL: 1286 return True 1287 return False 1278 1288 1279 1289 def render(self): … … 1304 1314 signatures=self._signatures(), 1305 1315 sigs_in_footer=self._sigsInFooter(), 1316 save_file=self._save_file(), 1306 1317 ) 1307 1318 -
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/reports/tests/test_student_statistics.py
r14514 r15128 21 21 'clearance requested', 'cleared', 'school fee paid', 22 22 'courses registered', 'courses validated', 'returning', 23 'graduated', 'transcript requested', 'Total') 23 'graduated', 'transcript requested', 'transcript validated', 24 'transcript released', 'Total') 24 25 25 26 def test_iface(self): … … 41 42 ((u'fac1', u'Total',), 42 43 self.states, 43 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),44 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),)))44 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), 45 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),))) 45 46 self.assertEqual( 46 47 result2, 47 48 ((u'fac1', u'Total'), 48 49 self.states, 49 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),50 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),)))50 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 51 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),))) 51 52 return 52 53 … … 62 63 ((u'fac1', u'fac2', u'Total'), 63 64 self.states, 64 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),65 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),66 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),)))65 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), 66 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 67 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),))) 67 68 self.assertEqual( 68 69 result2, 69 70 ((u'fac1', u'fac2', u'Total'), 70 71 self.states, 71 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),72 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),73 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),)))72 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 73 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 74 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),))) 74 75 return 75 76 … … 83 84 ((u'fac1/dep1', u'fac2/dep2', u'Total'), 84 85 self.states, 85 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),86 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),87 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),)))88 self.assertEqual( 89 result2, 90 ((u'fac1/dep1', u'fac2/dep2', u'Total'), 91 self.states, 92 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),93 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),94 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),)))86 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), 87 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 88 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),))) 89 self.assertEqual( 90 result2, 91 ((u'fac1/dep1', u'fac2/dep2', u'Total'), 92 self.states, 93 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 94 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 95 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),))) 95 96 return 96 97 … … 104 105 ((u'fac1/dep1', u'fac2/dep2', u'Total'), 105 106 self.states, 106 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),107 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),108 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),)))109 self.assertEqual( 110 result2, 111 ((u'fac1/dep1', u'fac2/dep2', u'Total'), 112 self.states, 113 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),114 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),115 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),)))107 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), 108 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 109 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),))) 110 self.assertEqual( 111 result2, 112 ((u'fac1/dep1', u'fac2/dep2', u'Total'), 113 self.states, 114 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 115 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 116 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),))) 116 117 return 117 118 -
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/tests/test_browser.py
r15055 r15128 41 41 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 42 42 from waeup.kofa.app import University 43 from waeup.kofa.interfaces import IFileStoreNameChooser, IExtFileStore 43 44 from waeup.kofa.payments.interfaces import IPayer 44 45 from waeup.kofa.students.payments import StudentOnlinePayment … … 2119 2120 print "Sample PDF transcript.pdf written to %s" % path 2120 2121 2121 def test_ process_transcript_request(self):2122 def test_release_transcript(self): 2122 2123 IWorkflowState(self.student).setState('transcript requested') 2123 2124 notify(grok.ObjectModifiedEvent(self.student)) … … 2143 2144 '...<div>Transcript Officer</div>...', 2144 2145 self.browser.contents) 2145 # Officer can search for students in state 'transcrip rrequested'2146 # Officer can search for students in state 'transcript requested' 2146 2147 self.browser.open(self.container_path) 2147 2148 self.browser.getControl(name="searchtype").value = ['transcript'] … … 2149 2150 self.assertTrue('Anna Tester' in self.browser.contents) 2150 2151 self.browser.getLink("K1000000").click() 2151 self.browser.getLink("Manage transcript request").click() 2152 self.assertFalse('Release transcript request' in self.browser.contents) 2153 # ToDo: Somebody has to validate the transcript 2154 2155 2156 2157 IWorkflowState(self.student).setState('transcript validated') 2158 2159 2160 2161 self.browser.open(self.student_path) 2162 self.assertTrue('Release transcript' in self.browser.contents) 2163 # Now the transcript can be released. 2164 self.browser.getLink("Release transcript").click() 2152 2165 self.assertTrue(' UTC K1000000 wrote:<br><br>Comment line 1 <br>' 2153 2166 'Comment line2<br><br>Dispatch Address:<br>Address line 1 <br>' … … 2155 2168 self.browser.getControl(name="comment").value = ( 2156 2169 'Hello,\nYour transcript has been sent to the address provided.') 2157 self.browser.getControl("Save comment and mark as processed").click()2170 self.browser.getControl("Save comment and mark as released").click() 2158 2171 self.assertTrue( 2159 2172 'UTC mrtranscript wrote:\n\nHello,\nYour transcript has ' … … 2165 2178 logcontent = open(logfile).read() 2166 2179 self.assertTrue( 2167 'mrtranscript - students.browser.StudentTranscriptRe questProcessFormPage - '2180 'mrtranscript - students.browser.StudentTranscriptReleasesFormPage - ' 2168 2181 'K1000000 - comment: Hello,<br>' 2169 2182 'Your transcript has been sent to the address provided' 2170 2183 in logcontent) 2184 # File has been stored in the file system 2185 # Check if transcript exists in the file system and is a PDF file 2186 storage = getUtility(IExtFileStore) 2187 file_id = IFileStoreNameChooser( 2188 self.student).chooseName(attr='transcript.pdf') 2189 pdf = storage.getFile(file_id).read() 2190 self.assertTrue(len(pdf) > 0) 2191 self.assertEqual(pdf[:8], '%PDF-1.4') 2192 # Copy the file to samples_dir 2193 path = os.path.join(samples_dir(), 'final_transcript.pdf') 2194 open(path, 'wb').write(pdf) 2195 print "Sample PDF final_transcript.pdf written to %s" % path 2196 # Check if there is an transcript pdf link in UI 2197 self.browser.open(self.student_path) 2198 self.assertTrue('Final Transcript' in self.browser.contents) 2199 self.browser.getLink("Final Transcript").click() 2200 self.assertEqual(self.browser.headers['Status'], '200 Ok') 2201 self.assertEqual(self.browser.headers['Content-Type'], 2202 'application/pdf') 2171 2203 2172 2204 class StudentUITests(StudentsFullSetup): -
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/utils.py
r15102 r15128 20 20 import grok 21 21 from time import time 22 from cStringIO import StringIO 22 23 from reportlab.lib import colors 23 24 from reportlab.lib.units import cm … … 33 34 from waeup.kofa.interfaces import ( 34 35 IExtFileStore, IKofaUtils, RETURNING, PAID, CLEARED, 35 academic_sessions_vocab )36 academic_sessions_vocab, IFileStoreNameChooser) 36 37 from waeup.kofa.interfaces import MessageFactory as _ 37 38 from waeup.kofa.students.interfaces import IStudentsUtils … … 854 855 level_obj.cumulative_params[0], level_obj.student)[0] 855 856 857 def _saveTranscriptPDF(self, student, transcript): 858 """Create a transcript PDF file and store it in student folder. 859 """ 860 file_store = getUtility(IExtFileStore) 861 file_id = IFileStoreNameChooser(student).chooseName( 862 attr="transcript.pdf") 863 file_store.createFile(file_id, StringIO(transcript)) 864 return 865 856 866 def renderPDFTranscript(self, view, filename='transcript.pdf', 857 867 student=None, … … 861 871 omit_fields=(), 862 872 tableheader=None, 863 no_passport=False): 873 no_passport=False, 874 save_file=False): 864 875 """Render pdf slip of a transcripts. 865 876 """ … … 966 977 view.flash(_('Error in image file.')) 967 978 return view.redirect(view.url(view.context)) 979 if save_file: 980 self._saveTranscriptPDF(student, pdf_stream) 968 981 return pdf_stream 969 982 -
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/viewlets.py
r14158 r15128 40 40 from waeup.kofa.students.workflow import ( 41 41 ADMITTED, PAID, REQUESTED, CLEARED, REGISTERED, VALIDATED, GRADUATED, 42 TRANS CRIPT)42 TRANSREQ, TRANSVAL) 43 43 from waeup.kofa.university.interfaces import ICourse 44 44 … … 96 96 return '' 97 97 98 99 98 class StudentManageBaseLink(StudentManageLink): 100 99 grok.order(2) … … 142 141 link = 'history' 143 142 text = _(u'History') 143 144 145 class StudentManageTranscriptLink(StudentManageLink): 146 grok.order(9) 147 link = 'transcript.pdf' 148 text = _(u'Final Transcript') 149 150 def render(self): 151 slip = getUtility(IExtFileStore).getFileByContext( 152 self.context.student, attr=self.link) 153 if slip: 154 lang = self.request.cookies.get('kofa.language') 155 text = translate( 156 self.text, 'waeup.kofa', target_language=lang) 157 url = self.view.url(self.context.student['studycourse'], self.link) 158 return u'<li><a href="%s">%s</a></li>' % ( 159 url, text) 160 return '' 144 161 145 162 … … 759 776 760 777 761 class ProcessTranscriptRequestActionButton(ManageActionButton):778 class ReleaseTranscriptActionButton(ManageActionButton): 762 779 grok.order(9) 763 780 grok.context(IStudent) 764 781 grok.view(StudentBaseDisplayFormPage) 765 782 grok.require('waeup.viewTranscript') 766 text = _(' Manage transcript request')767 target = ' process_transcript_request'783 text = _('Release transcript') 784 target = 'release_transcript' 768 785 icon = 'actionicon_transcript.png' 769 786 770 787 @property 771 788 def target_url(self): 772 if self.context.state != TRANS CRIPT:789 if self.context.state != TRANSVAL: 773 790 return '' 774 791 return self.view.url(self.view.context, self.target) -
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/workflow.py
r13610 r15128 9 9 IObjectHistory, IKofaWorkflowInfo, IKofaUtils, 10 10 CREATED, ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING, 11 REGISTERED, VALIDATED, GRADUATED, TRANS CRIPT)11 REGISTERED, VALIDATED, GRADUATED, TRANSREQ, TRANSVAL, TRANSREL) 12 12 from waeup.kofa.interfaces import MessageFactory as _ 13 13 from waeup.kofa.workflow import KofaWorkflow, KofaWorkflowInfo … … 198 198 msg = _("Transcript requested"), 199 199 source = GRADUATED, 200 destination = TRANS CRIPT),201 202 Transition( 203 transition_id = ' process_transcript',204 title = _(' Transcript processed'),205 msg = _("Transcript processed"),206 source = TRANS CRIPT,200 destination = TRANSREQ), 201 202 Transition( 203 transition_id = 'reset10', 204 title = _('Reject transcript request'), 205 msg = _("Transcript request rejected"), 206 source = TRANSREQ, 207 207 destination = GRADUATED), 208 209 Transition( 210 transition_id = 'validate_transcript', 211 title = _('Transcript validated'), 212 msg = _("Transcript validated"), 213 source = TRANSREQ, 214 destination = TRANSVAL), 215 216 Transition( 217 transition_id = 'release_transcript', 218 title = _('Transcript released'), 219 msg = _("Transcript released"), 220 source = TRANSVAL, 221 destination = TRANSREL), 208 222 ) 209 223
Note: See TracChangeset for help on using the changeset viewer.