Changeset 15163 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 23 Sep 2018, 05:05:04 (6 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk
- Property svn:mergeinfo changed
/main/waeup.kofa/branches/henrik-transcript-workflow (added) merged: 15127-15128,15133-15134,15140-15143,15145-15150,15152-15155,15157-15160,15162
- Property svn:mergeinfo changed
-
main/waeup.kofa/trunk/src/waeup/kofa
- Property svn:mergeinfo changed
/main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa (added) merged: 15128,15134,15140-15143,15145-15150,15152-15155,15157-15160,15162
- Property svn:mergeinfo changed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r15116 r15163 60 60 ISessionConfiguration, ISessionConfigurationAdd, IJobManager, 61 61 IPasswordValidator, IContactForm, IKofaUtils, ICSVExporter, 62 academic_sessions_vocab, DOCLINK, registration_states_vocab) 62 academic_sessions_vocab, DOCLINK, registration_states_vocab, 63 TRANSREQ, TRANSVAL) 64 from waeup.kofa.university.faculty import Faculty 63 65 from waeup.kofa.university.department import Department 64 66 from waeup.kofa.university.course import Course … … 375 377 self.redirect(self.application_url() + rel_link) 376 378 return 377 # Redirect lecturerafter login379 # Redirect some officers after login 378 380 local_roles = get_user_account(self.request).getLocalRoles() 379 381 if local_roles.has_key('waeup.local.Lecturer'): 380 382 self.redirect(self.application_url() + '/my_courses') 383 return 384 if local_roles.has_key('waeup.local.TranscriptOfficer'): 385 self.redirect(self.application_url() + '/my_transcript_requests') 386 return 387 if local_roles.has_key('waeup.local.TranscriptSignee'): 388 self.redirect(self.application_url() + '/my_transcript_signing_requests') 381 389 return 382 390 if not self.camefrom: … … 1023 1031 return courses 1024 1032 1033 class TranscriptOfficerLandingPage(KofaPage): 1034 """Display students, who requested a transcript, when 1035 transcript officer logs in. 1036 """ 1037 grok.name('my_transcript_requests') 1038 grok.require('waeup.Authenticated') 1039 grok.context(IUniversity) 1040 grok.template('mytranscriptrequests') 1041 label =_('My ToDoList') 1042 1043 @property 1044 def getStudents(self): 1045 students = ([],[]) 1046 cat = queryUtility(ICatalog, name='students_catalog') 1047 local_roles = get_user_account(self.request).getLocalRoles() 1048 for item in local_roles.get('waeup.local.TranscriptOfficer', []): 1049 if isinstance(item, Faculty): 1050 faccode = item.code 1051 results1 = cat.searchResults( 1052 state=(TRANSREQ, TRANSREQ), faccode=(faccode, faccode)) 1053 for result in results1: 1054 students[0].append(StudentQueryResultItem(result, self)) 1055 results2 = cat.searchResults( 1056 state=(TRANSVAL, TRANSVAL), faccode=(faccode, faccode)) 1057 for result in results2: 1058 students[1].append(StudentQueryResultItem(result, self)) 1059 return students 1060 1061 class TranscriptSigneeLandingPage(KofaPage): 1062 """Display students with validated transcript requests, when 1063 transcript signee logs in. 1064 """ 1065 grok.name('my_transcript_signing_requests') 1066 grok.require('waeup.Authenticated') 1067 grok.context(IUniversity) 1068 grok.template('mytranscriptrequests') 1069 label =_('My ToDoList') 1070 1071 @property 1072 def getStudents(self): 1073 students = ([],[]) 1074 cat = queryUtility(ICatalog, name='students_catalog') 1075 local_roles = get_user_account(self.request).getLocalRoles() 1076 for item in local_roles.get('waeup.local.TranscriptSignee', []): 1077 if isinstance(item, Faculty): 1078 faccode = item.code 1079 results = cat.searchResults( 1080 state=(TRANSVAL, TRANSVAL), faccode=(faccode, faccode)) 1081 for result in results: 1082 students[1].append(StudentQueryResultItem(result, self)) 1083 return students 1084 1025 1085 # 1026 1086 # Search pages... -
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_browser.py
r15060 r15163 439 439 'nationality,officer_comment,perm_address,personal_updated,' 440 440 'phone,reg_number,sex,student_id,suspended,suspended_comment,' 441 'transcript_comment,'442 441 'password,state,history,certcode,is_postgrad,current_level,' 443 442 'current_session\r\n') -
main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py
r14286 r15163 365 365 return '' 366 366 367 class TranscriptOfficerStudents(ManageLink): 368 """A link to transcript requests. 369 """ 370 grok.order(6) 371 grok.require('waeup.Authenticated') 372 373 link = u'my_transcript_requests' 374 text = _(u'My ToDoList') 375 376 def render(self): 377 user_account = get_user_account(self.request) 378 if user_account: 379 local_roles = user_account.getLocalRoles() 380 if local_roles.has_key('waeup.local.TranscriptOfficer'): 381 url = self.view.url(grok.getSite(), self.link) 382 text = translate(self.text, context=self.request) 383 return u'<li><a href="%s">%s</a></li>' % (url, text) 384 return '' 385 386 class TranscriptSigneeStudents(ManageLink): 387 """A link to transcript signing requests. 388 """ 389 grok.order(6) 390 grok.require('waeup.Authenticated') 391 392 link = u'my_transcript_signing_requests' 393 text = _(u'My ToDoList') 394 395 def render(self): 396 user_account = get_user_account(self.request) 397 if user_account: 398 local_roles = user_account.getLocalRoles() 399 if local_roles.has_key('waeup.local.TranscriptSignee'): 400 url = self.view.url(grok.getSite(), self.link) 401 text = translate(self.text, context=self.request) 402 return u'<li><a href="%s">%s</a></li>' % (url, text) 403 return '' 404 367 405 class MyPreferences(ManageLink): 368 406 """A link to personal preferences, placed in upper left box.
Note: See TracChangeset for help on using the changeset viewer.