Revision 403:b15397a5341c vendor/plugins/redmine_bibliography

View differences:

vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
15 15
  def parse_bibtex_text
16 16
    bibtex_entry = params[:bibtex_entry]
17 17

  
18
    logger.error bibtex_entry
19

  
18 20
    if bibtex_entry
19 21
      bib = BibTeX.parse bibtex_entry
20 22

  
......
26 28
          #    d.replace!(bib.strings)
27 29

  
28 30
          d.fields.keys.map do |k|
29
            @bentry[k] = d[k]
31
            if k == "title"
32
              @publication.title = d[k]
33
            else
34
              @bentry[k] = d[k]
35
            end
30 36
          end
31
        end                
37
        end               
32 38
      end
33

  
39
      
34 40
      @publication.bibtex_entry = @bentry
41
      
42
      if @publication.save
43
        logger.error "SAVED"
44
      else
45
        logger.error "NOT SAVED"
46
      end
35 47

  
36 48
      logger.error @publication.bibtex_entry
37 49

  
......
50 62

  
51 63
    parse_bibtex_text
52 64

  
53
    if @publication.save
54
      logger.error "SAVED"
55
    else
56
      logger.error "NOT SAVED"
57
    end
65

  
58 66

  
59 67
    if params[:back_button]
60 68
      @publication.previous_step
vendor/plugins/redmine_bibliography/app/models/author.rb
1 1
class Author < ActiveRecord::Base
2 2
  has_many :authorships
3 3
  has_many :publications, :through => :authorships
4

  
5
  belongs_to :user
6
  
4 7
end

Also available in: Unified diff