comparison lib/redmine/default_data/loader.rb @ 1115:433d4f72a19b redmine-2.2

Update to Redmine SVN revision 11137 on 2.2-stable branch
author Chris Cannam
date Mon, 07 Jan 2013 12:01:42 +0000
parents cbb26bc654de
children 622f24f53b42
comparison
equal deleted inserted replaced
929:5f33065ddc4b 1115:433d4f72a19b
1 # Redmine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006-2011 Jean-Philippe Lang 2 # Copyright (C) 2006-2012 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
51 :permissions => [:manage_versions, 51 :permissions => [:manage_versions,
52 :manage_categories, 52 :manage_categories,
53 :view_issues, 53 :view_issues,
54 :add_issues, 54 :add_issues,
55 :edit_issues, 55 :edit_issues,
56 :view_private_notes,
57 :set_notes_private,
56 :manage_issue_relations, 58 :manage_issue_relations,
57 :manage_subtasks, 59 :manage_subtasks,
58 :add_issue_notes, 60 :add_issue_notes,
59 :save_queries, 61 :save_queries,
60 :view_gantt, 62 :view_gantt,
71 :edit_own_messages, 73 :edit_own_messages,
72 :view_files, 74 :view_files,
73 :manage_files, 75 :manage_files,
74 :browse_repository, 76 :browse_repository,
75 :view_changesets, 77 :view_changesets,
76 :commit_access] 78 :commit_access,
79 :manage_related_issues]
77 80
78 reporter = Role.create! :name => l(:default_role_reporter), 81 reporter = Role.create! :name => l(:default_role_reporter),
79 :position => 3, 82 :position => 3,
80 :permissions => [:view_issues, 83 :permissions => [:view_issues,
81 :add_issues, 84 :add_issues,
137 140
138 # Workflow 141 # Workflow
139 Tracker.find(:all).each { |t| 142 Tracker.find(:all).each { |t|
140 IssueStatus.find(:all).each { |os| 143 IssueStatus.find(:all).each { |os|
141 IssueStatus.find(:all).each { |ns| 144 IssueStatus.find(:all).each { |ns|
142 Workflow.create!(:tracker_id => t.id, :role_id => manager.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns 145 WorkflowTransition.create!(:tracker_id => t.id, :role_id => manager.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
143 } 146 }
144 } 147 }
145 } 148 }
146 149
147 Tracker.find(:all).each { |t| 150 Tracker.find(:all).each { |t|
148 [new, in_progress, resolved, feedback].each { |os| 151 [new, in_progress, resolved, feedback].each { |os|
149 [in_progress, resolved, feedback, closed].each { |ns| 152 [in_progress, resolved, feedback, closed].each { |ns|
150 Workflow.create!(:tracker_id => t.id, :role_id => developer.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns 153 WorkflowTransition.create!(:tracker_id => t.id, :role_id => developer.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
151 } 154 }
152 } 155 }
153 } 156 }
154 157
155 Tracker.find(:all).each { |t| 158 Tracker.find(:all).each { |t|
156 [new, in_progress, resolved, feedback].each { |os| 159 [new, in_progress, resolved, feedback].each { |os|
157 [closed].each { |ns| 160 [closed].each { |ns|
158 Workflow.create!(:tracker_id => t.id, :role_id => reporter.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns 161 WorkflowTransition.create!(:tracker_id => t.id, :role_id => reporter.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
159 } 162 }
160 } 163 }
161 Workflow.create!(:tracker_id => t.id, :role_id => reporter.id, :old_status_id => resolved.id, :new_status_id => feedback.id) 164 WorkflowTransition.create!(:tracker_id => t.id, :role_id => reporter.id, :old_status_id => resolved.id, :new_status_id => feedback.id)
162 } 165 }
163 166
164 # Enumerations 167 # Enumerations
165 DocumentCategory.create!(:name => l(:default_doc_category_user), :position => 1)
166 DocumentCategory.create!(:name => l(:default_doc_category_tech), :position => 2)
167
168 IssuePriority.create!(:name => l(:default_priority_low), :position => 1) 168 IssuePriority.create!(:name => l(:default_priority_low), :position => 1)
169 IssuePriority.create!(:name => l(:default_priority_normal), :position => 2, :is_default => true) 169 IssuePriority.create!(:name => l(:default_priority_normal), :position => 2, :is_default => true)
170 IssuePriority.create!(:name => l(:default_priority_high), :position => 3) 170 IssuePriority.create!(:name => l(:default_priority_high), :position => 3)
171 IssuePriority.create!(:name => l(:default_priority_urgent), :position => 4) 171 IssuePriority.create!(:name => l(:default_priority_urgent), :position => 4)
172 IssuePriority.create!(:name => l(:default_priority_immediate), :position => 5) 172 IssuePriority.create!(:name => l(:default_priority_immediate), :position => 5)
173
174 DocumentCategory.create!(:name => l(:default_doc_category_user), :position => 1)
175 DocumentCategory.create!(:name => l(:default_doc_category_tech), :position => 2)
173 176
174 TimeEntryActivity.create!(:name => l(:default_activity_design), :position => 1) 177 TimeEntryActivity.create!(:name => l(:default_activity_design), :position => 1)
175 TimeEntryActivity.create!(:name => l(:default_activity_development), :position => 2) 178 TimeEntryActivity.create!(:name => l(:default_activity_development), :position => 2)
176 end 179 end
177 true 180 true