Changeset 9637 for main/waeup.kofa


Ignore:
Timestamp:
15 Nov 2012, 14:25:56 (12 years ago)
Author:
Henrik Bettermann
Message:

Add viewlets for reports.py

Add permission to roles.

Set label attribbute of views.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser.py

    r9265 r9637  
    257257    """Link in upper left box to access code management.
    258258    """
    259     grok.order(4)
     259    grok.order(5)
    260260    grok.require('waeup.manageACBatches')
    261261
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/breadcrumbs.py

    r9217 r9637  
    3030    IUniversity, IFacultiesContainer, IUsersContainer, IDataCenter, IFaculty,
    3131    IDepartment, ICourse, ICertificate, ICoursesContainer, ICertificateCourse,
    32     ICertificatesContainer,
     32    ICertificatesContainer
    3333    )
     34from waeup.kofa.reports import IReportsContainer
    3435
    3536class Breadcrumb(grok.Adapter):
     
    157158    grok.context(IDataCenter)
    158159    title = _(u'Data Center')
     160    parent_viewname = 'administration'
     161
     162class ReportsBreadcrumb(Breadcrumb):
     163    """A breadcrumb for reports.
     164    """
     165    grok.context(IReportsContainer)
     166    title = _(u'Reports')
    159167    parent_viewname = 'administration'
    160168
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/reports.py

    r9633 r9637  
    2222from zope.location.location import located
    2323from waeup.kofa.interfaces import IJobManager
     24from waeup.kofa.interfaces import MessageFactory as _
    2425from waeup.kofa.browser.layout import KofaPage
    2526from waeup.kofa.browser.resources import tabs
     
    3536    grok.context(IReportsContainer)
    3637    grok.require('waeup.manageReports')
     38    label = _('Reports')
    3739
    3840    def _report_url(self, job_id):
     
    8688    grok.context(IReportsContainer)
    8789    grok.require('waeup.manageReports')
     90    label = _('Create report')
    8891
    8992    def update(self, START_GENERATOR=None, generator=None):
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py

    r9590 r9637  
    324324    """A link to portal configuration.
    325325    """
    326     grok.order(2)
     326    grok.order(1)
    327327    grok.require('waeup.managePortalConfiguration')
    328328
     
    347347    link = u'datacenter'
    348348    text = _(u'Data Center')
     349
     350class ManageReports(ManageLink):
     351    """A link to reports, placed in upper left box.
     352    """
     353    grok.order(4)
     354    grok.require('waeup.manageReports')
     355
     356    link = u'reports'
     357    text = _(u'Reports')
    349358
    350359class MyPreferences(ManageLink):
     
    658667    link_title = _('Data Center')
    659668    target_viewname = 'datacenter'
     669
     670class AdminTaskReports(AdminTask):
     671    """Entry on administration page that link to datacenter.
     672    """
     673    grok.order(3)
     674    grok.require('waeup.manageReports')
     675
     676    link_title = _('Reports')
     677    target_viewname = 'reports'
    660678
    661679# The SubobjectLister and its viewlets below are not used in Kofa.
  • main/waeup.kofa/trunk/src/waeup/kofa/permissions.py

    r9335 r9637  
    225225                     'waeup.viewHostels', 'waeup.manageHostels',
    226226                     'waeup.editUser',
    227                      'waeup.loginAsStudent'
     227                     'waeup.loginAsStudent',
     228                     'waeup.manageReports',
    228229                     )
    229230
     
    252253                     'waeup.viewHostels', 'waeup.manageHostels',
    253254                     #'waeup.editUser',
    254                      #'waeup.loginAsStudent'
     255                     #'waeup.loginAsStudent',
     256                     'waeup.manageReports',
    255257                     )
    256258
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r9571 r9637  
    21112111                self.flash(_('You are not the owner of this access code.'))
    21122112                return
    2113         if self.context.student.state == CLEARED:
    2114             IWorkflowInfo(self.context.student).fireTransition(
    2115                 'pay_first_school_fee')
    2116         elif self.context.student.state == RETURNING:
    2117             IWorkflowInfo(self.context.student).fireTransition(
    2118                 'pay_school_fee')
    2119         elif self.context.student.state == PAID:
    2120             IWorkflowInfo(self.context.student).fireTransition(
    2121                 'pay_pg_fee')
     2113        try:
     2114            if self.context.student.state == CLEARED:
     2115                IWorkflowInfo(self.context.student).fireTransition(
     2116                    'pay_first_school_fee')
     2117            elif self.context.student.state == RETURNING:
     2118                IWorkflowInfo(self.context.student).fireTransition(
     2119                    'pay_school_fee')
     2120            elif self.context.student.state == PAID:
     2121                IWorkflowInfo(self.context.student).fireTransition(
     2122                    'pay_pg_fee')
     2123        except ConstraintNotSatisfied:
     2124            self.flash(_('An error occurred, please contact the system administrator.'))
     2125            return
    21222126        self.flash(_('Session started.'))
    21232127        self.redirect(self.url(self.context))
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports.py

    r9633 r9637  
    173173    grok.require('waeup.manageReports')
    174174
     175    label = _('Create students report')
     176
    175177    @property
    176178    def generator_name(self):
Note: See TracChangeset for help on using the changeset viewer.