diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 121b93dc5..2ebcec009 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1987,7 +1987,7 @@ class UsersController < ApplicationController end end elsif params[:send_ids].present? - send_ids = params[:send_ids].split(" ") + send_ids = params[:send_ids].split(",") course_ids = params[:course_ids] if course_ids.nil? @flag = false @@ -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 @@ -2138,7 +2139,7 @@ class UsersController < ApplicationController @ori = ori end elsif params[:send_ids].present? - send_ids = params[:send_ids].split(" ") + send_ids = params[:send_ids].split(",") project_ids = params[:projects_ids] if project_ids.nil? @flag = false @@ -2285,7 +2286,7 @@ class UsersController < ApplicationController end @ori = ori elsif params[:send_ids].present? - send_ids = params[:send_ids].split(" ") + send_ids = params[:send_ids].split(",") subfield_id = params[:subfield] if subfield_id.nil? @flag = false @@ -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/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4d92808d4..691c2b0ad 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2098,12 +2098,12 @@ module ApplicationHelper def attachment_history_candown attachment_history if attachment_history.container_type == "Course" course = Course.find(attachment_history.container_id) - candown = User.current.member_of?(course) || (course.is_public && attachment_history.is_public == 1) + candown = User.current.member_of_course?(course) || (course.is_public && attachment_history.is_public == 1) elsif attachment_history.container_type == "Project" project = Project.find(attachment_history.container_id) candown = User.current.member_of?(project) || (project.is_public && attachment_history.is_public == 1) elsif attachment_history.container_type == "OrgSubfield" - org = OrgSubfield.find(attachment_history.container_id) + org = OrgSubfield.find(attachment_history.container_id).organization candown = User.current.member_of_org?(org) || (org.organization.is_public && attachment_history.is_public == 1 && (User.current.logged? || org.organization.allow_guest_download?)) end end diff --git a/app/views/attachments/attachment_versions.js.erb b/app/views/attachments/attachment_versions.js.erb index a5bb6672b..ff704a869 100644 --- a/app/views/attachments/attachment_versions.js.erb +++ b/app/views/attachments/attachment_versions.js.erb @@ -2,6 +2,6 @@ $("#ajax-modal").html('<%= escape_javascript( render :partial => 'attachments/sh showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); -$('#ajax-modal').parent().css("top","40%").css("left","50%"); +$('#ajax-modal').parent().css("top","40%").css("left","50%").css("position","fixed"); $('#ajax-modal').parent().addClass("resourceUploadPopup"); $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); \ No newline at end of file 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) %>