view vendor/plugins/redmine_bibliography/init.rb @ 457:8aa775cb7c0a feature_36

changes to views and publicatioins controller
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 14 Jun 2011 17:51:26 +0100
parents 773fe1222605
children f2288bb384bb
line wrap: on
line source
require 'redmine'
require 'dispatcher'

RAILS_DEFAULT_LOGGER.info 'Starting Bibliography Plugin for RedMine'

# Patches to the Redmine core.
Dispatcher.to_prepare :redmine_model_dependencies do
  require_dependency 'project'

  unless Project.included_modules.include? Bibliography::ProjectPublicationsPatch
    Project.send(:include, Bibliography::ProjectPublicationsPatch)
  end
end


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

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

  project_module :redmine_bibliography do
    permission :publications, { :publications => :index }, :public => true
    permission :edit_redmine_bibliography, {:redmine_bibliography => [:index, :edit]}
    permission :add_publication, {:redmine_bibliography => :index}, :public => :true
  end

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