diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 121b93dc5..fa286b43b 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -2105,7 +2105,8 @@ class UsersController < ApplicationController
project_ids.each do |project_id|
next if ori.blank?
@exist = false
- Project.find(project_id).attachments.each do |att| #如果课程中包含该资源
+ # 如果对象中包含该资源
+ Project.find(project_id).attachments.each do |att|
if att.id == ori.id || (!att.copy_from.nil? && !ori.copy_from.nil? && att.copy_from == ori.copy_from) || att.copy_from == ori.id || att.id == ori.copy_from
att.created_on = Time.now
att.save
@@ -3126,6 +3127,7 @@ class UsersController < ApplicationController
@orgs = @user.organizations.select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0}
end
end
+ @type = params[:type]
@search = params[:search]
#这里仅仅是传递需要发送的资源id
@send_id = params[:send_id]
diff --git a/app/views/users/_org_file_form.html.erb b/app/views/users/_org_file_form.html.erb
index 348a68c00..b4a7bc6ef 100644
--- a/app/views/users/_org_file_form.html.erb
+++ b/app/views/users/_org_file_form.html.erb
@@ -1,4 +1,4 @@
-<%= form_tag add_exist_file_to_org_user_path(user, :type => defined?(type) ? type : "6" ),:remote=>true,:id=>'orgs_list_form' do %>
+<%= form_tag add_exist_file_to_org_user_path(user, :type => @type ),:remote=>true,:id=>'orgs_list_form' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
diff --git a/app/views/users/_project_file_form.html.erb b/app/views/users/_project_file_form.html.erb
index 74e8fecc2..413ffa17a 100644
--- a/app/views/users/_project_file_form.html.erb
+++ b/app/views/users/_project_file_form.html.erb
@@ -1,4 +1,4 @@
-<%= form_tag add_exist_file_to_project_user_path(user, :type => defined?(type) ? type : "6" ), :remote => true, :id => 'projects_list_form' %>
+<%= form_tag add_exist_file_to_project_user_path(user, :type => @type ), :remote => true, :id => 'projects_list_form' %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
diff --git a/app/views/users/_resource_share_for_orgs.html.erb b/app/views/users/_resource_share_for_orgs.html.erb
index 54ff83684..b1736a378 100644
--- a/app/views/users/_resource_share_for_orgs.html.erb
+++ b/app/views/users/_resource_share_for_orgs.html.erb
@@ -7,7 +7,7 @@
- <%= form_tag search_user_org_user_path(user),:method => 'get',
+ <%= form_tag search_user_org_user_path(user, :type => @type),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
@@ -19,5 +19,5 @@
- <%= render :partial => 'users/org_file_form', :locals => {:user => user, :orgs => @orgs, :send_id => send_id, :send_ids => send_ids, :type => type} %>
+ <%= render :partial => 'users/org_file_form', :locals => {:user => user, :orgs => @orgs, :send_id => send_id, :send_ids => send_ids, :type => @type} %>
diff --git a/app/views/users/_resource_share_for_project_popup.html.erb b/app/views/users/_resource_share_for_project_popup.html.erb
index c758ef492..23be825da 100644
--- a/app/views/users/_resource_share_for_project_popup.html.erb
+++ b/app/views/users/_resource_share_for_project_popup.html.erb
@@ -12,7 +12,7 @@
- <%= form_tag search_user_project_user_path(user),:method => 'get',
+ <%= form_tag search_user_project_user_path(user, :type => @type),:method => 'get',
:remote=>true,:id=>'search_user_project_form',:class=>'resourcesSearchBox' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
diff --git a/app/views/users/_resource_share_popup.html.erb b/app/views/users/_resource_share_popup.html.erb
index 3895446f1..93e0d0c47 100644
--- a/app/views/users/_resource_share_popup.html.erb
+++ b/app/views/users/_resource_share_popup.html.erb
@@ -4,7 +4,7 @@
发送到
-
- <%= form_tag search_user_course_user_path(user),:method => 'get',
- :remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %>
- <%= hidden_field_tag(:send_id, send_id) %>
- <%= hidden_field_tag(:send_ids, send_ids) %>
+ <%= form_tag search_user_course_user_path(user),:method => 'get', :remote=>true, :id=> 'search_user_course_form', :class=> 'resourcesSearchBox' do %>
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>