@@ -0,0 +1,12 | |||
|
1 | class EnableCalendarAndGanttModulesWhereAppropriate < ActiveRecord::Migration | |
|
2 | def self.up | |
|
3 | EnabledModule.find(:all, :conditions => ["name = ?", 'issue_tracking']).each do |e| | |
|
4 | EnabledModule.create(:name => 'calendar', :project_id => e.project_id) | |
|
5 | EnabledModule.create(:name => 'gantt', :project_id => e.project_id) | |
|
6 | end | |
|
7 | end | |
|
8 | ||
|
9 | def self.down | |
|
10 | EnabledModule.delete_all("name = 'calendar' OR name = 'gantt'") | |
|
11 | end | |
|
12 | end |
@@ -1,184 +1,186 | |||
|
1 | 1 | # redMine - project management software |
|
2 | 2 | # Copyright (C) 2006-2007 Jean-Philippe Lang |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
|
5 | 5 | # modify it under the terms of the GNU General Public License |
|
6 | 6 | # as published by the Free Software Foundation; either version 2 |
|
7 | 7 | # of the License, or (at your option) any later version. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU General Public License |
|
15 | 15 | # along with this program; if not, write to the Free Software |
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | |
|
19 | 19 | # DO NOT MODIFY THIS FILE !!! |
|
20 | 20 | # Settings can be defined through the application in Admin -> Settings |
|
21 | 21 | |
|
22 | 22 | app_title: |
|
23 | 23 | default: Redmine |
|
24 | 24 | app_subtitle: |
|
25 | 25 | default: Project management |
|
26 | 26 | welcome_text: |
|
27 | 27 | default: |
|
28 | 28 | login_required: |
|
29 | 29 | default: 0 |
|
30 | 30 | self_registration: |
|
31 | 31 | default: '2' |
|
32 | 32 | lost_password: |
|
33 | 33 | default: 1 |
|
34 | 34 | password_min_length: |
|
35 | 35 | format: int |
|
36 | 36 | default: 4 |
|
37 | 37 | attachment_max_size: |
|
38 | 38 | format: int |
|
39 | 39 | default: 5120 |
|
40 | 40 | issues_export_limit: |
|
41 | 41 | format: int |
|
42 | 42 | default: 500 |
|
43 | 43 | activity_days_default: |
|
44 | 44 | format: int |
|
45 | 45 | default: 30 |
|
46 | 46 | per_page_options: |
|
47 | 47 | default: '25,50,100' |
|
48 | 48 | mail_from: |
|
49 | 49 | default: redmine@example.net |
|
50 | 50 | bcc_recipients: |
|
51 | 51 | default: 1 |
|
52 | 52 | plain_text_mail: |
|
53 | 53 | default: 0 |
|
54 | 54 | text_formatting: |
|
55 | 55 | default: textile |
|
56 | 56 | cache_formatted_text: |
|
57 | 57 | default: 0 |
|
58 | 58 | wiki_compression: |
|
59 | 59 | default: "" |
|
60 | 60 | default_language: |
|
61 | 61 | default: en |
|
62 | 62 | host_name: |
|
63 | 63 | default: localhost:3000 |
|
64 | 64 | protocol: |
|
65 | 65 | default: http |
|
66 | 66 | feeds_limit: |
|
67 | 67 | format: int |
|
68 | 68 | default: 15 |
|
69 | 69 | # Maximum size of files that can be displayed |
|
70 | 70 | # inline through the file viewer (in KB) |
|
71 | 71 | file_max_size_displayed: |
|
72 | 72 | format: int |
|
73 | 73 | default: 512 |
|
74 | 74 | diff_max_lines_displayed: |
|
75 | 75 | format: int |
|
76 | 76 | default: 1500 |
|
77 | 77 | enabled_scm: |
|
78 | 78 | serialized: true |
|
79 | 79 | default: |
|
80 | 80 | - Subversion |
|
81 | 81 | - Darcs |
|
82 | 82 | - Mercurial |
|
83 | 83 | - Cvs |
|
84 | 84 | - Bazaar |
|
85 | 85 | - Git |
|
86 | 86 | autofetch_changesets: |
|
87 | 87 | default: 1 |
|
88 | 88 | sys_api_enabled: |
|
89 | 89 | default: 0 |
|
90 | 90 | sys_api_key: |
|
91 | 91 | default: '' |
|
92 | 92 | commit_ref_keywords: |
|
93 | 93 | default: 'refs,references,IssueID' |
|
94 | 94 | commit_fix_keywords: |
|
95 | 95 | default: 'fixes,closes' |
|
96 | 96 | commit_fix_status_id: |
|
97 | 97 | format: int |
|
98 | 98 | default: 0 |
|
99 | 99 | commit_fix_done_ratio: |
|
100 | 100 | default: 100 |
|
101 | 101 | # autologin duration in days |
|
102 | 102 | # 0 means autologin is disabled |
|
103 | 103 | autologin: |
|
104 | 104 | format: int |
|
105 | 105 | default: 0 |
|
106 | 106 | # date format |
|
107 | 107 | date_format: |
|
108 | 108 | default: '' |
|
109 | 109 | time_format: |
|
110 | 110 | default: '' |
|
111 | 111 | user_format: |
|
112 | 112 | default: :firstname_lastname |
|
113 | 113 | format: symbol |
|
114 | 114 | cross_project_issue_relations: |
|
115 | 115 | default: 0 |
|
116 | 116 | notified_events: |
|
117 | 117 | serialized: true |
|
118 | 118 | default: |
|
119 | 119 | - issue_added |
|
120 | 120 | - issue_updated |
|
121 | 121 | mail_handler_body_delimiters: |
|
122 | 122 | default: '' |
|
123 | 123 | mail_handler_api_enabled: |
|
124 | 124 | default: 0 |
|
125 | 125 | mail_handler_api_key: |
|
126 | 126 | default: |
|
127 | 127 | issue_list_default_columns: |
|
128 | 128 | serialized: true |
|
129 | 129 | default: |
|
130 | 130 | - tracker |
|
131 | 131 | - status |
|
132 | 132 | - priority |
|
133 | 133 | - subject |
|
134 | 134 | - assigned_to |
|
135 | 135 | - updated_on |
|
136 | 136 | display_subprojects_issues: |
|
137 | 137 | default: 1 |
|
138 | 138 | issue_done_ratio: |
|
139 | 139 | default: 'issue_field' |
|
140 | 140 | default_projects_public: |
|
141 | 141 | default: 1 |
|
142 | 142 | default_projects_modules: |
|
143 | 143 | serialized: true |
|
144 | 144 | default: |
|
145 | 145 | - issue_tracking |
|
146 | 146 | - time_tracking |
|
147 | 147 | - news |
|
148 | 148 | - documents |
|
149 | 149 | - files |
|
150 | 150 | - wiki |
|
151 | 151 | - repository |
|
152 | 152 | - boards |
|
153 | - calendar | |
|
154 | - gantt | |
|
153 | 155 | # Role given to a non-admin user who creates a project |
|
154 | 156 | new_project_user_role_id: |
|
155 | 157 | format: int |
|
156 | 158 | default: '' |
|
157 | 159 | sequential_project_identifiers: |
|
158 | 160 | default: 0 |
|
159 | 161 | # encodings used to convert repository files content to UTF-8 |
|
160 | 162 | # multiple values accepted, comma separated |
|
161 | 163 | repositories_encodings: |
|
162 | 164 | default: '' |
|
163 | 165 | # encoding used to convert commit logs to UTF-8 |
|
164 | 166 | commit_logs_encoding: |
|
165 | 167 | default: 'UTF-8' |
|
166 | 168 | repository_log_display_limit: |
|
167 | 169 | format: int |
|
168 | 170 | default: 100 |
|
169 | 171 | ui_theme: |
|
170 | 172 | default: '' |
|
171 | 173 | emails_footer: |
|
172 | 174 | default: |- |
|
173 | 175 | You have received this notification because you have either subscribed to it, or are involved in it. |
|
174 | 176 | To change your notification preferences, please click here: http://hostname/my/account |
|
175 | 177 | gravatar_enabled: |
|
176 | 178 | default: 0 |
|
177 | 179 | openid: |
|
178 | 180 | default: 0 |
|
179 | 181 | gravatar_default: |
|
180 | 182 | default: '' |
|
181 | 183 | start_of_week: |
|
182 | 184 | default: '' |
|
183 | 185 | rest_api_enabled: |
|
184 | 186 | default: 0 |
@@ -1,225 +1,230 | |||
|
1 | 1 | require 'redmine/access_control' |
|
2 | 2 | require 'redmine/menu_manager' |
|
3 | 3 | require 'redmine/activity' |
|
4 | 4 | require 'redmine/search' |
|
5 | 5 | require 'redmine/custom_field_format' |
|
6 | 6 | require 'redmine/mime_type' |
|
7 | 7 | require 'redmine/core_ext' |
|
8 | 8 | require 'redmine/themes' |
|
9 | 9 | require 'redmine/hook' |
|
10 | 10 | require 'redmine/plugin' |
|
11 | 11 | require 'redmine/wiki_formatting' |
|
12 | 12 | require 'redmine/scm/base' |
|
13 | 13 | |
|
14 | 14 | begin |
|
15 | 15 | require_library_or_gem 'RMagick' unless Object.const_defined?(:Magick) |
|
16 | 16 | rescue LoadError |
|
17 | 17 | # RMagick is not available |
|
18 | 18 | end |
|
19 | 19 | |
|
20 | 20 | if RUBY_VERSION < '1.9' |
|
21 | 21 | require 'faster_csv' |
|
22 | 22 | else |
|
23 | 23 | require 'csv' |
|
24 | 24 | FCSV = CSV |
|
25 | 25 | end |
|
26 | 26 | |
|
27 | 27 | Redmine::Scm::Base.add "Subversion" |
|
28 | 28 | Redmine::Scm::Base.add "Darcs" |
|
29 | 29 | Redmine::Scm::Base.add "Mercurial" |
|
30 | 30 | Redmine::Scm::Base.add "Cvs" |
|
31 | 31 | Redmine::Scm::Base.add "Bazaar" |
|
32 | 32 | Redmine::Scm::Base.add "Git" |
|
33 | 33 | Redmine::Scm::Base.add "Filesystem" |
|
34 | 34 | |
|
35 | 35 | Redmine::CustomFieldFormat.map do |fields| |
|
36 | 36 | fields.register Redmine::CustomFieldFormat.new('string', :label => :label_string, :order => 1) |
|
37 | 37 | fields.register Redmine::CustomFieldFormat.new('text', :label => :label_text, :order => 2) |
|
38 | 38 | fields.register Redmine::CustomFieldFormat.new('int', :label => :label_integer, :order => 3) |
|
39 | 39 | fields.register Redmine::CustomFieldFormat.new('float', :label => :label_float, :order => 4) |
|
40 | 40 | fields.register Redmine::CustomFieldFormat.new('list', :label => :label_list, :order => 5) |
|
41 | 41 | fields.register Redmine::CustomFieldFormat.new('date', :label => :label_date, :order => 6) |
|
42 | 42 | fields.register Redmine::CustomFieldFormat.new('bool', :label => :label_boolean, :order => 7) |
|
43 | 43 | end |
|
44 | 44 | |
|
45 | 45 | # Permissions |
|
46 | 46 | Redmine::AccessControl.map do |map| |
|
47 | 47 | map.permission :view_project, {:projects => [:show, :activity]}, :public => true |
|
48 | 48 | map.permission :search_project, {:search => :index}, :public => true |
|
49 | 49 | map.permission :add_project, {:projects => :add}, :require => :loggedin |
|
50 | 50 | map.permission :edit_project, {:projects => [:settings, :edit]}, :require => :member |
|
51 | 51 | map.permission :select_project_modules, {:projects => :modules}, :require => :member |
|
52 | 52 | map.permission :manage_members, {:projects => :settings, :members => [:new, :edit, :destroy, :autocomplete_for_member]}, :require => :member |
|
53 | 53 | map.permission :manage_versions, {:projects => :settings, :versions => [:new, :edit, :close_completed, :destroy]}, :require => :member |
|
54 | 54 | map.permission :add_subprojects, {:projects => :add}, :require => :member |
|
55 | 55 | |
|
56 | 56 | map.project_module :issue_tracking do |map| |
|
57 | 57 | # Issue categories |
|
58 | 58 | map.permission :manage_categories, {:projects => :settings, :issue_categories => [:new, :edit, :destroy]}, :require => :member |
|
59 | 59 | # Issues |
|
60 | 60 | map.permission :view_issues, {:projects => :roadmap, |
|
61 | 61 | :issues => [:index, :changes, :show], |
|
62 | 62 | :auto_complete => [:issues], |
|
63 | 63 | :context_menus => [:issues], |
|
64 | 64 | :versions => [:show, :status_by], |
|
65 | 65 | :queries => :index, |
|
66 | 66 | :reports => [:issue_report, :issue_report_details]} |
|
67 | 67 | map.permission :add_issues, {:issues => [:new, :create, :update_form]} |
|
68 | 68 | map.permission :edit_issues, {:issues => [:edit, :update, :bulk_edit, :update_form], :journals => [:new]} |
|
69 | 69 | map.permission :manage_issue_relations, {:issue_relations => [:new, :destroy]} |
|
70 | 70 | map.permission :manage_subtasks, {} |
|
71 | 71 | map.permission :add_issue_notes, {:issues => [:edit, :update], :journals => [:new]} |
|
72 | 72 | map.permission :edit_issue_notes, {:journals => :edit}, :require => :loggedin |
|
73 | 73 | map.permission :edit_own_issue_notes, {:journals => :edit}, :require => :loggedin |
|
74 | 74 | map.permission :move_issues, {:issue_moves => [:new, :create]}, :require => :loggedin |
|
75 | 75 | map.permission :delete_issues, {:issues => :destroy}, :require => :member |
|
76 | 76 | # Queries |
|
77 | 77 | map.permission :manage_public_queries, {:queries => [:new, :edit, :destroy]}, :require => :member |
|
78 | 78 | map.permission :save_queries, {:queries => [:new, :edit, :destroy]}, :require => :loggedin |
|
79 | # Gantt & calendar | |
|
80 | map.permission :view_gantt, :gantts => :show | |
|
81 | map.permission :view_calendar, :calendars => :show | |
|
82 | 79 | # Watchers |
|
83 | 80 | map.permission :view_issue_watchers, {} |
|
84 | 81 | map.permission :add_issue_watchers, {:watchers => :new} |
|
85 | 82 | map.permission :delete_issue_watchers, {:watchers => :destroy} |
|
86 | 83 | end |
|
87 | 84 | |
|
88 | 85 | map.project_module :time_tracking do |map| |
|
89 | 86 | map.permission :log_time, {:timelog => :edit}, :require => :loggedin |
|
90 | 87 | map.permission :view_time_entries, :timelog => [:details, :report] |
|
91 | 88 | map.permission :edit_time_entries, {:timelog => [:edit, :destroy]}, :require => :member |
|
92 | 89 | map.permission :edit_own_time_entries, {:timelog => [:edit, :destroy]}, :require => :loggedin |
|
93 | 90 | map.permission :manage_project_activities, {:projects => [:save_activities, :reset_activities]}, :require => :member |
|
94 | 91 | end |
|
95 | 92 | |
|
96 | 93 | map.project_module :news do |map| |
|
97 | 94 | map.permission :manage_news, {:news => [:new, :edit, :destroy, :destroy_comment]}, :require => :member |
|
98 | 95 | map.permission :view_news, {:news => [:index, :show]}, :public => true |
|
99 | 96 | map.permission :comment_news, {:news => :add_comment} |
|
100 | 97 | end |
|
101 | 98 | |
|
102 | 99 | map.project_module :documents do |map| |
|
103 | 100 | map.permission :manage_documents, {:documents => [:new, :edit, :destroy, :add_attachment]}, :require => :loggedin |
|
104 | 101 | map.permission :view_documents, :documents => [:index, :show, :download] |
|
105 | 102 | end |
|
106 | 103 | |
|
107 | 104 | map.project_module :files do |map| |
|
108 | 105 | map.permission :manage_files, {:projects => :add_file}, :require => :loggedin |
|
109 | 106 | map.permission :view_files, :projects => :list_files, :versions => :download |
|
110 | 107 | end |
|
111 | 108 | |
|
112 | 109 | map.project_module :wiki do |map| |
|
113 | 110 | map.permission :manage_wiki, {:wikis => [:edit, :destroy]}, :require => :member |
|
114 | 111 | map.permission :rename_wiki_pages, {:wiki => :rename}, :require => :member |
|
115 | 112 | map.permission :delete_wiki_pages, {:wiki => :destroy}, :require => :member |
|
116 | 113 | map.permission :view_wiki_pages, :wiki => [:index, :special] |
|
117 | 114 | map.permission :export_wiki_pages, {} |
|
118 | 115 | map.permission :view_wiki_edits, :wiki => [:history, :diff, :annotate] |
|
119 | 116 | map.permission :edit_wiki_pages, :wiki => [:edit, :preview, :add_attachment] |
|
120 | 117 | map.permission :delete_wiki_pages_attachments, {} |
|
121 | 118 | map.permission :protect_wiki_pages, {:wiki => :protect}, :require => :member |
|
122 | 119 | end |
|
123 | 120 | |
|
124 | 121 | map.project_module :repository do |map| |
|
125 | 122 | map.permission :manage_repository, {:repositories => [:edit, :committers, :destroy]}, :require => :member |
|
126 | 123 | map.permission :browse_repository, :repositories => [:show, :browse, :entry, :annotate, :changes, :diff, :stats, :graph] |
|
127 | 124 | map.permission :view_changesets, :repositories => [:show, :revisions, :revision] |
|
128 | 125 | map.permission :commit_access, {} |
|
129 | 126 | end |
|
130 | 127 | |
|
131 | 128 | map.project_module :boards do |map| |
|
132 | 129 | map.permission :manage_boards, {:boards => [:new, :edit, :destroy]}, :require => :member |
|
133 | 130 | map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :public => true |
|
134 | 131 | map.permission :add_messages, {:messages => [:new, :reply, :quote]} |
|
135 | 132 | map.permission :edit_messages, {:messages => :edit}, :require => :member |
|
136 | 133 | map.permission :edit_own_messages, {:messages => :edit}, :require => :loggedin |
|
137 | 134 | map.permission :delete_messages, {:messages => :destroy}, :require => :member |
|
138 | 135 | map.permission :delete_own_messages, {:messages => :destroy}, :require => :loggedin |
|
139 | 136 | end |
|
137 | ||
|
138 | map.project_module :calendar do |map| | |
|
139 | map.permission :view_calendar, :calendars => :show | |
|
140 | end | |
|
141 | ||
|
142 | map.project_module :gantt do |map| | |
|
143 | map.permission :view_gantt, :gantts => :show | |
|
144 | end | |
|
140 | 145 | end |
|
141 | 146 | |
|
142 | 147 | Redmine::MenuManager.map :top_menu do |menu| |
|
143 | 148 | menu.push :home, :home_path |
|
144 | 149 | menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? } |
|
145 | 150 | menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural |
|
146 | 151 | menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true |
|
147 | 152 | menu.push :help, Redmine::Info.help_url, :last => true |
|
148 | 153 | end |
|
149 | 154 | |
|
150 | 155 | Redmine::MenuManager.map :account_menu do |menu| |
|
151 | 156 | menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? } |
|
152 | 157 | menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? } |
|
153 | 158 | menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? } |
|
154 | 159 | menu.push :logout, :signout_path, :if => Proc.new { User.current.logged? } |
|
155 | 160 | end |
|
156 | 161 | |
|
157 | 162 | Redmine::MenuManager.map :application_menu do |menu| |
|
158 | 163 | # Empty |
|
159 | 164 | end |
|
160 | 165 | |
|
161 | 166 | Redmine::MenuManager.map :admin_menu do |menu| |
|
162 | 167 | menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural |
|
163 | 168 | menu.push :users, {:controller => 'users'}, :caption => :label_user_plural |
|
164 | 169 | menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural |
|
165 | 170 | menu.push :roles, {:controller => 'roles'}, :caption => :label_role_and_permissions |
|
166 | 171 | menu.push :trackers, {:controller => 'trackers'}, :caption => :label_tracker_plural |
|
167 | 172 | menu.push :issue_statuses, {:controller => 'issue_statuses'}, :caption => :label_issue_status_plural, |
|
168 | 173 | :html => {:class => 'issue_statuses'} |
|
169 | 174 | menu.push :workflows, {:controller => 'workflows', :action => 'edit'}, :caption => :label_workflow |
|
170 | 175 | menu.push :custom_fields, {:controller => 'custom_fields'}, :caption => :label_custom_field_plural, |
|
171 | 176 | :html => {:class => 'custom_fields'} |
|
172 | 177 | menu.push :enumerations, {:controller => 'enumerations'} |
|
173 | 178 | menu.push :settings, {:controller => 'settings'} |
|
174 | 179 | menu.push :ldap_authentication, {:controller => 'ldap_auth_sources', :action => 'index'}, |
|
175 | 180 | :html => {:class => 'server_authentication'} |
|
176 | 181 | menu.push :plugins, {:controller => 'admin', :action => 'plugins'}, :last => true |
|
177 | 182 | menu.push :info, {:controller => 'admin', :action => 'info'}, :caption => :label_information_plural, :last => true |
|
178 | 183 | end |
|
179 | 184 | |
|
180 | 185 | Redmine::MenuManager.map :project_menu do |menu| |
|
181 | 186 | menu.push :overview, { :controller => 'projects', :action => 'show' } |
|
182 | 187 | menu.push :activity, { :controller => 'projects', :action => 'activity' } |
|
183 | 188 | menu.push :roadmap, { :controller => 'projects', :action => 'roadmap' }, |
|
184 | 189 | :if => Proc.new { |p| p.shared_versions.any? } |
|
185 | 190 | menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural |
|
186 | 191 | menu.push :new_issue, { :controller => 'issues', :action => 'new' }, :param => :project_id, :caption => :label_issue_new, |
|
187 | 192 | :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } |
|
188 | 193 | menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt |
|
189 | 194 | menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar |
|
190 | 195 | menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural |
|
191 | 196 | menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural |
|
192 | 197 | menu.push :wiki, { :controller => 'wiki', :action => 'index', :page => nil }, |
|
193 | 198 | :if => Proc.new { |p| p.wiki && !p.wiki.new_record? } |
|
194 | 199 | menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id, |
|
195 | 200 | :if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural |
|
196 | 201 | menu.push :files, { :controller => 'projects', :action => 'list_files' }, :caption => :label_file_plural |
|
197 | 202 | menu.push :repository, { :controller => 'repositories', :action => 'show' }, |
|
198 | 203 | :if => Proc.new { |p| p.repository && !p.repository.new_record? } |
|
199 | 204 | menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true |
|
200 | 205 | end |
|
201 | 206 | |
|
202 | 207 | Redmine::Activity.map do |activity| |
|
203 | 208 | activity.register :issues, :class_name => %w(Issue Journal) |
|
204 | 209 | activity.register :changesets |
|
205 | 210 | activity.register :news |
|
206 | 211 | activity.register :documents, :class_name => %w(Document Attachment) |
|
207 | 212 | activity.register :files, :class_name => 'Attachment' |
|
208 | 213 | activity.register :wiki_edits, :class_name => 'WikiContent::Version', :default => false |
|
209 | 214 | activity.register :messages, :default => false |
|
210 | 215 | activity.register :time_entries, :default => false |
|
211 | 216 | end |
|
212 | 217 | |
|
213 | 218 | Redmine::Search.map do |search| |
|
214 | 219 | search.register :issues |
|
215 | 220 | search.register :news |
|
216 | 221 | search.register :documents |
|
217 | 222 | search.register :changesets |
|
218 | 223 | search.register :wiki_pages |
|
219 | 224 | search.register :messages |
|
220 | 225 | search.register :projects |
|
221 | 226 | end |
|
222 | 227 | |
|
223 | 228 | Redmine::WikiFormatting.map do |format| |
|
224 | 229 | format.register :textile, Redmine::WikiFormatting::Textile::Formatter, Redmine::WikiFormatting::Textile::Helper |
|
225 | 230 | end |
@@ -1,65 +1,97 | |||
|
1 | 1 | --- |
|
2 | 2 | enabled_modules_001: |
|
3 | 3 | name: issue_tracking |
|
4 | 4 | project_id: 1 |
|
5 | 5 | id: 1 |
|
6 | 6 | enabled_modules_002: |
|
7 | 7 | name: time_tracking |
|
8 | 8 | project_id: 1 |
|
9 | 9 | id: 2 |
|
10 | 10 | enabled_modules_003: |
|
11 | 11 | name: news |
|
12 | 12 | project_id: 1 |
|
13 | 13 | id: 3 |
|
14 | 14 | enabled_modules_004: |
|
15 | 15 | name: documents |
|
16 | 16 | project_id: 1 |
|
17 | 17 | id: 4 |
|
18 | 18 | enabled_modules_005: |
|
19 | 19 | name: files |
|
20 | 20 | project_id: 1 |
|
21 | 21 | id: 5 |
|
22 | 22 | enabled_modules_006: |
|
23 | 23 | name: wiki |
|
24 | 24 | project_id: 1 |
|
25 | 25 | id: 6 |
|
26 | 26 | enabled_modules_007: |
|
27 | 27 | name: repository |
|
28 | 28 | project_id: 1 |
|
29 | 29 | id: 7 |
|
30 | 30 | enabled_modules_008: |
|
31 | 31 | name: boards |
|
32 | 32 | project_id: 1 |
|
33 | 33 | id: 8 |
|
34 | 34 | enabled_modules_009: |
|
35 | 35 | name: repository |
|
36 | 36 | project_id: 3 |
|
37 | 37 | id: 9 |
|
38 | 38 | enabled_modules_010: |
|
39 | 39 | name: wiki |
|
40 | 40 | project_id: 3 |
|
41 | 41 | id: 10 |
|
42 | 42 | enabled_modules_011: |
|
43 | 43 | name: issue_tracking |
|
44 | 44 | project_id: 2 |
|
45 | 45 | id: 11 |
|
46 | 46 | enabled_modules_012: |
|
47 | 47 | name: time_tracking |
|
48 | 48 | project_id: 3 |
|
49 | 49 | id: 12 |
|
50 | 50 | enabled_modules_013: |
|
51 | 51 | name: issue_tracking |
|
52 | 52 | project_id: 3 |
|
53 | 53 | id: 13 |
|
54 | 54 | enabled_modules_014: |
|
55 | 55 | name: issue_tracking |
|
56 | 56 | project_id: 5 |
|
57 | 57 | id: 14 |
|
58 | 58 | enabled_modules_015: |
|
59 | 59 | name: wiki |
|
60 | 60 | project_id: 2 |
|
61 | 61 | id: 15 |
|
62 | 62 | enabled_modules_016: |
|
63 | 63 | name: boards |
|
64 | 64 | project_id: 2 |
|
65 | 65 | id: 16 |
|
66 | enabled_modules_017: | |
|
67 | name: calendar | |
|
68 | project_id: 1 | |
|
69 | id: 17 | |
|
70 | enabled_modules_018: | |
|
71 | name: gantt | |
|
72 | project_id: 1 | |
|
73 | id: 18 | |
|
74 | enabled_modules_019: | |
|
75 | name: calendar | |
|
76 | project_id: 2 | |
|
77 | id: 19 | |
|
78 | enabled_modules_020: | |
|
79 | name: gantt | |
|
80 | project_id: 2 | |
|
81 | id: 20 | |
|
82 | enabled_modules_021: | |
|
83 | name: calendar | |
|
84 | project_id: 3 | |
|
85 | id: 21 | |
|
86 | enabled_modules_022: | |
|
87 | name: gantt | |
|
88 | project_id: 3 | |
|
89 | id: 22 | |
|
90 | enabled_modules_023: | |
|
91 | name: calendar | |
|
92 | project_id: 5 | |
|
93 | id: 23 | |
|
94 | enabled_modules_024: | |
|
95 | name: gantt | |
|
96 | project_id: 5 | |
|
97 | id: 24 |
@@ -1,84 +1,86 | |||
|
1 | 1 | # Redmine - project management software |
|
2 | 2 | # Copyright (C) 2006-2009 Jean-Philippe Lang |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
|
5 | 5 | # modify it under the terms of the GNU General Public License |
|
6 | 6 | # as published by the Free Software Foundation; either version 2 |
|
7 | 7 | # of the License, or (at your option) any later version. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU General Public License |
|
15 | 15 | # along with this program; if not, write to the Free Software |
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | require File.dirname(__FILE__) + '/../../test_helper' |
|
19 | 19 | |
|
20 | 20 | module RedmineMenuTestHelper |
|
21 | 21 | # Assertions |
|
22 | 22 | def assert_number_of_items_in_menu(menu_name, count) |
|
23 | 23 | assert Redmine::MenuManager.items(menu_name).size >= count, "Menu has less than #{count} items" |
|
24 | 24 | end |
|
25 | 25 | |
|
26 | 26 | def assert_menu_contains_item_named(menu_name, item_name) |
|
27 | 27 | assert Redmine::MenuManager.items(menu_name).collect(&:name).include?(item_name.to_sym), "Menu did not have an item named #{item_name}" |
|
28 | 28 | end |
|
29 | 29 | |
|
30 | 30 | # Helpers |
|
31 | 31 | def get_menu_item(menu_name, item_name) |
|
32 | 32 | Redmine::MenuManager.items(menu_name).find {|item| item.name == item_name.to_sym} |
|
33 | 33 | end |
|
34 | 34 | end |
|
35 | 35 | |
|
36 | 36 | class RedmineTest < ActiveSupport::TestCase |
|
37 | 37 | include RedmineMenuTestHelper |
|
38 | 38 | |
|
39 | 39 | def test_top_menu |
|
40 | 40 | assert_number_of_items_in_menu :top_menu, 5 |
|
41 | 41 | assert_menu_contains_item_named :top_menu, :home |
|
42 | 42 | assert_menu_contains_item_named :top_menu, :my_page |
|
43 | 43 | assert_menu_contains_item_named :top_menu, :projects |
|
44 | 44 | assert_menu_contains_item_named :top_menu, :administration |
|
45 | 45 | assert_menu_contains_item_named :top_menu, :help |
|
46 | 46 | end |
|
47 | 47 | |
|
48 | 48 | def test_account_menu |
|
49 | 49 | assert_number_of_items_in_menu :account_menu, 4 |
|
50 | 50 | assert_menu_contains_item_named :account_menu, :login |
|
51 | 51 | assert_menu_contains_item_named :account_menu, :register |
|
52 | 52 | assert_menu_contains_item_named :account_menu, :my_account |
|
53 | 53 | assert_menu_contains_item_named :account_menu, :logout |
|
54 | 54 | end |
|
55 | 55 | |
|
56 | 56 | def test_application_menu |
|
57 | 57 | assert_number_of_items_in_menu :application_menu, 0 |
|
58 | 58 | end |
|
59 | 59 | |
|
60 | 60 | def test_admin_menu |
|
61 | 61 | assert_number_of_items_in_menu :admin_menu, 0 |
|
62 | 62 | end |
|
63 | 63 | |
|
64 | 64 | def test_project_menu |
|
65 |
assert_number_of_items_in_menu :project_menu, 1 |
|
|
65 | assert_number_of_items_in_menu :project_menu, 14 | |
|
66 | 66 | assert_menu_contains_item_named :project_menu, :overview |
|
67 | 67 | assert_menu_contains_item_named :project_menu, :activity |
|
68 | 68 | assert_menu_contains_item_named :project_menu, :roadmap |
|
69 | 69 | assert_menu_contains_item_named :project_menu, :issues |
|
70 | 70 | assert_menu_contains_item_named :project_menu, :new_issue |
|
71 | assert_menu_contains_item_named :project_menu, :calendar | |
|
72 | assert_menu_contains_item_named :project_menu, :gantt | |
|
71 | 73 | assert_menu_contains_item_named :project_menu, :news |
|
72 | 74 | assert_menu_contains_item_named :project_menu, :documents |
|
73 | 75 | assert_menu_contains_item_named :project_menu, :wiki |
|
74 | 76 | assert_menu_contains_item_named :project_menu, :boards |
|
75 | 77 | assert_menu_contains_item_named :project_menu, :files |
|
76 | 78 | assert_menu_contains_item_named :project_menu, :repository |
|
77 | 79 | assert_menu_contains_item_named :project_menu, :settings |
|
78 | 80 | end |
|
79 | 81 | |
|
80 | 82 | def test_new_issue_should_have_root_as_a_parent |
|
81 | 83 | new_issue = get_menu_item(:project_menu, :new_issue) |
|
82 | 84 | assert_equal :root, new_issue.parent.name |
|
83 | 85 | end |
|
84 | 86 | end |
General Comments 0
You need to be logged in to leave comments.
Login now