##// END OF EJS Templates
Update the issue subject when choosing an issue from the drop down menu....
Update the issue subject when choosing an issue from the drop down menu. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11083 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r10549:f909a8c006d0
r10853:6be315c1ff8e
Show More
versions_helper.rb
57 lines | 2.4 KiB | text/x-ruby | RubyLexer
/ app / helpers / versions_helper.rb
Jean-Philippe Lang
Added encoding comment to helpers (#9792)....
r8090 # encoding: utf-8
#
Jean-Philippe Lang
Adds an option to view issues count by status on the version page (#7921)....
r5059 # Redmine - project management software
Jean-Philippe Lang
Copyright update....
r9453 # Copyright (C) 2006-2012 Jean-Philippe Lang
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Toshi MARUYAMA
remove trailing white-spaces from app/helpers/versions_helper.rb....
r6801 #
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Toshi MARUYAMA
remove trailing white-spaces from app/helpers/versions_helper.rb....
r6801 #
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Jean-Philippe Lang
Initial commit...
r2 module VersionsHelper
Jean-Philippe Lang
Added version details view accessible from the roadmap....
r942
Jean-Philippe Lang
Fixed that roadmap anchor links can be ambigous (#11540)....
r10017 def version_anchor(version)
if @project == version.project
anchor version.name
else
anchor "#{version.project.try(:identifier)}-#{version.name}"
end
end
Jean-Philippe Lang
Ability to disable standard fields on a per tracker basis (#1091)....
r9729 STATUS_BY_CRITERIAS = %w(tracker status priority author assigned_to category)
Toshi MARUYAMA
remove trailing white-spaces from app/helpers/versions_helper.rb....
r6801
Jean-Philippe Lang
Added version details view accessible from the roadmap....
r942 def render_issue_status_by(version, criteria)
Jean-Philippe Lang
Ability to disable standard fields on a per tracker basis (#1091)....
r9729 criteria = 'tracker' unless STATUS_BY_CRITERIAS.include?(criteria)
Toshi MARUYAMA
remove trailing white-spaces from app/helpers/versions_helper.rb....
r6801
Jean-Philippe Lang
Added version details view accessible from the roadmap....
r942 h = Hash.new {|k,v| k[v] = [0, 0]}
begin
# Total issue count
Issue.count(:group => criteria,
:conditions => ["#{Issue.table_name}.fixed_version_id = ?", version.id]).each {|c,s| h[c][0] = s}
# Open issues count
Issue.count(:group => criteria,
:include => :status,
:conditions => ["#{Issue.table_name}.fixed_version_id = ? AND #{IssueStatus.table_name}.is_closed = ?", version.id, false]).each {|c,s| h[c][1] = s}
rescue ActiveRecord::RecordNotFound
# When grouping by an association, Rails throws this exception if there's no result (bug)
end
Jean-Philippe Lang
Issues by Category should show tasks without category (#8106)....
r10549 # Sort with nil keys in last position
counts = h.keys.sort {|a,b| a.nil? ? 1 : (b.nil? ? -1 : a <=> b)}.collect {|k| {:group => k, :total => h[k][0], :open => h[k][1], :closed => (h[k][0] - h[k][1])}}
Jean-Philippe Lang
Added version details view accessible from the roadmap....
r942 max = counts.collect {|c| c[:total]}.max
Toshi MARUYAMA
remove trailing white-spaces from app/helpers/versions_helper.rb....
r6801
Jean-Philippe Lang
Added version details view accessible from the roadmap....
r942 render :partial => 'issue_counts', :locals => {:version => version, :criteria => criteria, :counts => counts, :max => max}
end
Toshi MARUYAMA
remove trailing white-spaces from app/helpers/versions_helper.rb....
r6801
Jean-Philippe Lang
Added version details view accessible from the roadmap....
r942 def status_by_options_for_select(value)
options_for_select(STATUS_BY_CRITERIAS.collect {|criteria| [l("field_#{criteria}".to_sym), criteria]}, value)
end
Jean-Philippe Lang
Initial commit...
r2 end