diff vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb @ 539:d4bf55b01092 feature_36

Fixed Bug #233.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 27 Jul 2011 18:39:46 +0100
parents e25248ba597c
children f05f3a9ef569
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb	Wed Jul 27 16:49:38 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb	Wed Jul 27 18:39:46 2011 +0100
@@ -6,30 +6,26 @@
   # before_filter :find_project, :except => [:autocomplete_for_project, :add_author, :sort_authors, :autocomplete_for_author]
     
   def new
-    @publication = Publication.new      
+    find_project_by_project_id
+    @publication = Publication.new
     
     # we'll always want a new publication to have its bibtex entry
-    # @publication.build_bibtex_entry
+    @publication.build_bibtex_entry
     
     # and at least one author
     # @publication.authorships.build.build_author
     
     @project_id = params[:project_id]
-    @current_user = User.current
+    @current_user = User.current    
   end
 
 
-  def create
+  def create    
+    find_project_by_project_id
+    
     @publication = Publication.new(params[:publication])
-    
-    logger.error { "PUBLICATION CREATE ACTION" }
-    logger.error { params[:publication]  }
-        
-    @project = Project.find(params[:project_id])
 
-    logger.error { "PARAMS publication" }
-    logger.error { params[:publication] }
-    
+    # @project = Project.find(params[:project_id])
     @publication.projects << @project
     
     if @publication.save