comparison app/helpers/.svn/text-base/versions_helper.rb.svn-base @ 441:cbce1fd3b1b7 redmine-1.2

Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author Chris Cannam
date Mon, 06 Jun 2011 14:24:13 +0100
parents 513646585e45
children
comparison
equal deleted inserted replaced
245:051f544170fe 441:cbce1fd3b1b7
1 # redMine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang 2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
15 # along with this program; if not, write to the Free Software 15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 module VersionsHelper 18 module VersionsHelper
19 19
20 STATUS_BY_CRITERIAS = %w(category tracker priority author assigned_to) 20 STATUS_BY_CRITERIAS = %w(category tracker status priority author assigned_to)
21 21
22 def render_issue_status_by(version, criteria) 22 def render_issue_status_by(version, criteria)
23 criteria ||= 'category' 23 criteria = 'category' unless STATUS_BY_CRITERIAS.include?(criteria)
24 raise 'Unknown criteria' unless STATUS_BY_CRITERIAS.include?(criteria)
25 24
26 h = Hash.new {|k,v| k[v] = [0, 0]} 25 h = Hash.new {|k,v| k[v] = [0, 0]}
27 begin 26 begin
28 # Total issue count 27 # Total issue count
29 Issue.count(:group => criteria, 28 Issue.count(:group => criteria,