Mercurial > hg > soundsoftware-site
diff vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb @ 477:aeedcec4df5f feature_36
Several changes in the author forms.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 28 Jun 2011 17:42:49 +0100 |
parents | 0ce4139187fa |
children | 7097dc91e58e |
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Fri Jun 24 17:13:29 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Jun 28 17:42:49 2011 +0100 @@ -69,7 +69,11 @@ else logger.error { "current user does not have an author" } @author = User.current.author - end + end + + @own_authorship = Authorship.new :name_on_paper => User.current.name + + @authorship = Authorship.create(:author => @author, :publication => @publication) else # No? Then render an action. @@ -204,15 +208,19 @@ def autocomplete_for_project @publication = Publication.find(params[:id]) - - logger.error "aaaaaaaa" - logger.error { @publication.id } - + @projects = Project.active.like(params[:q]).find(:all, :limit => 100) - @publication.projects logger.debug "Query for \"#{params[:q]}\" returned \"#{@projects.size}\" results" render :layout => false end + def autocomplete_for_author + @publication = Publication.find(params[:id]) + + @authors = Authors.active.like(params[:q]).find(:all, :limit => 100) - @publication.authors + logger.debug "Query for \"#{params[:q]}\" returned \"#{@authors.size}\" results" + render :layout => false + end def sort_authors params[:authors].each_with_index do |id, index|