Hi,
first off, thanks for the great software to all the developers and supporters. Your work is very much appreciated. ;-) I have just now installed trac 0.11b1 together with several plugins, one of them is the timing estimation and billing plugin (http://trac-hacks.org/wiki/TimingAndEstimationPlugin ) However, this one requires the report module to be enabled, which again has consequences for the "View Ticket" section as well, as it changes it to the now depreciated "Available Reports" page by default, while I would rather have the "Custom Query" still as the default option for "View Tickets". Now, I have figured out how to modify the plugin at least in such a way, that it does not require REPORT_VIEW permission, but uses instead a newly defined TIME_VIEW to be visible only to users with the appropriate rights / settings. Btw. that also seems to make the reports defined for the TimingAndEstimationPlugin non-visible for the ViewTicket/Available Reports (and nicely solving the problem of them not going to work there, anyway). Nonetheless, these still show up under the "Time" Menu (was "Management"), while the original reports for "Available Reports" are still accessible under "View Tickets". Now, my only problem here is, would it be possible -- since Reports are going to be phased out anyway -- to make the "Custom Query" the default page for anyone clicking on "View Tickets", even in the cases where the report_module is enabled in trac.ini? After all, the option for "Available Reports" would still be available to those who need / want them in the upper corner of that page. Thanks a lot Carsten P.S.: If anyone is interested in the patch, here it is: (and yes it is a trivial one) Index: timingandestimationplugin/webui.py =================================================================== --- timingandestimationplugin/webui.py (Revision 2975) +++ timingandestimationplugin/webui.py (Arbeitskopie) @@ -7,6 +7,7 @@ from usermanual import * from trac.log import logger_factory from trac.core import * +from trac.perm import IPermissionRequestor from trac.web import IRequestHandler from trac.util import Markup from trac.web.chrome import add_stylesheet, add_script, \ @@ -18,7 +19,7 @@ #get_statuses = api.get_statuses class TimingEstimationAndBillingPage(Component): - implements(INavigationContributor, IRequestHandler, ITemplateProvider) + implements(IPermissionRequestor, INavigationContributor, IRequestHandler, ITemplateProvider) def __init__(self): pass @@ -38,10 +39,10 @@ """ dbhelper.execute_non_query(self.env.get_db_cnx(), sql, when, now, strwhen) - - - + # IPermissionRequestor methods + def get_permission_actions(self): + return ["TIME_VIEW", "TIME_ADMIN"] # INavigationContributor methods def get_active_navigation_item(self, req): @@ -52,10 +53,10 @@ def get_navigation_items(self, req): url = req.href.Billing() - if req.perm.has_permission("REPORT_VIEW"): + if req.perm.has_permission("TIME_VIEW"): yield 'mainnav', "Billing", \ Markup('<a href="%s">%s</a>' % \ - (url , "Management")) + (url , "Time")) # IRequestHandler methods def set_request_billing_dates(self, data): --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/trac-users?hl=en -~----------~----~----~----~------~----~------~--~---
