Mercurial > hg > soundsoftware-site
comparison plugins/redmine_bibliography/init.rb @ 1484:51364c0cd58f redmine-2.4-integration
Merge from live branch. Still need to merge manually in files overridden by plugins.
author | Chris Cannam |
---|---|
date | Wed, 15 Jan 2014 09:59:14 +0000 |
parents | e0167f4e1d8a |
children | fa3d9c22497c |
comparison
equal
deleted
inserted
replaced
1464:261b3d9a4903 | 1484:51364c0cd58f |
---|---|
1 require 'redmine' | |
2 | |
3 require 'bibtex' | |
4 require 'citeproc' | |
5 | |
6 # Patches to the Redmine core. | |
7 ActionDispatch::Callbacks.to_prepare do | |
8 require_dependency 'project' | |
9 require_dependency 'user' | |
10 require_dependency 'mailer' | |
11 | |
12 unless Project.included_modules.include? Bibliography::ProjectPublicationsPatch | |
13 Project.send(:include, Bibliography::ProjectPublicationsPatch) | |
14 end | |
15 | |
16 unless User.included_modules.include? Bibliography::UserAuthorPatch | |
17 User.send(:include, Bibliography::UserAuthorPatch) | |
18 end | |
19 | |
20 unless Mailer.included_modules.include? Bibliography::MailerPatch | |
21 Mailer.send(:include, Bibliography::MailerPatch) | |
22 end | |
23 | |
24 unless ProjectsHelper.included_modules.include?(Bibliography::ProjectsHelperPatch) | |
25 ProjectsHelper.send(:include, Bibliography::ProjectsHelperPatch) | |
26 end | |
27 | |
28 unless MyHelper.included_modules.include?(Bibliography::MyHelperPatch) | |
29 MyHelper.send(:include, Bibliography::MyHelperPatch) | |
30 end | |
31 end | |
32 | |
33 | |
34 # Plugin Info | |
35 Redmine::Plugin.register :redmine_bibliography do | |
36 name 'Redmine Bibliography plugin' | |
37 author 'Chris Cannam, Luis Figueira' | |
38 description 'This is a bibliography management plugin for Redmine' | |
39 version '0.0.1' | |
40 url 'http://example.com/path/to/plugin' | |
41 author_url 'http://example.com/about' | |
42 | |
43 settings :default => { 'menu' => 'Publications' }, :partial => 'settings/bibliography' | |
44 | |
45 project_module :redmine_bibliography do | |
46 permission :view_publication, {:publications => :show}, :public => :true | |
47 permission :publications, { :publications => :index }, :public => true | |
48 permission :edit_publication, {:publications => [:edit, :update]} | |
49 permission :add_publication, {:publications => [:new, :create]} | |
50 permission :delete_publication, {:publications => :destroy} | |
51 | |
52 | |
53 end | |
54 | |
55 # extending the Project Menu | |
56 menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] }, | |
57 :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? } | |
58 | |
59 activity_provider :publication, :class_name => 'Publication', :default => true | |
60 | |
61 end | |
62 | |
63 | |
64 |