# HG changeset patch # User luisf # Date 1354734795 0 # Node ID b5c396ea06e4b5870576b273314ffbee9bfd773a # Parent 468967d012aae8f9f8d0e9e47a7e764bbc90a82d Saves the temporary publication object, as well as it's id on the form. diff -r 468967d012aa -r b5c396ea06e4 vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Dec 05 16:52:43 2012 +0000 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Dec 05 19:13:15 2012 +0000 @@ -70,7 +70,6 @@ create_bibtex_entry(bib[0]) logger.error { "Bibtex Entry #{@bibtex_entry}" } - @ieee_prev = CiteProc.process bib.to_citeproc, :style => :ieee, :format => :html bibtex_parsed_authors = bib[0].authors @@ -82,12 +81,15 @@ logger.error { "Added Authorship: #{auth}" } end - # can temporarily save + # we can now temporarily save this publication # note that the publication still needs reviewing - @publication.save! + # we are skipping the validation we only have authorships + # associated with the publication at this stage + + # in Rails 3 this should be changed to :validate => false + @publication.save(false) end - # todo: response for HTML format.js end diff -r 468967d012aa -r b5c396ea06e4 vendor/plugins/redmine_bibliography/app/views/publications/new/_bibtex.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/new/_bibtex.html.erb Wed Dec 05 16:52:43 2012 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/new/_bibtex.html.erb Wed Dec 05 19:13:15 2012 +0000 @@ -19,7 +19,7 @@
- <%= hidden_field_tag "publication_id" %> + <%= hidden_field_tag "bibtex_pub_id" %>
<%= f.submit %> diff -r 468967d012aa -r b5c396ea06e4 vendor/plugins/redmine_bibliography/app/views/publications/parse_bibtex.rjs --- a/vendor/plugins/redmine_bibliography/app/views/publications/parse_bibtex.rjs Wed Dec 05 16:52:43 2012 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/parse_bibtex.rjs Wed Dec 05 19:13:15 2012 +0000 @@ -6,7 +6,7 @@ page.insert_html :bottom, :suggest_bibtex_authors, :partial => "suggest_author", :locals => {:suggestions => auth, :index => idx} end - page.replace_html :publication_id, @publication.id + page["bibtex_pub_id"].value = @publication.id else page.insert_html :top, :content, '
Error parsing BibTeX.
'