|
|
|
@ -13,12 +13,53 @@ require 'rails/engine' |
|
|
|
|
|
|
|
|
|
module OpenProject::Meeting |
|
|
|
|
class Engine < ::Rails::Engine |
|
|
|
|
|
|
|
|
|
initializer 'openproject_meeting.precompile_assets' do |app| |
|
|
|
|
app.config.assets.precompile += ["openproject_meeting.css"] |
|
|
|
|
engine_name :openproject_meeting |
|
|
|
|
|
|
|
|
|
config.autoload_paths += Dir["#{config.root}/lib/"] |
|
|
|
|
|
|
|
|
|
spec = Bundler.environment.specs['openproject-meeting'][0] |
|
|
|
|
initializer 'meeting.register_plugin' do |
|
|
|
|
Redmine::Plugin.register :openproject_meeting do |
|
|
|
|
|
|
|
|
|
name 'OpenProject Meeting' |
|
|
|
|
author ((spec.authors.kind_of? Array) ? spec.authors[0] : spec.authors) |
|
|
|
|
author_url spec.homepage |
|
|
|
|
description spec.description |
|
|
|
|
version spec.version |
|
|
|
|
url 'https://www.openproject.org/projects/plugin-meetings' |
|
|
|
|
|
|
|
|
|
requires_openproject ">= 3.0.0pre9" |
|
|
|
|
|
|
|
|
|
project_module :meetings do |
|
|
|
|
permission :create_meetings, {:meetings => [:new, :create, :copy]}, :require => :member |
|
|
|
|
permission :edit_meetings, {:meetings => [:edit, :update]}, :require => :member |
|
|
|
|
permission :delete_meetings, {:meetings => [:destroy]}, :require => :member |
|
|
|
|
permission :view_meetings, {:meetings => [:index, :show], :meeting_agendas => [:history, :show, :diff], :meeting_minutes => [:history, :show, :diff]} |
|
|
|
|
permission :create_meeting_agendas, {:meeting_agendas => [:update, :preview]}, :require => :member |
|
|
|
|
permission :close_meeting_agendas, {:meeting_agendas => [:close, :open]}, :require => :member |
|
|
|
|
permission :send_meeting_agendas_notification, {:meeting_agendas => [:notify]}, :require => :member |
|
|
|
|
permission :create_meeting_minutes, {:meeting_minutes => [:update, :preview]}, :require => :member |
|
|
|
|
permission :send_meeting_minutes_notification, {:meeting_minutes => [:notify]}, :require => :member |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
Redmine::Search.map do |search| |
|
|
|
|
search.register :meetings |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
menu :project_menu, :meetings, {:controller => 'meetings', :action => 'index'}, :caption => :project_module_meetings, :param => :project_id, :after => :wiki |
|
|
|
|
menu :project_menu, :new_meeting, {:controller => 'meetings', :action => 'new'}, :param => :project_id, :caption => :label_meeting_new, :parent => :meetings |
|
|
|
|
|
|
|
|
|
ActiveSupport::Inflector.inflections do |inflect| |
|
|
|
|
inflect.uncountable "meeting_minutes" |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
initializer 'meeting.precompile_assets' do |app| |
|
|
|
|
app.config.assets.precompile += ["meeting.css"] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
initializer 'openproject_meeting.register_path_to_rspec' do |app| |
|
|
|
|
initializer 'meeting.register_path_to_rspec' do |app| |
|
|
|
|
app.config.plugins_to_test_paths << self.root |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -37,16 +78,17 @@ module OpenProject::Meeting |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# adds our factories to factory girl's load path |
|
|
|
|
initializer "meetings.register_factories", :after => "factory_girl.set_factory_paths" do |app| |
|
|
|
|
initializer "meeting.register_factories", :after => "factory_girl.set_factory_paths" do |app| |
|
|
|
|
FactoryGirl.definition_file_paths << File.expand_path(self.root.to_s + '/spec/factories') if defined?(FactoryGirl) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
initializer "meeting.register_hooks" do |
|
|
|
|
require 'open_project/meeting/hooks' |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
config.to_prepare do |
|
|
|
|
require 'redmine/plugin' |
|
|
|
|
|
|
|
|
|
require_dependency 'open_project/meeting/hooks' |
|
|
|
|
require 'open_project/meeting/patches/project_patch' |
|
|
|
|
Project.send(:include, Patches::ProjectPatch) |
|
|
|
|
require_dependency 'open_project/meeting/patches/project_patch' |
|
|
|
|
|
|
|
|
|
# load classes so that all User.before_destroy filters are loaded |
|
|
|
|
require_dependency 'meeting' |
|
|
|
@ -54,43 +96,6 @@ module OpenProject::Meeting |
|
|
|
|
require_dependency 'meeting_minutes' |
|
|
|
|
require_dependency 'meeting_participant' |
|
|
|
|
|
|
|
|
|
spec = Bundler.environment.specs['openproject-meeting'][0] |
|
|
|
|
|
|
|
|
|
unless Redmine::Plugin.registered_plugins.include?(:openproject_meeting) |
|
|
|
|
Redmine::Plugin.register :openproject_meeting do |
|
|
|
|
name 'OpenProject Meeting' |
|
|
|
|
author ((spec.authors.kind_of? Array) ? spec.authors[0] : spec.authors) |
|
|
|
|
author_url spec.homepage |
|
|
|
|
description spec.description |
|
|
|
|
version spec.version |
|
|
|
|
url 'https://www.openproject.org/projects/plugin-meetings' |
|
|
|
|
|
|
|
|
|
requires_openproject ">= 3.0.0pre9" |
|
|
|
|
|
|
|
|
|
project_module :meetings do |
|
|
|
|
permission :create_meetings, {:meetings => [:new, :create, :copy]}, :require => :member |
|
|
|
|
permission :edit_meetings, {:meetings => [:edit, :update]}, :require => :member |
|
|
|
|
permission :delete_meetings, {:meetings => [:destroy]}, :require => :member |
|
|
|
|
permission :view_meetings, {:meetings => [:index, :show], :meeting_agendas => [:history, :show, :diff], :meeting_minutes => [:history, :show, :diff]} |
|
|
|
|
permission :create_meeting_agendas, {:meeting_agendas => [:update, :preview]}, :require => :member |
|
|
|
|
permission :close_meeting_agendas, {:meeting_agendas => [:close, :open]}, :require => :member |
|
|
|
|
permission :send_meeting_agendas_notification, {:meeting_agendas => [:notify]}, :require => :member |
|
|
|
|
permission :create_meeting_minutes, {:meeting_minutes => [:update, :preview]}, :require => :member |
|
|
|
|
permission :send_meeting_minutes_notification, {:meeting_minutes => [:notify]}, :require => :member |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
Redmine::Search.map do |search| |
|
|
|
|
search.register :meetings |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
menu :project_menu, :meetings, {:controller => 'meetings', :action => 'index'}, :caption => :project_module_meetings, :param => :project_id, :after => :wiki |
|
|
|
|
menu :project_menu, :new_meeting, {:controller => 'meetings', :action => 'new'}, :param => :project_id, :caption => :label_meeting_new, :parent => :meetings |
|
|
|
|
|
|
|
|
|
ActiveSupport::Inflector.inflections do |inflect| |
|
|
|
|
inflect.uncountable "meeting_minutes" |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|