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 @ 461:841b2e40895d

History | View | Annotate | Download (1.41 KB)

1
require 'redmine'
2
require 'dispatcher'
3

    
4
RAILS_DEFAULT_LOGGER.info 'Starting Bibliography Plugin for RedMine'
5

    
6
# Patches to the Redmine core.
7
Dispatcher.to_prepare :redmine_model_dependencies do
8
  require_dependency 'project'
9

    
10
  unless Project.included_modules.include? Bibliography::ProjectPublicationsPatch
11
    Project.send(:include, Bibliography::ProjectPublicationsPatch)
12
  end
13
end
14

    
15

    
16
# Plugin Info
17
Redmine::Plugin.register :redmine_bibliography do
18
  name 'Redmine Bibliography plugin'
19
  author 'Chris Cannam, Luis Figueira'
20
  description 'This is a bibliography management plugin for Redmine'
21
  version '0.0.1'
22
  url 'http://example.com/path/to/plugin'
23
  author_url 'http://example.com/about'
24

    
25
  settings :default => { 'menu' => 'Bibliography' }, :partial => 'settings/bibliography'
26

    
27
  project_module :redmine_bibliography do
28
    permission :publications, { :publications => :index }, :public => true
29
    permission :edit_redmine_bibliography, {:redmine_bibliography => [:edit, :update]}, :public => true
30
    permission :add_publication, {:redmine_bibliography => [:new, :create]}, :public => true
31
  end
32

    
33
  # extending the Project Menu
34
  menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] },
35
   :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? }
36
    
37
end