To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / vendor / plugins / redmine_bibliography / app / models / bibtex_entry_type.rb @ 1072:872db7098cb9
History | View | Annotate | Download (1.71 KB)
| 1 |
class BibtexEntryType < ActiveRecord::Base |
|---|---|
| 2 |
unloadable |
| 3 |
|
| 4 |
@@fields = Hash['article', ['journal', 'year', 'volume', 'number', 'pages', 'month', 'note' ], |
| 5 |
'book' , [ 'editor', 'publisher', 'volume', 'series', 'address', 'edition', 'month', 'year', 'note' ], |
| 6 |
'booklet' , [ 'howpublished', 'address', 'year', 'month', 'note', 'key' ], |
| 7 |
'conference', [ 'booktitle', 'year', 'editor', 'pages', 'organization', 'publisher', 'address', 'month', 'note' ], |
| 8 |
'inbook', [ 'editor', 'publisher', 'chapter', 'pages', 'volume', 'series', 'address', 'edition', 'year', 'note' ], |
| 9 |
'incollection', [ 'editor', 'publisher', 'chapter', 'pages', 'volume', 'series', 'address', 'edition', 'year', 'note' ], |
| 10 |
'inproceedings', [ 'booktitle', 'year', 'editor', 'pages', 'organization', 'publisher', 'address', 'month', 'note' ], |
| 11 |
'manual', [ 'organization', 'address', 'edition', 'month', 'year', 'note' ], |
| 12 |
'masterthesis', [ 'school', 'year', 'address', 'month', 'note' ], |
| 13 |
'misc', [ 'howpublished', 'month', 'year', 'note' ], |
| 14 |
'phdthesis', [ 'school', 'year', 'address', 'month', 'note' ], |
| 15 |
'proceedings', [ 'booktitle', 'year', 'editor', 'pages', 'organization', 'publisher', 'address', 'month', 'note' ], |
| 16 |
'techreport', [ 'year', 'type', 'number', 'address', 'month', 'note' ], |
| 17 |
'unpublished', [ 'note', 'month', 'year' ]] |
| 18 |
|
| 19 |
def redundant? |
| 20 |
name == 'conference' # conference is a duplicate of inproceedings |
| 21 |
end
|
| 22 |
|
| 23 |
def label |
| 24 |
l("field_bibtex_#{name}")
|
| 25 |
end
|
| 26 |
|
| 27 |
def self.fields (type) |
| 28 |
@@fields[ self.find(type).name ] |
| 29 |
end
|
| 30 |
end
|