Changeset 15998 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 11 Feb 2020, 07:26:29 (5 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/browser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r15964 r15998 2042 2042 return result 2043 2043 2044 class SwitchMaintMode Page(UtilityView, grok.View):2044 class SwitchMaintModeView(UtilityView, grok.View): 2045 2045 """Import managers must disable authentication for all other users 2046 2046 before starting an import. This pages switches maintenance mode … … 2553 2553 def delLocalRoles(self, **data): 2554 2554 return del_local_roles(self,2,**data) 2555 2556 class UpdateCourseTicketsView(UtilityView, grok.View): 2557 """Udate course tickets. 2558 """ 2559 grok.context(ICourse) 2560 grok.name('update_coursetickets') 2561 grok.require('waeup.editScores') 2562 2563 def update(self): 2564 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 2565 grok.getSite().logger.info( 2566 '%s - course tickets updated: %s' % ( 2567 ob_class, self.context.code)) 2568 number = getUtility(IStudentsUtils).updateCourseTickets(self.context) 2569 if number is None: 2570 self.flash(_('Current academic session not set.')) 2571 elif number is 0: 2572 self.flash(_('No course ticket found.')) 2573 else: 2574 self.flash( 2575 _('%s course ticket(s) updated.' % number)) 2576 self.redirect(self.url(self.context)) 2577 return 2578 2579 def render(self): 2580 return 2555 2581 2556 2582 # -
main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py
r15423 r15998 640 640 grok.order(6) 641 641 642 class UpdateCourseTicketsActionButton(ManageActionButton): 643 """ 'Update credits in course tickets' button for courses. 644 """ 645 grok.context(ICourse) 646 grok.view(CoursePage) 647 grok.name('updatecoursetickets') 648 grok.require('waeup.editScores') 649 icon = 'actionicon_reload.png' 650 target = 'update_coursetickets' 651 grok.order(7) 652 653 @property 654 def target_url(self): 655 ca = grok.getSite()[ 656 'configuration'].current_academic_session 657 if not ca: 658 return '' 659 return self.view.url(self.view.context, self.target) 660 661 @property 662 def text(self): 663 ca = grok.getSite()[ 664 'configuration'].current_academic_session 665 st = academic_sessions_vocab.getTerm(ca).title 666 return _('Update session ${a} credits', mapping = {'a':st}) 667 668 @property 669 def onclick(self): 670 current_academic_session = grok.getSite()[ 671 'configuration'].current_academic_session 672 if not current_academic_session: 673 return 674 message = _("All current session (%s/%s) course tickets of students, " 675 "who paid school fee but not yet registered their courses, " 676 "will be updated.\\n\\n" 677 "You really want to update?") % ( 678 current_academic_session, current_academic_session+1) 679 return "return window.confirm('%s');" % message 680 642 681 class DownloadCSVFileActionButton(ManageActionButton): 643 682 """ 'Download csv file' button for courses.
Note: See TracChangeset for help on using the changeset viewer.