# HG changeset patch # User luisf # Date 1313491650 -3600 # Node ID fcff84e1c1ce7920df9b847491d95a0aa809e627 # Parent 84e8d34d024cc2eea181cad7c16f9deec77c281f In the remote call now only passing the id of the form's object, instead of the complete name of the object. diff -r 84e8d34d024c -r fcff84e1c1ce vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Aug 16 02:06:36 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Aug 16 11:47:30 2011 +0100 @@ -203,7 +203,9 @@ @results = [] - @object_name = params[:object_name] + object_id = params[:object_id] + @object_name = "publications[authorships_attributes][#{object_id}]" + logger.error { "OBJECT NAME #{@object_name}" } diff -r 84e8d34d024c -r fcff84e1c1ce vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb --- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Tue Aug 16 02:06:36 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Tue Aug 16 11:47:30 2011 +0100 @@ -95,6 +95,11 @@ str.to_sym end + def form_object_id(object_name) + str = object_name.split("\[").last().gsub("\]","") + str.to_sym + end + def render_projects_list(publication) logger.error { "PROJECT NAME #{@project.name unless @project.nil?}" } diff -r 84e8d34d024c -r fcff84e1c1ce vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml --- a/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml Tue Aug 16 02:06:36 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml Tue Aug 16 11:47:30 2011 +0100 @@ -5,7 +5,7 @@

<%= f.text_field :search_name, :size => 25 %> - <%= observe_field( form_tag_id(f.object_name, :search_name), :frequency => 0.5, :update => form_tag_id( f.object_name, :identify_author_results), :url => { :controller => 'publications', :action => 'autocomplete_for_author', :object_name => f.object_name }, :with => 'q' ) %> + <%= observe_field( form_tag_id(f.object_name, :search_name), :frequency => 0.5, :update => form_tag_id( f.object_name, :identify_author_results), :url => { :controller => 'publications', :action => 'autocomplete_for_author', :object_name => form_object_id(f.object_name) }, :with => 'q' ) %> <%= link_to_function l(:label_author_is_me), "update_author_info(this," + User.current.get_author_info.to_json + ")", :id => "add_me_as_author" %>
@@ -17,10 +17,12 @@

- <%= f.radio_button :add_this_author, false %> - <%= f.radio_button :add_this_author, false %> - <%= f.radio_button :add_this_author, true %> +

+
+
+
+