diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index f885c5c1c..efe968d3b 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1618,8 +1618,10 @@ class UsersController < ApplicationController
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
end
end
+
@status = params[:status]
@type = params[:type]
+ @path = user_resource_user_path(User.current, :type => @type)
@limit = 25
@is_remote = true
@atta_count = @attachments.count
@@ -1677,6 +1679,7 @@ class UsersController < ApplicationController
end
@status = params[:status]
@type = params[:type]
+ @path = user_resource_user_path(User.current, :type => @type)
@limit = 25
@is_remote = true
@atta_count = @attachments.count
@@ -1701,6 +1704,7 @@ class UsersController < ApplicationController
.select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 }
end
@search = params[:search]
+ @type = params[:type]
#这里仅仅是传递需要发送的资源id
@send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids]
@@ -1719,6 +1723,7 @@ class UsersController < ApplicationController
@projects = @user.projects.visible
end
@search = params[:search]
+ @type = params[:type]
#这里仅仅是传递需要发送的资源id
@send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids] #搜索的时候 和 直接 用表格提交的时候的send_ids
@@ -1820,6 +1825,7 @@ class UsersController < ApplicationController
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc")
@type = params[:type]
@limit = 25
+ @path = user_resource_user_path(User.current, :type => @type)
@user = User.current
@is_remote = true
@atta_count = @attachments.count
@@ -1931,6 +1937,7 @@ class UsersController < ApplicationController
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc")
@type = params[:type]
@limit = 25
+ @path = user_resource_user_path(User.current, :type => @type)
@user = User.current
@is_remote = true
@atta_count = @attachments.count
@@ -2029,6 +2036,7 @@ class UsersController < ApplicationController
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc")
@type = params[:type]
@limit = 25
+ @path = user_resource_user_path(User.current, :type => @type)
@user = User.current
@is_remote = true
@atta_count = @attachments.count
@@ -2721,6 +2729,7 @@ class UsersController < ApplicationController
name = "%"+name+"%"
@orgs = User.current.organizations.where("name like ?", name)
@user = User.current
+ @type = params[:type]
respond_to do |format|
format.html {render :layout => 'static_base'}
format.js
diff --git a/app/views/users/_resource_share_for_orgs.html.erb b/app/views/users/_resource_share_for_orgs.html.erb
index 2438727a3..06c3f4ccf 100644
--- a/app/views/users/_resource_share_for_orgs.html.erb
+++ b/app/views/users/_resource_share_for_orgs.html.erb
@@ -20,4 +20,4 @@
<%= render :partial => 'users/org_file_form', :locals => {:user => user, :orgs => @orgs, :send_id => send_id, :send_ids => send_ids} %>
-
\ No newline at end of file
+
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 219db4ffc..2a2401ea4 100644
--- a/app/views/users/_resource_share_for_project_popup.html.erb
+++ b/app/views/users/_resource_share_for_project_popup.html.erb
@@ -24,8 +24,31 @@
<%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
<% end %>
-
diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb
index a545038f1..b8551f7c5 100644
--- a/app/views/users/_resources_list.html.erb
+++ b/app/views/users/_resources_list.html.erb
@@ -27,165 +27,7 @@
<% end %>
diff --git a/app/views/users/_user_resource_info.html.erb b/app/views/users/_user_resource_info.html.erb
index bea78130a..a3bc45481 100644
--- a/app/views/users/_user_resource_info.html.erb
+++ b/app/views/users/_user_resource_info.html.erb
@@ -42,7 +42,190 @@
预览
重命名
- 发送
+ 发送
删除
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/app/views/users/add_exist_file_to_course.js.erb b/app/views/users/add_exist_file_to_course.js.erb
index c05a2ebd0..8db83aefc 100644
--- a/app/views/users/add_exist_file_to_course.js.erb
+++ b/app/views/users/add_exist_file_to_course.js.erb
@@ -1,6 +1,7 @@
<% if @flag == true%>
$("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form',:locals => {:user=>@user,:type=>@type} ) %>');
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
+$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true, :path => @path %>');
$("#res_count").html(0);
$("#checkboxAll").attr('checked',false);
$("#res_all_count").html(<%= @atta_count%>);
diff --git a/app/views/users/add_exist_file_to_org.js.erb b/app/views/users/add_exist_file_to_org.js.erb
index 9bfe1230a..c6e7f4011 100644
--- a/app/views/users/add_exist_file_to_org.js.erb
+++ b/app/views/users/add_exist_file_to_org.js.erb
@@ -1,6 +1,7 @@
<% if @flag == true%>
$("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form',:locals => {:user=>@user,:type=>@type} ) %>');
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
+$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true, :path => @path %>');
$("#res_count").html(0);
$("#checkboxAll").attr('checked',false);
$("#res_all_count").html(<%= @atta_count%>);
diff --git a/app/views/users/add_exist_file_to_project.js.erb b/app/views/users/add_exist_file_to_project.js.erb
index ed38fa066..4c24f4932 100644
--- a/app/views/users/add_exist_file_to_project.js.erb
+++ b/app/views/users/add_exist_file_to_project.js.erb
@@ -1,6 +1,7 @@
<% if @flag == true%>
$("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form',:locals => {:user=>@user,:type=>@type} ) %>');
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
+$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true, :path => @path %>');
$("#res_count").html(0);
$("#checkboxAll").attr('checked',false);
$("#res_all_count").html(<%= @atta_count%>);
diff --git a/app/views/users/search_user_project.js.erb b/app/views/users/search_user_project.js.erb
index b431af716..45766b7da 100644
--- a/app/views/users/search_user_project.js.erb
+++ b/app/views/users/search_user_project.js.erb
@@ -2,7 +2,7 @@
<% if params[:send_type].present? && params[:send_type] == 'news' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
<% elsif params[:send_type] == 'file' %>
-$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
+$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids, :type => @type}) %>');
<% elsif params[:send_type] == 'message' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
<% end %>
diff --git a/app/views/users/user_resource_create.js.erb b/app/views/users/user_resource_create.js.erb
index e818f2870..d28898e0a 100644
--- a/app/views/users/user_resource_create.js.erb
+++ b/app/views/users/user_resource_create.js.erb
@@ -1,15 +1,15 @@
-closeModal();
-$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
-$("#resource_tip_list").html('<%= escape_javascript( render :partial => 'users/user_resource_tip_list', :locals => {:user => @user, :type => @type, :status => @status}) %>');
-$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
-$("#res_all_count").html(<%= @atta_count%>);
-$("#res_count").html(0);
-$("#checkboxAll").attr('checked',false);
-//更新状态
-$("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6') %>');
-$("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1') %>');
-$("#resource_type_all").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 1, :search => @switch_search) %>');
-$("#resource_type_course").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 2, :search => @switch_search) %>');
-$("#resource_type_project").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 3, :search => @switch_search) %>');
-$("#resource_type_user").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 5, :search => @switch_search) %>');
+closeModal();
+$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
+$("#resource_tip_list").html('<%= escape_javascript( render :partial => 'users/user_resource_tip_list', :locals => {:user => @user, :type => @type, :status => @status}) %>');
+$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true, :path => @path %>');
+$("#res_all_count").html(<%= @atta_count%>);
+$("#res_count").html(0);
+$("#checkboxAll").attr('checked',false);
+//更新状态
+$("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6') %>');
+$("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1') %>');
+$("#resource_type_all").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 1, :search => @switch_search) %>');
+$("#resource_type_course").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 2, :search => @switch_search) %>');
+$("#resource_type_project").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 3, :search => @switch_search) %>');
+$("#resource_type_user").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 5, :search => @switch_search) %>');
$("#resource_type_file").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 4, :search => @switch_search) %>');
\ No newline at end of file
diff --git a/app/views/users/user_resource_delete.js.erb b/app/views/users/user_resource_delete.js.erb
index 9583274c6..ffb056e28 100644
--- a/app/views/users/user_resource_delete.js.erb
+++ b/app/views/users/user_resource_delete.js.erb
@@ -1,14 +1,14 @@
-$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
-$("#resource_tip_list").html('<%= escape_javascript( render :partial => 'users/user_resource_tip_list', :locals => {:user => @user, :type => @type, :status => @status}) %>');
-$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
-$("#res_all_count").html(<%= @atta_count%>);
-$("#res_count").html(0);
-$("#checkboxAll").attr('checked',false);
-//更新状态
-$("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6') %>');
-$("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1') %>');
-$("#resource_type_all").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 1, :search => @switch_search) %>');
-$("#resource_type_course").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 2, :search => @switch_search) %>');
-$("#resource_type_project").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 3, :search => @switch_search) %>');
-$("#resource_type_user").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 5, :search => @switch_search) %>');
+$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
+$("#resource_tip_list").html('<%= escape_javascript( render :partial => 'users/user_resource_tip_list', :locals => {:user => @user, :type => @type, :status => @status}) %>');
+$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true, :path => @path %>');
+$("#res_all_count").html(<%= @atta_count%>);
+$("#res_count").html(0);
+$("#checkboxAll").attr('checked',false);
+//更新状态
+$("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6') %>');
+$("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1') %>');
+$("#resource_type_all").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 1, :search => @switch_search) %>');
+$("#resource_type_course").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 2, :search => @switch_search) %>');
+$("#resource_type_project").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 3, :search => @switch_search) %>');
+$("#resource_type_user").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 5, :search => @switch_search) %>');
$("#resource_type_file").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 4, :search => @switch_search) %>');
\ No newline at end of file
diff --git a/lib/redmine/pagination.rb b/lib/redmine/pagination.rb
index 41702e2ce..4f1e8ac46 100644
--- a/lib/redmine/pagination.rb
+++ b/lib/redmine/pagination.rb
@@ -163,11 +163,17 @@ module Redmine
# :per_page_links if set to false, the "Per page" links are not rendered
#
def pagination_links_full(*args)
+ page = ""
pagination_links_each(*args) do |text, parameters, options|
if block_given?
yield text, parameters, options
else
- link_to text, params.merge(parameters), options
+ if args[2][:path].nil?
+ link_to text, params.merge(parameters), options
+ else
+ page = "&page" + parameters[:page].to_s unless parameters[:page].nil?
+ link_to text, args[2][:path].to_s + page, options
+ end
end
end
end