ISSUE中指派者按中文姓名排序
This commit is contained in:
parent
00d12fdeb3
commit
f87d1ce3bd
|
@ -20,6 +20,8 @@
|
||||||
module IssuesHelper
|
module IssuesHelper
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
include TagsHelper
|
include TagsHelper
|
||||||
|
require 'iconv'
|
||||||
|
|
||||||
def issue_list(issues, &block)
|
def issue_list(issues, &block)
|
||||||
ancestors = []
|
ancestors = []
|
||||||
issues.each do |issue|
|
issues.each do |issue|
|
||||||
|
@ -119,10 +121,11 @@ module IssuesHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def principals_options_for_isuue_list(project)
|
def principals_options_for_isuue_list(project)
|
||||||
|
conv = Iconv.new("GBK", "utf-8")
|
||||||
if User.current.member_of?(project)
|
if User.current.member_of?(project)
|
||||||
project.members.includes(:user).order("lower(users.login)").map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0])
|
project.members.includes(:user).sort{|x, y| conv.iconv(x.user.lastname) <=> conv.iconv(y.user.lastname)}.map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0])
|
||||||
else
|
else
|
||||||
project.members.includes(:user).order("lower(users.login)").map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["指派给", 0])
|
project.members.includes(:user).sort{|x, y| conv.iconv(x.user.lastname) <=> conv.iconv(y.user.lastname)}.map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["指派给", 0])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -130,7 +133,6 @@ module IssuesHelper
|
||||||
versions = Version.where(:project_id => project, :status => "open").map{|version| [version.name, version.id]}.unshift(["里程碑", 0])
|
versions = Version.where(:project_id => project, :status => "open").map{|version| [version.name, version.id]}.unshift(["里程碑", 0])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def render_issue_subject_with_tree(issue)
|
def render_issue_subject_with_tree(issue)
|
||||||
s = ''
|
s = ''
|
||||||
ancestors = issue.root? ? [] : issue.ancestors.visible.all
|
ancestors = issue.root? ? [] : issue.ancestors.visible.all
|
||||||
|
|
Loading…
Reference in New Issue