-
Notifications
You must be signed in to change notification settings - Fork 18
/
init.rb
77 lines (64 loc) · 3.29 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# -*- coding: utf-8 -*-
Dir["#{File.dirname(__FILE__)}/config/initializers/**/*.rb"].sort.each do |initializer|
Kernel.load(initializer)
end
require 'redmine'
require 'cmi/scoreboard_menu_helper_patch'
require 'cmi/time_entry_patch'
require 'cmi/time_entry_reports_common_patch'
require 'cmi/user_patch'
require 'cmi/users_helper_patch'
require 'cmi/project_patch'
require 'cmi/journal_observer_patch'
Redmine::Plugin.register :redmine_cmi do
Rails.configuration.after_initialize do
locale = if Setting.table_exists?
Setting.default_language
else
'en'
end
I18n.with_locale(locale) do
name I18n.t :'cmi.plugin_name'
description I18n.t :'cmi.plugin_description'
author 'Emergya Consultoría'
version '0.9.4.1'
end
end
settings :default => { }, :partial => 'settings/cmi_settings'
requires_redmine :version_or_higher => '1.0.0'
project_module :cmiplugin do
permission :cmi_management, { :management => [:status, :projects, :groups] }
permission :cmi_view_metrics, { :metrics => :show }
permission :cmi_project_info, { :metrics => :info }
permission :cmi_add_checkpoints, { :checkpoints => [:new, :create, :preview] }
permission :cmi_edit_checkpoints, { :checkpoints => [:edit, :update, :preview, :new_journal] }
permission :cmi_add_checkpoint_notes, { :checkpoints => [:edit, :update, :preview, :new_journal] }
permission :cmi_edit_checkpoint_notes, { :checkpoints => [:preview, :edit_journal] }
permission :cmi_edit_own_checkpoint_notes, { :checkpoints => [:preview, :edit_journal] }
permission :cmi_view_checkpoints, { :checkpoints => [:index, :show] }
permission :cmi_delete_checkpoints, { :checkpoints => :destroy }
permission :cmi_add_expenditures, { :expenditures => [:new, :create, :preview] }
permission :cmi_edit_expenditures, { :expenditures => [:edit, :update, :preview, :new_journal] }
permission :cmi_add_expenditure_notes, { :expenditures => [:edit, :update, :preview, :new_journal] }
permission :cmi_edit_expenditure_notes, { :expenditures => [:preview, :edit_journal] }
permission :cmi_edit_own_expenditure_notes, { :expenditures => [:preview, :edit_journal] }
permission :cmi_view_expenditures, { :expenditures => [:index, :show] }
permission :cmi_delete_expenditures, { :expenditures => :destroy }
end
menu :project_menu, :metrics, { :controller => 'metrics', :action => 'show' },
:caption => :'cmi.caption_metrics',
:after => :settings,
:param => :project_id
menu :top_menu, :cmi, { :controller => 'management', :action => 'projects'},
:caption => 'CMI',
:if => Proc.new { User.current.allowed_to?(:cmi_management, nil, :global => true) }
menu :scoreboard_menu, :projects, { :controller => 'management', :action => 'projects' },
:caption => :'cmi.caption_projects'
menu :scoreboard_menu, :status, { :controller => 'management', :action => 'status' },
:caption => :'cmi.caption_status'
menu :scoreboard_menu, :groups, { :controller => 'management', :action => 'groups' },
:caption => :'cmi.caption_groups'
menu :admin_menu, :'cmi.label_cost_history', { :controller => 'admin', :action => 'cost_history' },
:html => { :class => 'issue_statuses' },
:caption => :'cmi.label_cost_history'
end