To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / vendor / plugins / redmine_bibliography / app / controllers / publications_controller.rb @ 390:5562a95edbf7

History | View | Annotate | Download (1.48 KB)

1 385:a6f8c0584a92 luis
# vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
2
3 328:aed18b463206 luis
class PublicationsController < ApplicationController
4
5 385:a6f8c0584a92 luis
  # parse string with bibtex authors
6
  # return an ordered array
7
  def parse_authors
8
9
  end
10
11
  def parse_bibtex_file
12
13
  end
14
15 384:4be6b16bc6f9 luis
  def parse_bibtex_text
16
    bibtex_entry = params[:bibtex_entry]
17
18 385:a6f8c0584a92 luis
    if bibtex_entry
19
      bib = BibTeX.parse bibtex_entry
20
21
      # parses the bibtex entries
22
      bib.data.map do |d|
23
        result = ''
24
        if d.class == BibTeX::Entry
25
          #    d.replace!(bib.strings)
26
          result = [d.author, '. ', d.title].join
27
        end
28 384:4be6b16bc6f9 luis
29 385:a6f8c0584a92 luis
        logger.error result
30 384:4be6b16bc6f9 luis
      end
31
    end
32
  end
33
34 385:a6f8c0584a92 luis
  def new
35
    @publication = Publication.new
36 386:8ed0a0a268e0 luis
    @publication.current_step = session[:publication_step]
37 390:5562a95edbf7 luis
38
    logger.error @publication.current_step
39
40
41 328:aed18b463206 luis
  end
42
43 390:5562a95edbf7 luis
  def create
44
    @publication = Publication.new(params[:publication])
45 384:4be6b16bc6f9 luis
46 390:5562a95edbf7 luis
    @publication.current_step = session[:publication_step]
47 384:4be6b16bc6f9 luis
48 390:5562a95edbf7 luis
    if params[:back_button]
49
      @publication.previous_step
50
    else
51
      @publication.next_step
52
    end
53
54
    session[:publication_step] = @publication.current_step
55
56
    logger.error "AAAA"
57
    logger.error session[:publication_step]
58
59
60
    render "new"
61 329:4575b631f6ce luis
  end
62
63
  def index
64
    @publications = Publication.find(:all)
65 328:aed18b463206 luis
  end
66
67
  def edit
68 384:4be6b16bc6f9 luis
    logger.error "AAAA edit"
69 376:ad71d0604ac2 luis
70 328:aed18b463206 luis
  end
71
72
  def update
73 384:4be6b16bc6f9 luis
74
    logger.error "AAAA update"
75 376:ad71d0604ac2 luis
76
77 328:aed18b463206 luis
  end
78 329:4575b631f6ce luis
79
  def show
80
    @publication = Publication.find(params[id])
81
    @authors = @publication.authors
82
  end
83
84
85 328:aed18b463206 luis
end