添加项目成员界面,显示用户的account
This commit is contained in:
parent
4235ca8984
commit
6f0e621f3c
|
@ -390,6 +390,16 @@ module ApplicationHelper
|
||||||
s.html_safe
|
s.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#扩展的checkbox生成
|
||||||
|
def principals_check_box_tags_ex(name, principals)
|
||||||
|
s = ''
|
||||||
|
principals.each do |principal|
|
||||||
|
s << "<label>#{ check_box_tag name, principal.id, false, :id => nil } #{h principal.userInfo }</label>\n"
|
||||||
|
end
|
||||||
|
s.html_safe
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# Returns a string for users/groups option tags
|
# Returns a string for users/groups option tags
|
||||||
def principals_options_for_select(collection, selected=nil)
|
def principals_options_for_select(collection, selected=nil)
|
||||||
s = ''
|
s = ''
|
||||||
|
|
|
@ -24,7 +24,7 @@ module MembersHelper
|
||||||
principal_pages = Redmine::Pagination::Paginator.new principal_count, 10, params['page'] #by young
|
principal_pages = Redmine::Pagination::Paginator.new principal_count, 10, params['page'] #by young
|
||||||
principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all
|
principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all
|
||||||
|
|
||||||
s = content_tag('div', principals_check_box_tags('membership[user_ids][]', principals), :id => 'principals')
|
s = content_tag('div', principals_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals')
|
||||||
|
|
||||||
links = pagination_links_full(principal_pages, principal_count, :per_page_links => false) {|text, parameters, options|
|
links = pagination_links_full(principal_pages, principal_count, :per_page_links => false) {|text, parameters, options|
|
||||||
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
|
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
|
||||||
|
|
|
@ -190,7 +190,11 @@ class User < Principal
|
||||||
where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
|
where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#选择项目成员时显示的用户信息文字
|
||||||
|
def userInfo
|
||||||
|
info=self.name + ' (' + self.login + ')';
|
||||||
|
end
|
||||||
|
|
||||||
###添加留言 fq
|
###添加留言 fq
|
||||||
def add_jour(user, notes, reference_user_id = 0, options = {})
|
def add_jour(user, notes, reference_user_id = 0, options = {})
|
||||||
|
|
Loading…
Reference in New Issue