Mercurial > hg > soundsoftware-site
comparison vendor/plugins/redmine_bibliography/init.rb @ 1091:3d387b121e85 bibplugin_bibtex
Merge
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Mon, 26 Nov 2012 17:39:51 +0000 |
parents | 74407a04925c |
children |
comparison
equal
deleted
inserted
replaced
1090:cde00909adc8 | 1091:3d387b121e85 |
---|---|
1 require 'redmine' | 1 require 'redmine' |
2 require 'dispatcher' | 2 require 'dispatcher' |
3 | 3 |
4 require 'bibtex' | 4 require 'bibtex' |
5 require 'citeproc' | 5 require 'citeproc' |
6 | |
7 | |
8 RAILS_DEFAULT_LOGGER.info 'Starting Bibliography Plugin for RedMine' | |
9 | 6 |
10 # Patches to the Redmine core. | 7 # Patches to the Redmine core. |
11 Dispatcher.to_prepare :redmine_model_dependencies do | 8 Dispatcher.to_prepare :redmine_model_dependencies do |
12 require_dependency 'project' | 9 require_dependency 'project' |
13 require_dependency 'user' | 10 require_dependency 'user' |
23 | 20 |
24 unless Mailer.included_modules.include? Bibliography::MailerPatch | 21 unless Mailer.included_modules.include? Bibliography::MailerPatch |
25 Mailer.send(:include, Bibliography::MailerPatch) | 22 Mailer.send(:include, Bibliography::MailerPatch) |
26 end | 23 end |
27 | 24 |
28 | 25 unless ProjectsHelper.included_modules.include?(Bibliography::ProjectsHelperPatch) |
26 ProjectsHelper.send(:include, Bibliography::ProjectsHelperPatch) | |
27 end | |
29 end | 28 end |
30 | 29 |
31 | 30 |
32 # Plugin Info | 31 # Plugin Info |
33 Redmine::Plugin.register :redmine_bibliography do | 32 Redmine::Plugin.register :redmine_bibliography do |
39 author_url 'http://example.com/about' | 38 author_url 'http://example.com/about' |
40 | 39 |
41 settings :default => { 'menu' => 'Publications' }, :partial => 'settings/bibliography' | 40 settings :default => { 'menu' => 'Publications' }, :partial => 'settings/bibliography' |
42 | 41 |
43 project_module :redmine_bibliography do | 42 project_module :redmine_bibliography do |
43 permission :view_publication, {:publications => :show}, :public => :true | |
44 permission :publications, { :publications => :index }, :public => true | 44 permission :publications, { :publications => :index }, :public => true |
45 permission :edit_publication, {:publications => [:edit, :update]} | 45 permission :edit_publication, {:publications => [:edit, :update]} |
46 permission :add_publication, {:publications => [:new, :create]} | 46 permission :add_publication, {:publications => [:new, :create]} |
47 permission :delete_publication, {:publications => :destroy} | 47 permission :delete_publication, {:publications => :destroy} |
48 | |
48 | 49 |
49 end | 50 end |
50 | 51 |
51 # extending the Project Menu | 52 # extending the Project Menu |
52 menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] }, | 53 menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] }, |
53 :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? } | 54 :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? } |
54 | 55 |
56 activity_provider :publication, :class_name => 'Publication', :default => true | |
57 | |
55 end | 58 end |
59 | |
60 | |
61 |