def process_request(self, req): req.perm.assert_permission('STRACTISTICS_VIEW') add_stylesheet(req, 'hw/css/stractistics.css') add_script(req, 'hw/javascript/swfobject.js') add_script(req, 'hw/javascript/prototype.js') add_script(req, 'hw/javascript/js-ofc-library/ofc.js') add_script(req, 'hw/javascript/js-ofc-library/data.js') add_script(req, 'hw/javascript/js-ofc-library/charts/area.js') add_script(req, 'hw/javascript/js-ofc-library/charts/bar.js') add_script(req, 'hw/javascript/js-ofc-library/charts/line.js') add_script(req, 'hw/javascript/js-ofc-library/charts/pie.js') add_script(req, 'hw/javascript/chart_reports.js') add_ctxtnav(req, 'Project Reports', req.href.stractistics("/project_reports")) add_ctxtnav(req, 'User Reports', req.href.stractistics("/user_reports")) #Reading options from trac.ini config = read_config_options(self.env.config) db = self.env.get_db_cnx() module = req.args.get('module', None) if module is not None and module == 'user_reports': template, data = user_reports(req, config, db) else: template, data = global_reports(req, config, db) data['json'] = { 'repository_activity': json.dumps(data['repository_activity'].get_data()), 'ticket_activity': json.dumps(data['ticket_activity'].get_data()), 'wiki_activity': json.dumps(data['wiki_activity'].get_data()), } return template, data, None
def process_request(self, req): req.perm.assert_permission('STRACTISTICS_VIEW') add_stylesheet(req, 'hw/css/stractistics.css') #Reading options from trac.ini config = util.read_config_options(self.env.config) #Patch for Trac 0.11 if trac.__version__.find('0.11') != -1: chrome = Chrome(self.env) chrome.populate_hdf(req) #Populating our context navigation bar. strac_ref = req.href.stractistics() links = [] for elem in self.sections: links.append((elem[0], "/".join([strac_ref, elem[1]]))) req.hdf['section_links'] = links db = self.env.get_db_cnx() module = req.args.get('module', None) if module is not None and module == 'user_reports': template, content_type = user_reports.user_reports(req, config, db) else: template, content_type = global_reports.global_reports(req, config, db) return template, content_type
def process_request(self, req): req.perm.assert_permission('STRACTISTICS_VIEW') add_stylesheet(req, 'hw/css/stractistics.css') #Reading options from trac.ini config = util.read_config_options(self.env.config) #Patch for Trac 0.11 if trac.__version__.find('0.11') != -1: chrome = Chrome(self.env) chrome.populate_hdf(req) #Populating our context navigation bar. strac_ref = req.href.stractistics() links = [] for elem in self.sections: links.append((elem[0], "/".join([strac_ref, elem[1]]))) req.hdf['section_links'] = links db = self.env.get_db_cnx() module = req.args.get('module', None) if module is not None and module == 'user_reports': template, content_type = user_reports.user_reports(req, config, db) else: template, content_type = global_reports.global_reports( req, config, db) return template, content_type