2007-09-23 22:50:53 +04:00
|
|
|
# Redmine sample plugin
|
|
|
|
require 'redmine'
|
|
|
|
|
|
|
|
RAILS_DEFAULT_LOGGER.info 'Starting Example plugin for RedMine'
|
|
|
|
|
|
|
|
Redmine::Plugin.register :sample_plugin do
|
|
|
|
name 'Example plugin'
|
|
|
|
author 'Author name'
|
|
|
|
description 'This is a sample plugin for Redmine'
|
|
|
|
version '0.0.1'
|
2009-07-02 22:40:06 +04:00
|
|
|
settings :default => {'sample_setting' => 'value', 'foo'=>'bar'}, :partial => 'settings/sample_plugin_settings'
|
2007-09-23 22:50:53 +04:00
|
|
|
|
|
|
|
# This plugin adds a project module
|
|
|
|
# It can be enabled/disabled at project level (Project settings -> Modules)
|
|
|
|
project_module :example_module do
|
|
|
|
# A public action
|
|
|
|
permission :example_say_hello, {:example => [:say_hello]}, :public => true
|
|
|
|
# This permission has to be explicitly given
|
|
|
|
# It will be listed on the permissions screen
|
|
|
|
permission :example_say_goodbye, {:example => [:say_goodbye]}
|
2008-07-27 23:10:56 +04:00
|
|
|
# This permission can be given to project members only
|
|
|
|
permission :view_meetings, {:meetings => [:index, :show]}, :require => :member
|
2007-09-23 22:50:53 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
# A new item is added to the project menu
|
2008-02-22 21:19:00 +03:00
|
|
|
menu :project_menu, :sample_plugin, { :controller => 'example', :action => 'say_hello' }, :caption => 'Sample'
|
2008-07-27 23:10:56 +04:00
|
|
|
|
|
|
|
# Meetings are added to the activity view
|
|
|
|
activity_provider :meetings
|
2007-09-23 22:50:53 +04:00
|
|
|
end
|