Revision 1438:96973aaacd75 plugins
| plugins/redmine_bibliography/app/controllers/publications_controller.rb | ||
|---|---|---|
| 82 | 82 |
def edit |
| 83 | 83 |
find_project_by_project_id unless params[:project_id].nil? |
| 84 | 84 |
|
| 85 |
@edit_view = true; |
|
| 86 | 85 |
@publication = Publication.find(params[:id]) |
| 87 | 86 |
@selected_bibtex_entry_type_id = @publication.bibtex_entry.entry_type |
| 88 |
|
|
| 89 | 87 |
@bibtype_fields = BibtexEntryType.fields(@selected_bibtex_entry_type_id) |
| 90 | 88 |
end |
| 91 | 89 |
|
| ... | ... | |
| 202 | 200 |
object_id = params[:object_id] |
| 203 | 201 |
@object_name = "publications[authorships_attributes][#{object_id}][search_results]"
|
| 204 | 202 |
|
| 205 |
# cc 20110909 -- revert to like instead of like_unique -- see #289 |
|
| 206 |
authorships_list = Authorship.like(params[:term]).group('author_id').find(:all, :limit => 100)
|
|
| 207 |
|
|
| 208 |
authors_list = authorships_list.collect do |x| x.author end |
|
| 203 |
# todo: make sure query works with both pgres and mysql ~lf.20131010 |
|
| 204 |
authors_list = Author.joins(:authorships).where("LOWER(authorships.name_on_paper) LIKE LOWER(?)", "%#{params[:term]}%").uniq
|
|
| 209 | 205 |
|
| 210 | 206 |
users_list = User.active.like(params[:term]).find(:all, :limit => 100) |
| 211 | 207 |
|
| plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb | ||
|---|---|---|
| 7 | 7 |
|
| 8 | 8 |
<p class="author_associated search_author_tie"> |
| 9 | 9 |
<%= f.check_box :search_author_tie, :label => '' -%> |
| 10 |
<span>Not associated with any SoundSoftware site user.</span> |
|
| 10 |
<% unless f.object.search_author_tie %> |
|
| 11 |
<span>Not associated with any SoundSoftware site user.</span> |
|
| 12 |
<% else %> |
|
| 13 |
<span>Associated with <%= render_authorship_link(f.object.search_author_class, f.object.search_author_id) -%>.</span> |
|
| 14 |
<% end %> |
|
| 11 | 15 |
</p> |
| 12 | 16 |
|
| 13 | 17 |
<%= f.hidden_field :search_author_class -%> |
Also available in: Unified diff