diff vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb @ 614:712324fee0c0 feature_36

Started working on Feature #241.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 23 Aug 2011 15:47:15 +0100
parents 3b63cea01e7b
children df7551a82bbe
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb	Tue Aug 23 14:49:27 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb	Tue Aug 23 15:47:15 2011 +0100
@@ -7,6 +7,9 @@
   model_object Publication
   before_filter :find_model_object, :except => [:new, :create, :index, :autocomplete_for_project, :add_author, :sort_author_order, :autocomplete_for_author, :get_user_info ]
   
+  before_filter :find_project_by_project_id, :authorize, :only => :edit
+
+
   # before_filter :find_project, :except => [:autocomplete_for_project, :add_author, :sort_authors, :autocomplete_for_author]
     
   def new
@@ -18,14 +21,16 @@
     
     # and at least one author
     # @publication.authorships.build.build_author        
-    @author_options = Authorship.like_unique(User.name).find(:all, :limit => 100)
+    @author_options = [User.current]
+
+
   end
 
   def create    
     @project = Project.find(params[:project_id])
 
-    @author_options = Authorship.like_unique(User.name).find(:all, :limit => 100)
-        
+    @author_options = [User.current]
+
     @publication = Publication.new(params[:publication])
     @publication.projects << @project unless @project.nil?