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 / init.rb @ 836:c7ef5a1ed2d3

History | View | Annotate | Download (1.73 KB)

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