From 5ee6c9e5d32d00deb8d8fd97446b63b6f74d70b7 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 16 May 2016 18:08:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E5=9F=9F=E5=90=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=88=90=E5=91=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 ++++ app/models/organization.rb | 4 ++++ app/views/organizations/setting.html.erb | 9 +++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 798dd4a3a..babeb5f30 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3087,6 +3087,10 @@ def host_with_protocol return Setting.protocol + "://" + Setting.host_name end +def secdomain_with_protocol secdomain + return Setting.protocol + "://" + secdomain + ".trustie.net" +end + #获取回复的所有父节点 def get_reply_parents parents_rely, comment diff --git a/app/models/organization.rb b/app/models/organization.rb index 311a37bf8..0e845a86f 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -30,4 +30,8 @@ class Organization < ActiveRecord::Base def allow_set_teachers self.allow_teacher.to_i == 1 ? true : false end + + def secdomain + Secdomain.where("sub_type=2 and pid=?", self.id).first.try(:subname) + end end diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 2caeee726..abad63656 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -109,9 +109,14 @@

添加成员

- <%= form_tag url_for(:controller => 'org_member',:action => 'create',:org=>@organization),:id=>'org_member_add_form',:remote=>true do |f|%> + <%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%> - <%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %> + <% if @organization.secdomain.nil? %> + <%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %> + <% else %> + <%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript secdomain_with_protocol(@organization.secdomain) + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %> + <% end %> +
<%= find_user_not_in_current_org_by_name(@project) %>