# HG changeset patch # User luisf # Date 1312384167 -3600 # Node ID 2fe129b04d820371af6ee12a63324cc2f705fd27 # Parent ca9e8e562ea7abf0be1f958a130fac3f0881bcf0 Fixes Bug #222. diff -r ca9e8e562ea7 -r 2fe129b04d82 vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Aug 03 15:41:19 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Aug 03 16:09:27 2011 +0100 @@ -226,9 +226,9 @@ render :layout => false end - def sort_authors - params[:authors].each_with_index do |id, index| - Author.update_all(['order=?', index+1], ['id=?', id]) + def sort_author_order + params[:authorships].each_with_index do |id, index| + Authorship.update_all(['auth_order=?', index+1], ['id=?', id]) end render :nothing => true end diff -r ca9e8e562ea7 -r 2fe129b04d82 vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb Wed Aug 03 15:41:19 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb Wed Aug 03 16:09:27 2011 +0100 @@ -13,7 +13,7 @@ <% end %> <% end %> -<%= sortable_element("authorships", :url => { :controller => :publications, :action => :sort_authors }) %> +<%= sortable_element("authorships", :url => { :controller => :publications, :action => :sort_author_order }) %>
diff -r ca9e8e562ea7 -r 2fe129b04d82 vendor/plugins/redmine_bibliography/config/routes.rb --- a/vendor/plugins/redmine_bibliography/config/routes.rb Wed Aug 03 15:41:19 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/config/routes.rb Wed Aug 03 16:09:27 2011 +0100 @@ -1,3 +1,3 @@ ActionController::Routing::Routes.draw do |map| - map.resources :publications, :collection => { :sort_authors => :post } + map.resources :publications, :collection => { :sort_author_order => :post } end \ No newline at end of file