2015-11-12 09:32:00 +08:00
|
|
|
module OrgMemberHelper
|
|
|
|
include ApplicationHelper
|
2016-09-02 13:25:01 +08:00
|
|
|
|
2015-11-12 09:32:00 +08:00
|
|
|
def find_user_not_in_current_org_by_name org
|
|
|
|
if params[:q] && params[:q].lstrip.rstrip != ""
|
|
|
|
scope = Principal.active.sorted.not_member_of_org(org).like(params[:q])
|
|
|
|
else
|
|
|
|
scope = []
|
|
|
|
end
|
|
|
|
principals = paginateHelper scope,10
|
2016-08-29 16:39:13 +08:00
|
|
|
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals')
|
2015-11-12 09:32:00 +08:00
|
|
|
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
|
2016-03-18 16:35:36 +08:00
|
|
|
link_to text, host_with_protocol + "/org_member/org_member_autocomplete?" + parameters.merge(:q => params[:q],:flag => true,:org=> org, :format => 'js').to_query, :remote => true
|
2015-11-12 09:32:00 +08:00
|
|
|
}
|
2015-11-12 19:37:28 +08:00
|
|
|
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" )
|
2015-11-12 09:32:00 +08:00
|
|
|
end
|
|
|
|
end
|