# HG changeset patch # User luisf # Date 1302278932 -3600 # Node ID fecd4b2f4b7777217fd170505f29e7186e23f1db # Parent 5562a95edbf7b99c08179ab51cfc392ac6e3d3a0 fixed multistep form; diff -r 5562a95edbf7 -r fecd4b2f4b77 vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Apr 07 17:11:14 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Fri Apr 08 17:08:52 2011 +0100 @@ -23,27 +23,25 @@ result = '' if d.class == BibTeX::Entry # d.replace!(bib.strings) - result = [d.author, '. ', d.title].join + + result = [author, '. ', d.title].join end + end - logger.error result - end end end def new @publication = Publication.new @publication.current_step = session[:publication_step] - - logger.error @publication.current_step - - + end def create @publication = Publication.new(params[:publication]) + @publication.current_step = session[:publication_step] - @publication.current_step = session[:publication_step] + parse_bibtex_text if params[:back_button] @publication.previous_step @@ -53,10 +51,6 @@ session[:publication_step] = @publication.current_step - logger.error "AAAA" - logger.error session[:publication_step] - - render "new" end diff -r 5562a95edbf7 -r fecd4b2f4b77 vendor/plugins/redmine_bibliography/app/models/publication.rb --- a/vendor/plugins/redmine_bibliography/app/models/publication.rb Thu Apr 07 17:11:14 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/models/publication.rb Fri Apr 08 17:08:52 2011 +0100 @@ -17,11 +17,11 @@ end def next_step - self.current_step = step[steps.index(current_step)+1] + self.current_step = steps[steps.index(current_step)+1] end def previous_step - self.current_step = step[steps.index(current_step)-1] + self.current_step = steps[steps.index(current_step)-1] end def first_step? diff -r 5562a95edbf7 -r fecd4b2f4b77 vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Thu Apr 07 17:11:14 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Fri Apr 08 17:08:52 2011 +0100 @@ -1,6 +1,6 @@

New Publication

-<% form_for :publication, :url => { :action => "create" } do |f| %> +<% form_for @publication, :url => { :action => "create" } do |f| %> <% f.error_messages %> <%= render :partial => "#{@publication.current_step}_bibtex_step", :locals => { :f => f } %>