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 / init.rb @ 1072:872db7098cb9
History | View | Annotate | Download (1.85 KB)
| 1 | 298:a41158bde9e0 | luis | require 'redmine'
|
|---|---|---|---|
| 2 | 454:2f1a308c4c11 | luis | require 'dispatcher'
|
| 3 | |||
| 4 | 945:75351d69e2ba | luis | require 'bibtex'
|
| 5 | require 'citeproc'
|
||
| 6 | |||
| 7 | 454:2f1a308c4c11 | luis | # Patches to the Redmine core.
|
| 8 | Dispatcher.to_prepare :redmine_model_dependencies do |
||
| 9 | require_dependency 'project'
|
||
| 10 | 466:a7dc708d48a1 | luis | require_dependency 'user'
|
| 11 | 651:f029431de4dd | luis | require_dependency 'mailer'
|
| 12 | 454:2f1a308c4c11 | luis | |
| 13 | unless Project.included_modules.include? Bibliography::ProjectPublicationsPatch |
||
| 14 | Project.send(:include, Bibliography::ProjectPublicationsPatch) |
||
| 15 | end
|
||
| 16 | 466:a7dc708d48a1 | luis | |
| 17 | 483:cc267eb99115 | luis | unless User.included_modules.include? Bibliography::UserAuthorPatch |
| 18 | User.send(:include, Bibliography::UserAuthorPatch) |
||
| 19 | 466:a7dc708d48a1 | luis | end
|
| 20 | 649:0aef0738823b | luis | |
| 21 | 651:f029431de4dd | luis | unless Mailer.included_modules.include? Bibliography::MailerPatch |
| 22 | Mailer.send(:include, Bibliography::MailerPatch) |
||
| 23 | 649:0aef0738823b | luis | end
|
| 24 | |||
| 25 | 1070:858f042e8d11 | luis | unless ProjectsHelper.included_modules.include?(Bibliography::ProjectsHelperPatch) |
| 26 | ProjectsHelper.send(:include, Bibliography::ProjectsHelperPatch) |
||
| 27 | 1068:e11d8d13ebc5 | luis | end
|
| 28 | 454:2f1a308c4c11 | luis | end
|
| 29 | 298:a41158bde9e0 | luis | |
| 30 | 455:9761ee24f31d | luis | |
| 31 | # Plugin Info
|
||
| 32 | 298:a41158bde9e0 | luis | Redmine::Plugin.register :redmine_bibliography do |
| 33 | name 'Redmine Bibliography plugin'
|
||
| 34 | author 'Chris Cannam, Luis Figueira'
|
||
| 35 | 455:9761ee24f31d | luis | description 'This is a bibliography management plugin for Redmine'
|
| 36 | 298:a41158bde9e0 | luis | version '0.0.1'
|
| 37 | url 'http://example.com/path/to/plugin'
|
||
| 38 | author_url 'http://example.com/about'
|
||
| 39 | 376:ad71d0604ac2 | luis | |
| 40 | 835:7240e0419aac | chris | settings :default => { 'menu' => 'Publications' }, :partial => 'settings/bibliography' |
| 41 | 454:2f1a308c4c11 | luis | |
| 42 | 455:9761ee24f31d | luis | project_module :redmine_bibliography do |
| 43 | 630:d91ee0e196e5 | luis | permission :publications, { :publications => :index }, :public => true |
| 44 | permission :edit_publication, {:publications => [:edit, :update]} |
||
| 45 | permission :add_publication, {:publications => [:new, :create]} |
||
| 46 | 632:84a746383a5b | luis | permission :delete_publication, {:publications => :destroy} |
| 47 | |||
| 48 | 455:9761ee24f31d | luis | end
|
| 49 | 454:2f1a308c4c11 | luis | |
| 50 | 455:9761ee24f31d | luis | # extending the Project Menu
|
| 51 | 456:773fe1222605 | luis | menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] }, |
| 52 | 455:9761ee24f31d | luis | :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? } |
| 53 | 1068:e11d8d13ebc5 | luis | |
| 54 | 614:712324fee0c0 | luis | end |