Preserve status filter and page number when using lock/unlock/activate links on the users list (closes #998).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1334 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2008-04-06 13:15:09 +00:00
1 parent beff2c54bc
commit 0249ae5f50
3 files changed
+15 -12

No files matched your search

+12
View File
@@ -22,4 +22,16 @@ module UsersHelper
[l(:status_registered), 2],
[l(:status_locked), 3]], selected)
end
def change_status_link(user)
url = {:action => 'edit', :id => user, :page => params[:page], :status => params[:status]}
if user.locked?
link_to l(:button_unlock), url.merge(:user => {:status => User::STATUS_ACTIVE}), :method => :post, :class => 'icon icon-unlock'
elsif user.registered?
link_to l(:button_activate), url.merge(:user => {:status => User::STATUS_ACTIVE}), :method => :post, :class => 'icon icon-unlock'
else
link_to l(:button_lock), url.merge(:user => {:status => User::STATUS_LOCKED}), :method => :post, :class => 'icon icon-lock'
end
end
end