# HG changeset patch # User Chris Cannam # Date 1381480449 -3600 # Node ID 7465cceb8dfc72843cb1a9578ca387327ace974f # Parent 303b9be118d40df9918acec5d0b485aa15325447# Parent 2b7911132501a1a81a8777a9d523703f139e18a9 Merge from live branch diff -r 303b9be118d4 -r 7465cceb8dfc plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Oct 09 17:42:12 2013 +0100 +++ b/plugins/redmine_bibliography/app/controllers/publications_controller.rb Fri Oct 11 09:34:09 2013 +0100 @@ -82,10 +82,8 @@ def edit find_project_by_project_id unless params[:project_id].nil? - @edit_view = true; @publication = Publication.find(params[:id]) @selected_bibtex_entry_type_id = @publication.bibtex_entry.entry_type - @bibtype_fields = BibtexEntryType.fields(@selected_bibtex_entry_type_id) end @@ -202,10 +200,8 @@ object_id = params[:object_id] @object_name = "publications[authorships_attributes][#{object_id}][search_results]" - # cc 20110909 -- revert to like instead of like_unique -- see #289 - authorships_list = Authorship.like(params[:term]).group('author_id').find(:all, :limit => 100) - - authors_list = authorships_list.collect do |x| x.author end + # todo: make sure query works with both pgres and mysql ~lf.20131010 + authors_list = Author.joins(:authorships).where("LOWER(authorships.name_on_paper) LIKE LOWER(?)", "%#{params[:term]}%").uniq users_list = User.active.like(params[:term]).find(:all, :limit => 100) diff -r 303b9be118d4 -r 7465cceb8dfc plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb --- a/plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb Wed Oct 09 17:42:12 2013 +0100 +++ b/plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb Fri Oct 11 09:34:09 2013 +0100 @@ -7,7 +7,11 @@

<%= f.check_box :search_author_tie, :label => '' -%> - Not associated with any SoundSoftware site user. + <% unless f.object.search_author_tie %> + Not associated with any SoundSoftware site user. + <% else %> + Associated with <%= render_authorship_link(f.object.search_author_class, f.object.search_author_id) -%>. + <% end %>

<%= f.hidden_field :search_author_class -%>