# HG changeset patch # User luisf # Date 1302622530 -3600 # Node ID b15397a5341c98108815e2a8809594a01990b8e2 # Parent ef8a9bc67e15c3a4b2dc1ab87808147c80e174c6 model changes; diff -r ef8a9bc67e15 -r b15397a5341c app/models/user.rb --- a/app/models/user.rb Tue Apr 12 12:53:16 2011 +0100 +++ b/app/models/user.rb Tue Apr 12 16:35:30 2011 +0100 @@ -53,6 +53,8 @@ has_one :ssamr_user_detail, :dependent => :destroy, :class_name => 'SsamrUserDetail' accepts_nested_attributes_for :ssamr_user_detail + + has_one :author # Active non-anonymous users scope named_scope :active, :conditions => "#{User.table_name}.status = #{STATUS_ACTIVE}" diff -r ef8a9bc67e15 -r b15397a5341c vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Apr 12 12:53:16 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Apr 12 16:35:30 2011 +0100 @@ -15,6 +15,8 @@ def parse_bibtex_text bibtex_entry = params[:bibtex_entry] + logger.error bibtex_entry + if bibtex_entry bib = BibTeX.parse bibtex_entry @@ -26,12 +28,22 @@ # d.replace!(bib.strings) d.fields.keys.map do |k| - @bentry[k] = d[k] + if k == "title" + @publication.title = d[k] + else + @bentry[k] = d[k] + end end - end + end end - + @publication.bibtex_entry = @bentry + + if @publication.save + logger.error "SAVED" + else + logger.error "NOT SAVED" + end logger.error @publication.bibtex_entry @@ -50,11 +62,7 @@ parse_bibtex_text - if @publication.save - logger.error "SAVED" - else - logger.error "NOT SAVED" - end + if params[:back_button] @publication.previous_step diff -r ef8a9bc67e15 -r b15397a5341c vendor/plugins/redmine_bibliography/app/models/author.rb --- a/vendor/plugins/redmine_bibliography/app/models/author.rb Tue Apr 12 12:53:16 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/models/author.rb Tue Apr 12 16:35:30 2011 +0100 @@ -1,4 +1,7 @@ class Author < ActiveRecord::Base has_many :authorships has_many :publications, :through => :authorships + + belongs_to :user + end