From 0a7d1f1efc3faedb2ef250eaaf487b38311aa681 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 17:54:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B5=84=E6=BA=90=E5=BA=93?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B5=84=E6=BA=90=E5=A4=9A=E4=B8=AA=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BF=AE=E5=A4=8D=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E3=80=81=E8=AF=BE=E7=A8=8B=E5=A4=9A=E4=B8=AA=E5=8F=91?= =?UTF-8?q?=E9=80=81=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++- app/views/users/_org_file_form.html.erb | 2 +- app/views/users/_project_file_form.html.erb | 2 +- .../users/_resource_share_for_orgs.html.erb | 4 +-- ..._resource_share_for_project_popup.html.erb | 2 +- .../users/_resource_share_popup.html.erb | 9 +++--- app/views/users/_user_resource_info.html.erb | 2 +- app/views/users/search_user_project.js.erb | 2 -- public/javascripts/application.js | 30 +++++++++++++++++++ 9 files changed, 43 insertions(+), 14 deletions(-) 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 @@
发送到
- @@ -14,10 +14,9 @@
- <%= 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) %>