# HG changeset patch # User luisf # Date 1314107367 -3600 # Node ID 3b63cea01e7bd8e542209d62ab3a289a61da8b29 # Parent 8fa35731c95990d5c9e58ae16b801734ff2cb251 Fixes bug preventing Projects being associated with newly created publications. diff -r 8fa35731c959 -r 3b63cea01e7b vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Aug 23 13:45:30 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Aug 23 14:49:27 2011 +0100 @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb class PublicationsController < ApplicationController @@ -21,19 +22,18 @@ end def create - @project_id = params[:project_id] + @project = Project.find(params[:project_id]) + @author_options = Authorship.like_unique(User.name).find(:all, :limit => 100) @publication = Publication.new(params[:publication]) - - # @project = Project.find(params[:project_id]) @publication.projects << @project unless @project.nil? if @publication.save flash[:notice] = "Successfully created publication." - redirect_to :action => :show, :id => @publication, :project_id => @project_id + redirect_to :action => :show, :id => @publication, :project_id => @project else - render :action => 'new', :project_id => @project_id + render :action => 'new', :project_id => @project end end diff -r 8fa35731c959 -r 3b63cea01e7b vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb Tue Aug 23 13:45:30 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb Tue Aug 23 14:49:27 2011 +0100 @@ -4,7 +4,7 @@

<%=l(:label_publication_show)%>

-<% form_for @publication, :url => { :project_id => @project_id, :action => :update }, :builder => TabularFormBuilder do |f| -%> +<% form_for @publication, :url => { :project_id => @project, :action => :update }, :builder => TabularFormBuilder do |f| -%> <%= render :partial => 'form', :locals => { :f => f } %>
diff -r 8fa35731c959 -r 3b63cea01e7b vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Tue Aug 23 13:45:30 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Tue Aug 23 14:49:27 2011 +0100 @@ -4,7 +4,7 @@

<%=l(:label_publication_new)%>

-<% form_for @publication, :url => { :project_id => @project_id, :action => :create }, :builder => TabularFormBuilder do |f| -%> +<% form_for @publication, :url => { :project_id => @project, :action => :create }, :builder => TabularFormBuilder do |f| -%> <%= render :partial => 'form', :locals => { :f => f } %>
<%= f.submit %> diff -r 8fa35731c959 -r 3b63cea01e7b vendor/plugins/redmine_bibliography/config/locales/en.yml --- a/vendor/plugins/redmine_bibliography/config/locales/en.yml Tue Aug 23 13:45:30 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml Tue Aug 23 14:49:27 2011 +0100 @@ -11,7 +11,7 @@ label_all_publications: All Publications label_all_publications_for_project: Publications associated with %{project} label_authors_show: "Authorships by this author" - label_authors_show: "List of authors" + label_authors_index: "List of authors" field_authorship_publication_title: "Publication Title" field_authorship_name: "Name"