def do_get(self, req): from agilo.scrum import SprintController get_team = TeamController.GetTeamCommand(self.env, team=req.args['team']) team = self.controller.process_command(get_team) sprint_controller = SprintController(self.env) get_sprint = SprintController.GetSprintCommand(self.env, sprint=req.args['sprint']) sprint = sprint_controller.process_command(get_sprint) req.perm.assert_permission(Action.TEAM_VIEW, team.resource) # Why don't we have some kind of SPRINT_VIEW permission? cmd = SprintController.GetResourceLoadForDevelopersInSprintCommand(self.env, sprint=sprint.name) data = sprint_controller.process_command(cmd) load_totals = data.load_totals developers = data.developers for developer in developers: self._format_developer_data(req, developer) net_capacity_cmd = SprintController.GetSprintNetCapacityCommand(self.env, sprint=sprint.name) net_capacity = sprint_controller.process_command(net_capacity_cmd) team.net_capacity = TimePropertyRenderer(self.env, net_capacity).render() add_stylesheet(req, "common/css/report.css") from agilo.scrum.contingent import ContingentWidget contingent_widget = ContingentWidget(self.env, sprint=sprint) contingent_widget.prepare_rendering(req) data = dict(team=team, sprint=sprint, edit_all = req.perm.has_permission(Action.TEAM_CAPACITY_EDIT, team.resource), developers = developers, load_totals = load_totals, contingent_widget = contingent_widget, ) return data
def _get_resource_load_for_developers(self): cmd = SprintController.GetResourceLoadForDevelopersInSprintCommand( self.env, sprint=self.sprint) data = self.controller.process_command(cmd) return data.developers