添加项目成员界面,显示用户的account

This commit is contained in:
nwb 2014-05-14 16:06:29 +08:00
parent 4235ca8984
commit 6f0e621f3c
3 changed files with 16 additions and 2 deletions

View File

@ -390,6 +390,16 @@ module ApplicationHelper
s.html_safe
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
def principals_options_for_select(collection, selected=nil)
s = ''

View File

@ -24,7 +24,7 @@ module MembersHelper
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
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|
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q], :format => 'js')), :remote => true

View File

@ -190,7 +190,11 @@ class User < Principal
where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
end
}
#选择项目成员时显示的用户信息文字
def userInfo
info=self.name + ' (' + self.login + ')';
end
###添加留言 fq
def add_jour(user, notes, reference_user_id = 0, options = {})