def process_request(self, req): req.perm.assert_permission("BURNDOWN_VIEW") db = self.env.get_db_cnx() milestones = dbhelper.get_milestones(db) components = dbhelper.get_components(db) selected_milestone = None if len(milestones) > 0: selected_milestone = dbhelper.get_current_milestone(db, req.args.get("selected_milestone", "")) selected_component = req.args.get("selected_component", "All Components") empty_db_for_testing = req.args.get("empty_db_for_testing", "false") if empty_db_for_testing == "true": req.perm.assert_permission("TRAC_ADMIN") dbhelper.empty_db_for_testing(db) # expose display data to the templates data = {} data["milestones"] = req.hdf["milestones"] = milestones data["components"] = req.hdf["components"] = components data["selected_milestone"] = req.hdf["selected_milestone"] = selected_milestone data["selected_component"] = req.hdf["selected_component"] = selected_component data["draw_graph"] = req.hdf["draw_graph"] = False data["start"] = req.hdf["start"] = False if req.perm.has_permission("BURNDOWN_ADMIN"): data["start"] = req.hdf["start"] = True # show the start and complete milestone buttons to admins if req.args.has_key("start"): self.start_milestone(db, selected_milestone["name"]) data["draw_graph"] = req.hdf["draw_graph"] = True self.update_burndown_data() data["burndown_data"] = req.hdf["burndown_data"] = [] data["burndown_data"] = req.hdf["burndown_data"] = self.get_burndown_data( db, selected_milestone, components, selected_component ) add_stylesheet(req, "hw/css/burndown.css") self.update_burndown_data() if self.tracversion == "0.10": add_script(req, "hw/js/line.js") add_script(req, "hw/js/wz_jsgraphics.js") return "burndown.cs", None else: data["library"] = "" if data["library"] == "flot": add_script(req, "hw/js/jquery.flot.js") else: add_script(req, "hw/js/line.js") add_script(req, "hw/js/wz_jsgraphics.js") return "burndown.html", data, None
def process_request(self, req): req.perm.assert_permission('BURNDOWN_VIEW') db = self.env.get_db_cnx() milestones = dbhelper.get_milestones(db) components = dbhelper.get_components(db) selected_milestone = None if (len(milestones)>0): selected_milestone = dbhelper.get_current_milestone(db, req.args.get('selected_milestone', "")) selected_component = req.args.get('selected_component', 'All Components') empty_db_for_testing = req.args.get('empty_db_for_testing', 'false') if empty_db_for_testing == "true": req.perm.assert_permission('TRAC_ADMIN') dbhelper.empty_db_for_testing(db) # expose display data to the templates data = {} data['milestones'] = req.hdf['milestones'] = milestones data['components'] = req.hdf['components'] = components data['selected_milestone'] = req.hdf['selected_milestone'] = selected_milestone data['selected_component'] = req.hdf['selected_component'] = selected_component data['draw_graph'] = req.hdf['draw_graph'] = False data['start'] = req.hdf['start'] = False if req.perm.has_permission("BURNDOWN_ADMIN"): data['start'] = req.hdf['start'] = True # show the start and complete milestone buttons to admins if req.args.has_key('start'): self.start_milestone(db, selected_milestone['name']) data['draw_graph'] = req.hdf['draw_graph'] = True self.update_burndown_data() data['burndown_data'] = req.hdf['burndown_data'] = [] data['burndown_data'] = req.hdf['burndown_data'] = self.get_burndown_data(db, selected_milestone, components, selected_component) add_stylesheet(req, 'hw/css/burndown.css') self.update_burndown_data() if self.tracversion=="0.10": add_script(req, 'hw/js/line.js') add_script(req, 'hw/js/wz_jsgraphics.js') return 'burndown.cs', None else: data['library'] = '' if data['library'] == 'flot': add_script(req, 'hw/js/jquery.flot.js') else: add_script(req, 'hw/js/line.js') add_script(req, 'hw/js/wz_jsgraphics.js') return 'burndown.html', data, None
def process_request(self, req): req.perm.assert_permission('BURNDOWN_VIEW') db = self.env.get_db_cnx() milestones = dbhelper.get_milestones(db) components = dbhelper.get_components(db) selected_milestone = None if len(milestones) > 0: selected_milestone = dbhelper.get_current_milestone( db, req.args.get('selected_milestone', '')) selected_component = req.args.get('selected_component', 'All Components') empty_db_for_testing = req.args.get('empty_db_for_testing', 'false') if empty_db_for_testing == "true": req.perm.assert_permission('TRAC_ADMIN') dbhelper.empty_db_for_testing(db) # expose display data to the templates data = { 'milestones': milestones, 'components': components, 'selected_milestone': selected_milestone, 'selected_component': selected_component, 'draw_graph': True, 'start': req.perm.has_permission('BURNDOWN_ADMIN'), } if 'start' in req.args: self.start_milestone(db, selected_milestone['name']) self.update_burndown_data() data['burndown_data'] = \ self.get_burndown_data(db, selected_milestone, components, selected_component) add_stylesheet(req, 'hw/css/burndown.css') self.update_burndown_data() data['library'] = '' if data['library'] == 'flot': add_script(req, 'hw/js/jquery.flot.js') else: add_script(req, 'hw/js/line.js') add_script(req, 'hw/js/wz_jsgraphics.js') return 'burndown.html', data, None