changelog fixed.

pull/474/head
Stefan Frank 11 years ago
commit e1d92d3431
  1. 5
      app/assets/javascripts/select_list_move.js
  2. 11
      app/assets/stylesheets/default/application.css.erb
  3. 6
      app/controllers/api/v1/issues_controller.rb
  4. 2
      app/controllers/api/v1/projects_controller.rb
  5. 8
      app/controllers/api/v2/statuses_controller.rb
  6. 13
      app/controllers/application_controller.rb
  7. 14
      app/controllers/categories_controller.rb
  8. 27
      app/controllers/projects_controller.rb
  9. 26
      app/controllers/statuses_controller.rb
  10. 4
      app/controllers/time_entries/reports_controller.rb
  11. 2
      app/controllers/versions_controller.rb
  12. 2
      app/controllers/work_packages/context_menus_controller.rb
  13. 28
      app/controllers/work_packages/reports_controller.rb
  14. 1
      app/controllers/work_packages_controller.rb
  15. 8
      app/controllers/workflows_controller.rb
  16. 31
      app/helpers/issue_categories_helper.rb
  17. 4
      app/helpers/projects_helper.rb
  18. 4
      app/helpers/versions_helper.rb
  19. 12
      app/helpers/work_packages_helper.rb
  20. 4
      app/mailers/user_mailer.rb
  21. 4
      app/models/category.rb
  22. 2
      app/models/changeset.rb
  23. 2
      app/models/journal_observer.rb
  24. 4
      app/models/mail_handler.rb
  25. 2
      app/models/member.rb
  26. 2
      app/models/principal.rb
  27. 16
      app/models/project.rb
  28. 14
      app/models/query.rb
  29. 10
      app/models/status.rb
  30. 2
      app/models/system_user.rb
  31. 4
      app/models/timeline.rb
  32. 10
      app/models/type.rb
  33. 2
      app/models/user.rb
  34. 6
      app/models/version.rb
  35. 32
      app/models/work_package.rb
  36. 8
      app/models/work_package/status_transitions.rb
  37. 4
      app/models/workflow.rb
  38. 0
      app/views/categories/_form.html.erb
  39. 2
      app/views/categories/create.js.erb
  40. 2
      app/views/categories/destroy.html.erb
  41. 4
      app/views/categories/edit.html.erb
  42. 2
      app/views/categories/new.html.erb
  43. 8
      app/views/issues/bulk_edit.html.erb
  44. 2
      app/views/my/page.html.erb
  45. 2
      app/views/projects/_edit.html.erb
  46. 17
      app/views/projects/_form.html.erb
  47. 42
      app/views/projects/_types_form.html.erb
  48. 4
      app/views/projects/copy.html.erb
  49. 2
      app/views/projects/new.html.erb
  50. 12
      app/views/projects/settings/_activities.html.erb
  51. 14
      app/views/projects/settings/_categories.html.erb
  52. 78
      app/views/projects/settings/_timelines.html.erb
  53. 43
      app/views/projects/settings/_types.html.erb
  54. 4
      app/views/queries/_filters.html.erb
  55. 2
      app/views/settings/_repositories.html.erb
  56. 22
      app/views/statuses/_form.html.erb
  57. 4
      app/views/statuses/edit.html.erb
  58. 14
      app/views/statuses/index.html.erb
  59. 2
      app/views/statuses/new.html.erb
  60. 14
      app/views/timelines/filter/_planning_elements.html.erb
  61. 20
      app/views/timelines/filter/_projects.html.erb
  62. 8
      app/views/timelines/group/_grouping.html.erb
  63. 2
      app/views/versions/show.html.erb
  64. 2
      app/views/work_packages/_edit.html.erb
  65. 4
      app/views/work_packages/_form.html.erb
  66. 2
      app/views/work_packages/_history.html.erb
  67. 6
      app/views/work_packages/_sidebar.html.erb
  68. 6
      app/views/work_packages/context_menus/index.html.erb
  69. 6
      app/views/work_packages/index.html.erb
  70. 0
      app/views/work_packages/reports/_report.html.erb
  71. 0
      app/views/work_packages/reports/_report_category.html.erb
  72. 12
      app/views/work_packages/reports/report.html.erb
  73. 0
      app/views/work_packages/reports/report_details.html.erb
  74. 4
      app/views/work_packages/show.html.erb
  75. 2
      app/views/workflows/_form.html.erb
  76. 28
      config/locales/de.yml
  77. 28
      config/locales/en.yml
  78. 16
      config/routes.rb
  79. 2
      config/settings.yml
  80. 2
      db/migrate/20130916094339_legacy_issues_to_work_packages.rb
  81. 5
      db/migrate/20131001075217_rename_issue_category_to_category.rb
  82. 5
      db/migrate/20131001105659_rename_issue_statuses_to_statuses.rb
  83. 2
      db/seeds/development.rb
  84. 9
      doc/CHANGELOG.md
  85. 2
      features/project_types/project_creation_with_type.feature
  86. 2
      features/step_definitions/api_steps.rb
  87. 6
      features/step_definitions/general_steps.rb
  88. 29
      features/step_definitions/issue_status_steps.rb
  89. 2
      features/step_definitions/planning_element_steps.rb
  90. 5
      features/step_definitions/status_steps.rb
  91. 13
      features/support/paths.rb
  92. 5
      features/types/types.feature
  93. 4
      features/work_packages/reports.feature
  94. 2
      lib/open_project/version.rb
  95. 13
      lib/pagination/controller.rb
  96. 9
      lib/redmine.rb
  97. 18
      lib/redmine/default_data/loader.rb
  98. 2
      lib/redmine/notifiable.rb
  99. 2
      lib/scenario_disabler.rb
  100. 6
      lib/tasks/delete_attachments_from_projects_and_versions.rake
  101. Some files were not shown because too many files have changed in this diff Show More

@ -102,9 +102,6 @@ function moveOptionDown(theSel) {
function selectAllOptions(id)
{
var select = $(id);
for (var i=0; i<select.options.length; i++) {
select.options[i].selected = true;
}
jQuery("#" + id + " option").attr('selected',true);
}

@ -285,7 +285,7 @@ table.attributes td { vertical-align: top; }
table.boards a.board, h3.comments { background: url(<%= asset_path 'quote.png' %>) no-repeat 0% 50%; padding-left: 20px; }
td.center {text-align: center;}
td.center, th.center {text-align: center;}
div.issues h3 { background: url(<%= asset_path 'ticket.png' %>) no-repeat 0% 10%; padding-left: 20px; }
div.members h3 { background: url(<%= asset_path 'group.png' %>) no-repeat 0% 50%; padding-left: 20px; }
@ -523,6 +523,15 @@ html>body .tabular p {overflow: hidden;}
margin*/
}
.tabular td label {
font-weight: normal;
float: none;
text-align: left;
margin-left: 0; /*width of left column*/
width: auto; /*width of labels. Should be smaller than left column to create some right
margin*/
}
p.email_notification {
margin: 18px 10px 6px;
padding: 87px;

@ -52,7 +52,7 @@ module Api
before_filter :find_project, :only => [:new, :create]
before_filter :find_optional_project, :only => :index
before_filter :authorize, :except => :index
before_filter :check_for_default_issue_status, :only => [:new, :create]
before_filter :check_for_default_status, :only => [:new, :create]
before_filter :protect_from_unauthorized_export, :only => :index
before_filter :build_new_from_params, :only => [:new, :create]
before_filter :retrieve_query, :only => :index
@ -268,8 +268,8 @@ module Api
@allowed_statuses = @issue.new_statuses_allowed_to(User.current, true)
end
def check_for_default_issue_status
if IssueStatus.default.nil?
def check_for_default_status
if Status.default.nil?
render_error l(:error_no_default_work_package_status)
return false
end

@ -55,7 +55,7 @@ module Api
@open_issues_by_type = WorkPackage.visible.count(:group => :type,
:include => [:project, :status, :type],
:conditions => ["(#{cond}) AND #{IssueStatus.table_name}.is_closed=?", false])
:conditions => ["(#{cond}) AND #{Status.table_name}.is_closed=?", false])
@total_issues_by_type = WorkPackage.visible.count(:group => :type,
:include => [:project, :status, :type],
:conditions => cond)

@ -39,7 +39,7 @@ module Api
rescue_from ActiveRecord::RecordNotFound, with: lambda{render_404}
extend Pagination::Controller
paginate_model IssueStatus
paginate_model Status
unloadable
@ -49,13 +49,13 @@ module Api
def index
if @project
@statuses = Type.issue_statuses(@project.types.map(&:id))
@statuses = Type.statuses(@project.types.map(&:id))
else
visible_type_ids = Project.visible
.includes(:types)
.map(&:types).flatten
.map(&:id)
@statuses = Type.issue_statuses(visible_type_ids)
@statuses = Type.statuses(visible_type_ids)
end
respond_to do |format|
@ -64,7 +64,7 @@ module Api
end
def show
@status = IssueStatus.find(params[:id])
@status = Status.find(params[:id])
respond_to do |format|
format.api

@ -369,7 +369,18 @@ class ApplicationController < ActionController::Base
self._model_scope = Array(options[:scope]) if options[:scope]
end
# Filter for bulk issue operations
# Filter for bulk work package operations
def find_work_packages
@work_packages = WorkPackage.includes(:project)
.find_all_by_id(params[:work_package_id] || params[:ids])
raise ActiveRecord::RecordNotFound if @work_packages.empty?
@projects = @work_packages.collect(&:project).compact.uniq
@project = @projects.first if @projects.size == 1
rescue ActiveRecord::RecordNotFound
render_404
end
# TODO: remove this once all subclasses use find_work_packages
def find_issues
@issues = WorkPackage.find_all_by_id(params[:id] || params[:ids])
raise ActiveRecord::RecordNotFound if @issues.empty?

@ -27,20 +27,20 @@
# See doc/COPYRIGHT.rdoc for more details.
#++
class IssueCategoriesController < ApplicationController
class CategoriesController < ApplicationController
menu_item :settings
model_object IssueCategory
model_object Category
before_filter :find_model_object, :except => [:new, :create]
before_filter :find_project_from_association, :except => [:new, :create]
before_filter :find_project, :only => [:new, :create]
before_filter :authorize
def new
@category = @project.issue_categories.build
@category = @project.categories.build
end
def create
@category = @project.issue_categories.build
@category = @project.categories.build
@category.safe_attributes = params[:category]
if @category.save
@ -85,17 +85,17 @@ class IssueCategoriesController < ApplicationController
redirect_to :controller => '/projects', :action => 'settings', :id => @project, :tab => 'categories'
return
elsif params[:todo]
reassign_to = @project.issue_categories.find_by_id(params[:reassign_to_id]) if params[:todo] == 'reassign'
reassign_to = @project.categories.find_by_id(params[:reassign_to_id]) if params[:todo] == 'reassign'
@category.destroy(reassign_to)
redirect_to :controller => '/projects', :action => 'settings', :id => @project, :tab => 'categories'
return
end
@categories = @project.issue_categories - [@category]
@categories = @project.categories - [@category]
end
private
# Wrap ApplicationController's find_model_object method to set
# @category instead of just @issue_category
# @category instead of just @category
def find_model_object
super
@category = @object

@ -40,7 +40,7 @@ class ProjectsController < ApplicationController
before_filter :disable_api
before_filter :find_project, :except => [ :index, :level_list, :new, :create, :copy ]
before_filter :authorize, :only => [ :show, :settings, :edit, :update, :modules ]
before_filter :authorize, :only => [ :show, :settings, :edit, :update, :modules, :types ]
before_filter :authorize_global, :only => [:new, :create]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ]
before_filter :jump_to_project_menu_item, :only => :show
@ -61,17 +61,6 @@ class ProjectsController < ApplicationController
include RepositoriesHelper
include ProjectsHelper
# for timelines
def planning_element_types
params[:project].assert_valid_keys("planning_element_type_ids")
if @project.update_attributes(params[:project])
flash[:notice] = l('notice_successful_update')
else
flash[:error] = l('timelines.cannot_update_planning_element_types')
end
redirect_to :action => "settings", :tab => "timelines"
end
# Lists visible projects
def index
respond_to do |format|
@ -163,7 +152,7 @@ class ProjectsController < ApplicationController
@open_issues_by_type = WorkPackage.visible.count(:group => :type,
:include => [:project, :status, :type],
:conditions => ["(#{cond}) AND #{IssueStatus.table_name}.is_closed=?", false])
:conditions => ["(#{cond}) AND #{Status.table_name}.is_closed=?", false])
@total_issues_by_type = WorkPackage.visible.count(:group => :type,
:include => [:project, :status, :type],
:conditions => cond)
@ -203,6 +192,16 @@ class ProjectsController < ApplicationController
end
end
def types
params[:project].assert_valid_keys("type_ids")
if @project.update_attributes(params[:project])
flash[:notice] = l('notice_successful_update')
else
flash[:error] = l('timelines.cannot_update_planning_element_types')
end
redirect_to :action => "settings", :tab => "types"
end
def modules
@project.enabled_module_names = params[:enabled_module_names]
flash[:notice] = l(:notice_successful_update)
@ -273,7 +272,7 @@ private
def load_project_settings
@issue_custom_fields = WorkPackageCustomField.find(:all, :order => "#{CustomField.table_name}.position")
@issue_category ||= IssueCategory.new
@category ||= Category.new
@member ||= @project.members.new
@types = Type.all
@repository ||= @project.repository

@ -27,18 +27,18 @@
# See doc/COPYRIGHT.rdoc for more details.
#++
class IssueStatusesController < ApplicationController
class StatusesController < ApplicationController
include PaginationHelper
layout 'admin'
before_filter :require_admin
verify :method => :post, :only => [ :destroy, :create, :update, :move, :update_issue_done_ratio ],
verify :method => :post, :only => [ :destroy, :create, :update, :move, :update_work_package_done_ratio ],
:redirect_to => { :action => :index }
def index
@issue_statuses = IssueStatus.order('position')
@statuses = Status.order('position')
.page(params[:page])
.per_page(per_page_param)
@ -46,12 +46,12 @@ class IssueStatusesController < ApplicationController
end
def new
@issue_status = IssueStatus.new
@status = Status.new
end
def create
@issue_status = IssueStatus.new(params[:issue_status])
if @issue_status.save
@status = Status.new(params[:status])
if @status.save
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'index'
else
@ -60,12 +60,12 @@ class IssueStatusesController < ApplicationController
end
def edit
@issue_status = IssueStatus.find(params[:id])
@status = Status.find(params[:id])
end
def update
@issue_status = IssueStatus.find(params[:id])
if @issue_status.update_attributes(params[:issue_status])
@status = Status.find(params[:id])
if @status.update_attributes(params[:status])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index'
else
@ -74,15 +74,15 @@ class IssueStatusesController < ApplicationController
end
def destroy
IssueStatus.find(params[:id]).destroy
Status.find(params[:id]).destroy
redirect_to :action => 'index'
rescue
flash[:error] = l(:error_unable_delete_issue_status)
flash[:error] = l(:error_unable_delete_status)
redirect_to :action => 'index'
end
def update_issue_done_ratio
if IssueStatus.update_issue_done_ratios
def update_work_package_done_ratio
if Status.update_work_package_done_ratios
flash[:notice] = l(:notice_work_package_done_ratios_updated)
else
flash[:error] = l(:error_work_package_done_ratios_not_updated)

@ -180,8 +180,8 @@ class TimeEntries::ReportsController < ApplicationController
:klass => Version,
:label => Version.model_name.human},
'category' => {:sql => "#{WorkPackage.table_name}.category_id",
:klass => IssueCategory,
:label => IssueCategory.model_name.human},
:klass => Category,
:label => Category.model_name.human},
'member' => {:sql => "#{TimeEntry.table_name}.user_id",
:klass => User,
:label => Member.model_name.human},

@ -148,7 +148,7 @@ class VersionsController < ApplicationController
def status_by
respond_to do |format|
format.html { render :action => 'show' }
format.js { render(:update) {|page| page.replace_html 'status_by', render_issue_status_by(@version, params[:status_by])} }
format.js { render(:update) {|page| page.replace_html 'status_by', render_status_by(@version, params[:status_by])} }
end
end

@ -65,7 +65,7 @@ class WorkPackages::ContextMenusController < ApplicationController
end
@priorities = IssuePriority.all.reverse
@statuses = IssueStatus.find(:all, :order => 'position')
@statuses = Status.find(:all, :order => 'position')
@back = back_url
render :layout => false

@ -27,26 +27,26 @@
# See doc/COPYRIGHT.rdoc for more details.
#++
class Issues::ReportsController < ApplicationController
class WorkPackages::ReportsController < ApplicationController
menu_item :summary_field, :only => [:report, :report_details]
before_filter :find_project_by_project_id, :authorize, :find_issue_statuses
before_filter :find_project_by_project_id, :authorize, :find_statuses
def report
@types = @project.types
@versions = @project.shared_versions.sort
@priorities = IssuePriority.all
@categories = @project.issue_categories
@categories = @project.categories
@assignees = @project.members.collect { |m| m.user }.sort
@authors = @project.members.collect { |m| m.user }.sort
@subprojects = @project.descendants.visible
@issues_by_type = WorkPackage.by_type(@project)
@issues_by_version = WorkPackage.by_version(@project)
@issues_by_priority = WorkPackage.by_priority(@project)
@issues_by_category = WorkPackage.by_category(@project)
@issues_by_assigned_to = WorkPackage.by_assigned_to(@project)
@issues_by_author = WorkPackage.by_author(@project)
@issues_by_subproject = WorkPackage.by_subproject(@project) || []
@work_packages_by_type = WorkPackage.by_type(@project)
@work_packages_by_version = WorkPackage.by_version(@project)
@work_packages_by_priority = WorkPackage.by_priority(@project)
@work_packages_by_category = WorkPackage.by_category(@project)
@work_packages_by_assigned_to = WorkPackage.by_assigned_to(@project)
@work_packages_by_author = WorkPackage.by_author(@project)
@work_packages_by_subproject = WorkPackage.by_subproject(@project) || []
end
def report_details
@ -68,7 +68,7 @@ class Issues::ReportsController < ApplicationController
@report_title = WorkPackage.human_attribute_name(:priority)
when "category"
@field = "category_id"
@rows = @project.issue_categories
@rows = @project.categories
@data = WorkPackage.by_category(@project)
@report_title = WorkPackage.human_attribute_name(:category)
when "assigned_to"
@ -92,15 +92,15 @@ class Issues::ReportsController < ApplicationController
if @field
format.html {}
else
format.html { redirect_to report_project_issues_path(@project) }
format.html { redirect_to report_project_work_packages_path(@project) }
end
end
end
private
def find_issue_statuses
@statuses = IssueStatus.find(:all, :order => 'position')
def find_statuses
@statuses = Status.find(:all, :order => 'position')
end
def default_breadcrumb

@ -40,6 +40,7 @@ class WorkPackagesController < ApplicationController
accept_key_auth :index, :show, :create, :update, :destroy
before_filter :find_work_packages, :only => [:destroy]
before_filter :disable_api
before_filter :not_found_unless_work_package,
:project,

@ -44,7 +44,7 @@ class WorkflowsController < ApplicationController
if request.post?
Workflow.destroy_all( ["role_id=? and type_id=?", @role.id, @type.id])
(params[:issue_status] || []).each { |status_id, transitions|
(params[:status] || []).each { |status_id, transitions|
transitions.each { |new_status_id, options|
author = options.is_a?(Array) && options.include?('author') && !options.include?('always')
assignee = options.is_a?(Array) && options.include?('assignee') && !options.include?('always')
@ -59,10 +59,10 @@ class WorkflowsController < ApplicationController
end
@used_statuses_only = (params[:used_statuses_only] == '0' ? false : true)
if @type && @used_statuses_only && @type.issue_statuses.any?
@statuses = @type.issue_statuses
if @type && @used_statuses_only && @type.statuses.any?
@statuses = @type.statuses
end
@statuses ||= IssueStatus.find(:all, :order => 'position')
@statuses ||= Status.find(:all, :order => 'position')
if @type && @role && @statuses.any?
workflows = Workflow.all(:conditions => {:role_id => @role.id, :type_id => @type.id})

@ -1,31 +0,0 @@
#-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
module IssueCategoriesHelper
end

@ -38,11 +38,11 @@ module ProjectsHelper
{:name => 'modules', :action => :select_project_modules, :partial => 'projects/settings/modules', :label => :label_module_plural},
{:name => 'members', :action => :manage_members, :partial => 'projects/settings/members', :label => :label_member_plural},
{:name => 'versions', :action => :manage_versions, :partial => 'projects/settings/versions', :label => :label_version_plural},
{:name => 'categories', :action => :manage_categories, :partial => 'projects/settings/issue_categories', :label => :label_work_package_category_plural},
{:name => 'categories', :action => :manage_categories, :partial => 'projects/settings/categories', :label => :label_work_package_category_plural},
{:name => 'repository', :action => :manage_repository, :partial => 'projects/settings/repository', :label => :label_repository},
{:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural},
{:name => 'activities', :action => :manage_project_activities, :partial => 'projects/settings/activities', :label => :enumeration_activities},
{:name => 'timelines', :action => :manage_project_configuration, :partial => 'projects/settings/timelines', :label => :'timelines.settings'}
{:name => 'types', :action => :manage_project_configuration, :partial => 'projects/settings/types', :label => :'label_type_plural'}
]
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
end

@ -31,7 +31,7 @@ module VersionsHelper
STATUS_BY_CRITERIAS = %w(category type status priority author assigned_to)
def render_issue_status_by(version, criteria)
def render_status_by(version, criteria)
criteria = 'category' unless STATUS_BY_CRITERIAS.include?(criteria)
h = Hash.new {|k,v| k[v] = [0, 0]}
@ -42,7 +42,7 @@ module VersionsHelper
# Open issues count
WorkPackage.count(:group => criteria,
:include => :status,
:conditions => ["#{WorkPackage.table_name}.fixed_version_id = ? AND #{IssueStatus.table_name}.is_closed = ?", version.id, false]).each {|c,s| h[c][1] = s}
:conditions => ["#{WorkPackage.table_name}.fixed_version_id = ? AND #{Status.table_name}.is_closed = ?", version.id, false]).each {|c,s| h[c][1] = s}
rescue ActiveRecord::RecordNotFound
# When grouping by an association, Rails throws this exception if there's no result (bug)
end

@ -294,7 +294,7 @@ module WorkPackagesHelper
work_package_form_priority_attribute(form, work_package, locals),
work_package_form_assignee_attribute(form, work_package, locals),
work_package_form_responsible_attribute(form, work_package, locals),
work_package_form_issue_category_attribute(form, work_package, locals),
work_package_form_category_attribute(form, work_package, locals),
work_package_form_assignable_versions_attribute(form, work_package, locals),
work_package_form_start_date_attribute(form, work_package, locals),
work_package_form_due_date_attribute(form, work_package, locals),
@ -505,17 +505,17 @@ module WorkPackagesHelper
form.select(:responsible_id, options_for_responsible(locals[:project]), :include_blank => true))
end
def work_package_form_issue_category_attribute(form, work_package, locals = {})
unless locals[:project].issue_categories.empty?
def work_package_form_category_attribute(form, work_package, locals = {})
unless locals[:project].categories.empty?
field = form.select(:category_id,
(locals[:project].issue_categories.collect {|c| [c.name, c.id]}),
(locals[:project].categories.collect {|c| [c.name, c.id]}),
:include_blank => true)
field += prompt_to_remote(image_tag('plus.png', :style => 'vertical-align: middle;'),
t(:label_work_package_category_new),
'category[name]',
project_issue_categories_path(locals[:project]),
:title => t(:label_work_package_category_new)) if authorize_for('issue_categories', 'new')
project_categories_path(locals[:project]),
:title => t(:label_work_package_category_new)) if authorize_for('categories', 'new')
WorkPackageAttribute.new(:category, field)
end

@ -244,7 +244,7 @@ class UserMailer < ActionMailer::Base
@issues = issues
@days = days
@assigned_issues_url = url_for(:controller => :issues,
@assigned_issues_url = url_for(:controller => :work_packages,
:action => :index,
:set_filter => 1,
:assigned_to_id => user.id,
@ -394,7 +394,7 @@ class DueIssuesReminder
end
def remind_users
s = ARCondition.new ["#{IssueStatus.table_name}.is_closed = ? AND #{WorkPackage.table_name}.due_date <= ?", false, @days.days.from_now.to_date]
s = ARCondition.new ["#{Status.table_name}.is_closed = ? AND #{WorkPackage.table_name}.due_date <= ?", false, @days.days.from_now.to_date]
s << "#{WorkPackage.table_name}.assigned_to_id IS NOT NULL"
s << ["#{WorkPackage.table_name}.assigned_to_id IN (?)", @user_ids] if @user_ids.any?
s << "#{Project.table_name}.status = #{Project::STATUS_ACTIVE}"

@ -27,7 +27,7 @@
# See doc/COPYRIGHT.rdoc for more details.
#++
class IssueCategory < ActiveRecord::Base
class Category < ActiveRecord::Base
include Redmine::SafeAttributes
belongs_to :project
belongs_to :assigned_to, :class_name => 'Principal', :foreign_key => 'assigned_to_id'
@ -53,7 +53,7 @@ class IssueCategory < ActiveRecord::Base
# Destroy the category
# If a category is specified, issues are reassigned to this category
def destroy(reassign_to = nil)
if reassign_to && reassign_to.is_a?(IssueCategory) && reassign_to.project == self.project
if reassign_to && reassign_to.is_a?(Category) && reassign_to.project == self.project
WorkPackage.update_all("category_id = #{reassign_to.id}", "category_id = #{id}")
end
destroy_without_reassign

@ -203,7 +203,7 @@ class Changeset < ActiveRecord::Base
end
def fix_work_package(work_package)
status = IssueStatus.find_by_id(Setting.commit_fix_status_id.to_i)
status = Status.find_by_id(Setting.commit_fix_status_id.to_i)
if status.nil?
logger.warn("No status matches commit_fix_status_id setting (#{Setting.commit_fix_status_id})") if logger
return work_package

@ -40,7 +40,7 @@ class JournalObserver < ActiveRecord::Observer
def after_create_issue_journal(journal)
if Setting.notified_events.include?('issue_updated') ||
(Setting.notified_events.include?('issue_note_added') && journal.notes.present?) ||
(Setting.notified_events.include?('issue_status_updated') && journal.changed_data.has_key?(:status_id)) ||
(Setting.notified_events.include?('status_updated') && journal.changed_data.has_key?(:status_id)) ||
(Setting.notified_events.include?('issue_priority_updated') && journal.changed_data.has_key?(:priority_id))
issue = journal.journable
recipients = issue.recipients + issue.watcher_recipients

@ -306,9 +306,9 @@ class MailHandler < ActionMailer::Base
attrs = {
'type_id' => (k = get_keyword(:type)) && issue.project.types.find_by_name(k).try(:id),
'status_id' => (k = get_keyword(:status)) && IssueStatus.find_by_name(k).try(:id),
'status_id' => (k = get_keyword(:status)) && Status.find_by_name(k).try(:id),
'priority_id' => (k = get_keyword(:priority)) && IssuePriority.find_by_name(k).try(:id),
'category_id' => (k = get_keyword(:category)) && issue.project.issue_categories.find_by_name(k).try(:id),
'category_id' => (k = get_keyword(:category)) && issue.project.categories.find_by_name(k).try(:id),
'assigned_to_id' => assigned_to.try(:id),
'fixed_version_id' => (k = get_keyword(:fixed_version)) && issue.project.shared_versions.find_by_name(k).try(:id),
'start_date' => get_keyword(:start_date, :override => true, :format => '\d{4}-\d{2}-\d{2}'),

@ -111,7 +111,7 @@ class Member < ActiveRecord::Base
# remove category based auto assignments for this member
def remove_from_category_assignments
IssueCategory.update_all "assigned_to_id = NULL", ["project_id = ? AND assigned_to_id = ?", project.id, user.id] if user
Category.update_all "assigned_to_id = NULL", ["project_id = ? AND assigned_to_id = ?", project.id, user.id] if user
end
# Find or initilize a Member with an id, attributes, and for a Principal

@ -35,7 +35,7 @@ class Principal < ActiveRecord::Base
has_many :members, :foreign_key => 'user_id', :dependent => :destroy
has_many :memberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}", :order => "#{Project.table_name}.name"
has_many :projects, :through => :memberships
has_many :issue_categories, :foreign_key => 'assigned_to_id', :dependent => :nullify
has_many :categories, :foreign_key => 'assigned_to_id', :dependent => :nullify
# Groups and active users
scope :active, :conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status = 1)"

@ -65,7 +65,7 @@ class Project < ActiveRecord::Base
has_many :time_entries, :dependent => :delete_all
has_many :queries, :dependent => :delete_all
has_many :news, :dependent => :destroy, :include => :author
has_many :issue_categories, :dependent => :delete_all, :order => "#{IssueCategory.table_name}.name"
has_many :categories, :dependent => :delete_all, :order => "#{Category.table_name}.name"
has_many :boards, :dependent => :destroy, :order => "position ASC"
has_one :repository, :dependent => :destroy
has_many :changesets, :through => :repository
@ -765,7 +765,7 @@ class Project < ActiveRecord::Base
def copy(project, options={})
project = project.is_a?(Project) ? project : Project.find(project)
to_be_copied = %w(wiki versions issue_categories work_packages members queries boards)
to_be_copied = %w(wiki versions categories work_packages members queries boards)
to_be_copied = to_be_copied & options[:only].to_a unless options[:only].nil?
Project.transaction do
@ -932,11 +932,11 @@ class Project < ActiveRecord::Base
end
# Copies issue categories from +project+
def copy_issue_categories(project)
project.issue_categories.each do |issue_category|
new_issue_category = IssueCategory.new
new_issue_category.send(:assign_attributes, issue_category.attributes.dup.except("id", "project_id"), :without_protection => true)
self.issue_categories << new_issue_category
def copy_categories(project)
project.categories.each do |category|
new_category = Category.new
new_category.send(:assign_attributes, category.attributes.dup.except("id", "project_id"), :without_protection => true)
self.categories << new_category
end
end
@ -960,7 +960,7 @@ class Project < ActiveRecord::Base
# Reassign the category by name, since names are unique per
# project and the categories for self are not yet saved
if issue.category
new_issue.category = self.issue_categories.select {|c| c.name == issue.category.name}.first
new_issue.category = self.categories.select {|c| c.name == issue.category.name}.first
end
# Parent issue
if issue.parent_id

@ -83,14 +83,14 @@ class Query < ActiveRecord::Base
QueryColumn.new(:project, :sortable => "#{Project.table_name}.name", :groupable => true),
QueryColumn.new(:type, :sortable => "#{Type.table_name}.position", :groupable => true),
QueryColumn.new(:parent, :sortable => ["#{WorkPackage.table_name}.root_id", "#{WorkPackage.table_name}.lft ASC"], :default_order => 'desc', :caption => :parent_issue),
QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position", :groupable => true),
QueryColumn.new(:status, :sortable => "#{Status.table_name}.position", :groupable => true),
QueryColumn.new(:priority, :sortable => "#{IssuePriority.table_name}.position", :default_order => 'desc', :groupable => true),
QueryColumn.new(:subject, :sortable => "#{WorkPackage.table_name}.subject"),
QueryColumn.new(:author),
QueryColumn.new(:assigned_to, :sortable => ["#{User.table_name}.lastname", "#{User.table_name}.firstname", "#{User.table_name}.id"], :groupable => true),
QueryColumn.new(:responsible, :sortable => ["#{User.table_name}.lastname", "#{User.table_name}.firstname", "#{User.table_name}.id"], :groupable => true),
QueryColumn.new(:updated_at, :sortable => "#{WorkPackage.table_name}.updated_at", :default_order => 'desc'),
QueryColumn.new(:category, :sortable => "#{IssueCategory.table_name}.name", :groupable => true),
QueryColumn.new(:category, :sortable => "#{Category.table_name}.name", :groupable => true),
QueryColumn.new(:fixed_version, :sortable => ["#{Version.table_name}.effective_date", "#{Version.table_name}.name"], :default_order => 'desc', :groupable => true),
# Put empty start_dates and due_dates in the far future rather than in the far past
QueryColumn.new(:start_date, :sortable => ["CASE WHEN #{WorkPackage.table_name}.start_date IS NULL THEN 1 ELSE 0 END", "#{WorkPackage.table_name}.start_date"]),
@ -136,7 +136,7 @@ class Query < ActiveRecord::Base
types = project.nil? ? Type.find(:all, :order => 'position') : project.rolled_up_types
@available_filters = { "status_id" => { :type => :list_status, :order => 1, :values => IssueStatus.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
@available_filters = { "status_id" => { :type => :list_status, :order => 1, :values => Status.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
"type_id" => { :type => :list, :order => 2, :values => types.collect{|s| [s.name, s.id.to_s] } },
"priority_id" => { :type => :list, :order => 3, :values => IssuePriority.all.collect{|s| [s.name, s.id.to_s] } },
"subject" => { :type => :text, :order => 8 },
@ -203,7 +203,7 @@ class Query < ActiveRecord::Base
if project
# project specific filters
categories = project.issue_categories.all
categories = project.categories.all
unless categories.empty?
@available_filters["category_id"] = { :type => :list_optional, :order => 6, :values => categories.collect{|s| [s.name, s.id.to_s] } }
end
@ -536,7 +536,7 @@ class Query < ActiveRecord::Base
.joins("INNER JOIN projects ON work_packages.project_id = projects.id")
.joins("INNER JOIN users AS authors ON work_packages.author_id = authors.id")
.joins("INNER JOIN types ON work_packages.type_id = types.id")
.joins("INNER JOIN issue_statuses ON work_packages.status_id = issue_statuses.id")
.joins("INNER JOIN statuses ON work_packages.status_id = statuses.id")
.where(statement)
.order(options[:order])
.limit(options[:limit])
@ -590,9 +590,9 @@ class Query < ActiveRecord::Base
sql = "#{db_table}.#{db_field} <= #{value.first.to_f}"
end
when "o"
sql = "#{IssueStatus.table_name}.is_closed=#{connection.quoted_false}" if field == "status_id"
sql = "#{Status.table_name}.is_closed=#{connection.quoted_false}" if field == "status_id"
when "c"
sql = "#{IssueStatus.table_name}.is_closed=#{connection.quoted_true}" if field == "status_id"
sql = "#{Status.table_name}.is_closed=#{connection.quoted_true}" if field == "status_id"
when ">t-"
sql = date_range_clause(db_table, db_field, - value.first.to_i, 0)
when "<t-"

@ -27,7 +27,7 @@
# See doc/COPYRIGHT.rdoc for more details.
#++
class IssueStatus < ActiveRecord::Base
class Status < ActiveRecord::Base
extend Pagination::Model
before_destroy :check_integrity
@ -50,7 +50,7 @@ class IssueStatus < ActiveRecord::Base
}
def unmark_old_default_value
IssueStatus.update_all("is_default=#{connection.quoted_false}", ['id <> ?', id])
Status.update_all("is_default=#{connection.quoted_false}", ['id <> ?', id])
end
# Returns the default status for new issues
@ -58,10 +58,10 @@ class IssueStatus < ActiveRecord::Base
find(:first, :conditions =>["is_default=?", true])
end
# Update all the +Issues+ setting their done_ratio to the value of their +IssueStatus+
def self.update_issue_done_ratios
# Update all the +Issues+ setting their done_ratio to the value of their +Status+
def self.update_work_package_done_ratios
if WorkPackage.use_status_for_done_ratio?
IssueStatus.find(:all, :conditions => ["default_done_ratio >= 0"]).each do |status|
Status.find(:all, :conditions => ["default_done_ratio >= 0"]).each do |status|
WorkPackage.update_all(["done_ratio = ?", status.default_done_ratio],
["status_id = ?", status.id])
end

@ -75,13 +75,11 @@ class SystemUser < User
def grant_privileges
self.admin = true
self.status = STATUSES[:builtin]
self.save
end
def remove_privileges
self.admin = false
self.status = STATUSES[:locked]
self.save
end
def run_given(&block)

@ -190,12 +190,12 @@ class Timeline < ActiveRecord::Base
def available_planning_element_status
types = Project.visible.includes(:types).map(&:types).flatten.uniq
types.map(&:issue_statuses).flatten.uniq
types.map(&:statuses).flatten.uniq
end
def selected_planning_element_status
resolve_with_none_element(:planning_element_status) do |ary|
IssueStatus.find(ary)
Status.find(ary)
end
end

@ -83,17 +83,17 @@ class Type < ActiveRecord::Base
find(:all, :order => 'position')
end
def self.issue_statuses(types)
workflow_table, status_table = [Workflow, IssueStatus].map(&:arel_table)
def self.statuses(types)
workflow_table, status_table = [Workflow, Status].map(&:arel_table)
old_id_subselect, new_id_subselect = [:old_status_id, :new_status_id].map do |foreign_key|
workflow_table.project(workflow_table[foreign_key]).where(workflow_table[:type_id].in(types))
end
IssueStatus.where(status_table[:id].in(old_id_subselect).or(status_table[:id].in(new_id_subselect)))
Status.where(status_table[:id].in(old_id_subselect).or(status_table[:id].in(new_id_subselect)))
end
def issue_statuses
def statuses
return [] if new_record?
@issue_statuses ||= Type.issue_statuses([id])
@statuses ||= Type.statuses([id])
end
def self.search_scope(query)

@ -81,7 +81,7 @@ class User < Principal
has_many :groups, :through => :group_users,
:after_add => Proc.new {|user, group| group.user_added(user)},
:after_remove => Proc.new {|user, group| group.user_removed(user)}
has_many :issue_categories, :foreign_key => 'assigned_to_id',
has_many :categories, :foreign_key => 'assigned_to_id',
:dependent => :nullify
has_many :assigned_issues, :foreign_key => 'assigned_to_id',
:class_name => 'WorkPackage',

@ -150,12 +150,12 @@ class Version < ActiveRecord::Base
# Returns the total amount of open issues for this version.
def open_issues_count
@open_issues_count ||= WorkPackage.where(["#{WorkPackage.table_name}.fixed_version_id = ? AND #{IssueStatus.table_name}.is_closed = ?", self.id, false]).includes(:status).size
@open_issues_count ||= WorkPackage.where(["#{WorkPackage.table_name}.fixed_version_id = ? AND #{Status.table_name}.is_closed = ?", self.id, false]).includes(:status).size
end
# Returns the total amount of closed issues for this version.
def closed_issues_count
@closed_issues_count ||= WorkPackage.where(["#{WorkPackage.table_name}.fixed_version_id = ? AND #{IssueStatus.table_name}.is_closed = ?", self.id, true]).includes(:status).size
@closed_issues_count ||= WorkPackage.where(["#{WorkPackage.table_name}.fixed_version_id = ? AND #{Status.table_name}.is_closed = ?", self.id, true]).includes(:status).size
end
def wiki_page
@ -260,7 +260,7 @@ class Version < ActiveRecord::Base
if issues_count > 0
ratio = open ? 'done_ratio' : 100
done = fixed_issues.where(["#{IssueStatus.table_name}.is_closed = ?", !open]).
done = fixed_issues.where(["#{Status.table_name}.is_closed = ?", !open]).
includes(:status).
sum("COALESCE(#{WorkPackage.table_name}.estimated_hours, #{estimated_average}) * #{ratio}")
progress = done.to_f / (estimated_average * issues_count)

@ -39,19 +39,19 @@ class WorkPackage < ActiveRecord::Base
# >>> issues.rb >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include Redmine::SafeAttributes
DONE_RATIO_OPTIONS = %w(issue_field issue_status disabled)
DONE_RATIO_OPTIONS = %w(field status disabled)
ATTRIBS_WITH_VALUES_FROM_CHILDREN = %w(priority_id start_date due_date estimated_hours done_ratio)
# <<< issues.rb <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
belongs_to :project
belongs_to :type
belongs_to :status, :class_name => 'IssueStatus', :foreign_key => 'status_id'
belongs_to :status, :class_name => 'Status', :foreign_key => 'status_id'
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
belongs_to :assigned_to, :class_name => 'Principal', :foreign_key => 'assigned_to_id'
belongs_to :responsible, :class_name => "User", :foreign_key => "responsible_id"
belongs_to :fixed_version, :class_name => 'Version', :foreign_key => 'fixed_version_id'
belongs_to :priority, :class_name => 'IssuePriority', :foreign_key => 'priority_id'
belongs_to :category, :class_name => 'IssueCategory', :foreign_key => 'category_id'
belongs_to :category, :class_name => 'Category', :foreign_key => 'category_id'
has_many :time_entries, :dependent => :delete_all
has_many :relations_from, :class_name => 'Relation', :foreign_key => 'from_id', :dependent => :delete_all
@ -77,7 +77,7 @@ class WorkPackage < ActiveRecord::Base
}
# >>> issues.rb >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
scope :open, :conditions => ["#{IssueStatus.table_name}.is_closed = ?", false], :include => :status
scope :open, :conditions => ["#{Status.table_name}.is_closed = ?", false], :include => :status
scope :with_limit, lambda { |limit| { :limit => limit} }
@ -116,7 +116,7 @@ class WorkPackage < ActiveRecord::Base
# >>> issues.rb >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
before_create :default_assign
before_save :close_duplicates, :update_done_ratio_from_issue_status
before_save :close_duplicates, :update_done_ratio_from_status
before_destroy :remove_attachments
# <<< issues.rb <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -173,7 +173,7 @@ class WorkPackage < ActiveRecord::Base
t << if journal.changed_data.empty? && !journal.initial?
'-note'
else
status = IssueStatus.find_by_id(journal.new_value_for(:status_id))
status = Status.find_by_id(journal.new_value_for(:status_id))
status.try(:is_closed?) ? '-closed' : '-edit'
end
@ -237,11 +237,11 @@ class WorkPackage < ActiveRecord::Base
end
def self.use_status_for_done_ratio?
Setting.work_package_done_ratio == 'issue_status'
Setting.work_package_done_ratio == 'status'
end
def self.use_field_for_done_ratio?
Setting.work_package_done_ratio == 'issue_field'
Setting.work_package_done_ratio == 'field'
end
# Returns true if usr or current user is allowed to view the work_package
@ -440,7 +440,7 @@ class WorkPackage < ActiveRecord::Base
assigned_to_id_changed? ? assigned_to_id_was == user.id : assigned_to_id == user.id
)
statuses << status unless statuses.empty?
statuses << IssueStatus.default if include_default
statuses << Status.default if include_default
statuses = statuses.uniq.sort
blocked? ? statuses.reject {|s| s.is_closed?} : statuses
end
@ -616,7 +616,7 @@ class WorkPackage < ActiveRecord::Base
# Set the done_ratio using the status if that setting is set. This will keep the done_ratios
# even if the user turns off the setting later
def update_done_ratio_from_issue_status
def update_done_ratio_from_status
if WorkPackage.use_status_for_done_ratio? && status && status.default_done_ratio
self.done_ratio = status.default_done_ratio
end
@ -637,7 +637,7 @@ class WorkPackage < ActiveRecord::Base
delete_relations(work_package)
# work_package is moved to another project
# reassign to the category with same name if any
new_category = work_package.category.nil? ? nil : new_project.issue_categories.find_by_name(work_package.category.name)
new_category = work_package.category.nil? ? nil : new_project.categories.find_by_name(work_package.category.name)
work_package.category = new_category
# Keep the fixed_version if it's still valid in the new_project
unless new_project.shared_versions.include?(work_package.fixed_version)
@ -664,7 +664,7 @@ class WorkPackage < ActiveRecord::Base
work_package.author = User.current
work_package.custom_field_values = self.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h}
work_package.status = if options[:attributes] && options[:attributes][:status_id]
IssueStatus.find_by_id(options[:attributes][:status_id])
Status.find_by_id(options[:attributes][:status_id])
else
self.status
end
@ -872,7 +872,7 @@ class WorkPackage < ActiveRecord::Base
def self.by_category(project)
count_and_group_by(:project => project,
:field => 'category_id',
:joins => IssueCategory.table_name)
:joins => Category.table_name)
end
def self.by_assigned_to(project)
@ -893,7 +893,7 @@ class WorkPackage < ActiveRecord::Base
i.project_id as project_id,
count(i.id) as total
from
#{WorkPackage.table_name} i, #{IssueStatus.table_name} s
#{WorkPackage.table_name} i, #{Status.table_name} s
where
i.status_id=s.id
and i.project_id IN (#{project.descendants.active.collect{|p| p.id}.join(',')})
@ -906,7 +906,7 @@ class WorkPackage < ActiveRecord::Base
def set_default_values
if new_record? # set default values for new records only
self.status ||= IssueStatus.default
self.status ||= Status.default
self.priority ||= IssuePriority.default
end
end
@ -992,7 +992,7 @@ class WorkPackage < ActiveRecord::Base
j.id as #{select_field},
count(i.id) as total
from
#{WorkPackage.table_name} i, #{IssueStatus.table_name} s, #{joins} j
#{WorkPackage.table_name} i, #{Status.table_name} s, #{joins} j
where
i.status_id=s.id
and #{where}

@ -35,8 +35,8 @@ module WorkPackage::StatusTransitions
# Return true if the issue is being reopened
def reopened?
if !new_record? && status_id_changed?
status_was = IssueStatus.find_by_id(status_id_was)
status_new = IssueStatus.find_by_id(status_id)
status_was = Status.find_by_id(status_id_was)
status_new = Status.find_by_id(status_id)
if status_was && status_new && status_was.is_closed? && !status_new.is_closed?
return true
end
@ -47,8 +47,8 @@ module WorkPackage::StatusTransitions
# Return true if the issue is being closed
def closing?
if !new_record? && status_id_changed?
status_was = IssueStatus.find_by_id(status_id_was)
status_new = IssueStatus.find_by_id(status_id)
status_was = Status.find_by_id(status_id_was)
status_new = Status.find_by_id(status_id)
if status_was && status_new && !status_was.is_closed? && status_new.is_closed?
return true
end

@ -29,8 +29,8 @@
class Workflow < ActiveRecord::Base
belongs_to :role
belongs_to :old_status, :class_name => 'IssueStatus', :foreign_key => 'old_status_id'
belongs_to :new_status, :class_name => 'IssueStatus', :foreign_key => 'new_status_id'
belongs_to :old_status, :class_name => 'Status', :foreign_key => 'old_status_id'
belongs_to :new_status, :class_name => 'Status', :foreign_key => 'new_status_id'
#attr_protected :role_id

@ -27,4 +27,4 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
jQuery('#work_package_category_id').empty().append("<%= escape_javascript(options_from_collection_for_select(project.issue_categories, 'id', 'name', category.id)) %>");
jQuery('#work_package_category_id').empty().append("<%= escape_javascript(options_from_collection_for_select(project.categories, 'id', 'name', category.id)) %>");

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<h2><%= IssueCategory.model_name.human %>: <%=h @category.name %></h2>
<h2><%= Category.model_name.human %>: <%=h @category.name %></h2>
<%= form_tag({}) do %>
<div class="box">

@ -27,9 +27,9 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<h2><%= IssueCategory.model_name.human %></h2>
<h2><%= Category.model_name.human %></h2>
<%= labelled_tabular_form_for @category, :as => :category do |f| %>
<%= render :partial => 'issue_categories/form', :locals => { :f => f } %>
<%= render :partial => 'categories/form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<% end %>

@ -30,6 +30,6 @@ See doc/COPYRIGHT.rdoc for more details.
<h2><%=l(:label_work_package_category_new)%></h2>
<%= labelled_tabular_form_for [@project, @category], :as => :category do |f| %>
<%= render :partial => 'issue_categories/form', :locals => { :f => f } %>
<%= render :partial => 'categories/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<% end %>

@ -44,7 +44,7 @@ See doc/COPYRIGHT.rdoc for more details.
</p>
<% if @available_statuses.any? %>
<p>
<label for='issue_status_id'><%= WorkPackage.human_attribute_name(:status) %></label>
<label for='status_id'><%= WorkPackage.human_attribute_name(:status) %></label>
<%= select_tag('issue[status_id]', "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(@available_statuses, :id, :name)) %>
</p>
<% end %>
@ -60,10 +60,10 @@ See doc/COPYRIGHT.rdoc for more details.
</p>
<% if @project %>
<p>
<label for='issue_category_id'><%= WorkPackage.human_attribute_name(:category) %></label>
<label for='category_id'><%= WorkPackage.human_attribute_name(:category) %></label>
<%= select_tag('issue[category_id]', content_tag('option', l(:label_no_change_option), :value => '') +
content_tag('option', l(:label_none), :value => 'none') +
options_from_collection_for_select(@project.issue_categories, :id, :name)) %>
options_from_collection_for_select(@project.categories, :id, :name)) %>
</p>
<% end %>
<% #TODO: allow editing versions when multiple projects %>
@ -83,7 +83,7 @@ See doc/COPYRIGHT.rdoc for more details.
</p>
<% end %>
<%= call_hook(:view_issues_bulk_edit_details_bottom, { :issues => @issues }) %>
<%= call_hook(:view_work_packages_bulk_edit_details_bottom, { :issues => @issues }) %>
</div>
<div class="splitcontentright">

@ -61,6 +61,6 @@ See doc/COPYRIGHT.rdoc for more details.
<% end if @blocks['right'] %>
</div>
<%= context_menu :controller => '/issues/context_menus', :action => 'issues' %>
<%= context_menu :controller => '/work_packages/context_menus', :action => 'issues' %>
<% html_title(l(:label_my_page)) -%>

@ -28,6 +28,6 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= labelled_tabular_form_for @project do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= render :partial => 'form', :locals => { :f => f, :renderTypes => false } %>
<%= submit_tag l(:button_save) %>
<% end %>

@ -80,17 +80,14 @@ See doc/COPYRIGHT.rdoc for more details.
</fieldset>
<% end %>
<% if @project.new_record? || @project.module_enabled?('issue_tracking') %>
<% if (@project.new_record? || @project.module_enabled?('issue_tracking')) %>
<% unless @types.empty? %>
<fieldset class="box" id="project_types"><legend><%=l(:label_type_plural)%> <span style="font-size:0.9em">(<%= check_all_links 'project_types' %>)</span></legend>
<% @types.each do |type| %>
<label class="floating">
<%= check_box_tag 'project[type_ids][]', type.id, @project.types.include?(type) %>
<%= (type.is_standard) ? l(:label_project_default_type) : h(type) %>
</label>
<% end %>
<%= hidden_field_tag 'project[type_ids][]', '' %>
</fieldset>
<% if renderTypes %>
<fieldset class="box" id="project_types"><legend><%=l(:label_type_plural)%> <span style="font-size:0.9em">(<%= check_all_links 'project_types' %>)</span></legend>
<%= render :partial => 'projects/types_form', :locals => { :f => f } %>
<%= hidden_field_tag 'project[type_ids][]', '' %>
</fieldset>
<% end %>
<% end %>
<% unless @issue_custom_fields.empty? %>

@ -0,0 +1,42 @@
<table class='list'>
<thead>
<tr>
<th width="90px" class='center'><%= Type.human_attribute_name(:active) %></th>
<th><%= Type.human_attribute_name(:name) %></th>
<th class='center'><%= Type.human_attribute_name(:in_aggregation) %></th>
<th class='center'><%= Type.human_attribute_name(:is_in_roadmap) %></th>
<th class='center'><%= Type.human_attribute_name(:is_milestone) %></th>
</tr>
</thead>
<tbody>
<% Type.all.each do |type| %>
<tr class="<%= cycle('odd', 'even', :name => "pet_table") %>">
<td class='center'>
<%= check_box_tag "project[type_ids][]",
type.id,
@project.types.include?(type),
:id => "project_planning_element_type_ids_#{type.id}" %>
<label class='hidden-for-sighted' for="project_planning_element_type_ids_<%= type.id %>">
<%= l('timelines.enable_planning_element_in_project', :type => type.name) %>
</label>
</td>
<td>
<label for="project_planning_element_type_ids_<%= type.id %>">
<%= icon_for_type(type) %>
<%=h type.name %>
</label>
</td>
<td class='center'>
<%= checked_image(type.in_aggregation) %>
</td>
<td class='center'>
<%= checked_image(type.is_in_roadmap) %>
</td>
<td class='center'>
<%= checked_image(type.is_milestone) %>
</td>
</tr>
<% end %>
</tbody>
</table>

@ -30,12 +30,12 @@ See doc/COPYRIGHT.rdoc for more details.
<h2><%=l(:label_project_new)%></h2>
<%= labelled_tabular_form_for @project, :url => { :action => "copy" } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= render :partial => 'form', :locals => { :f => f, :renderTypes => true } %>
<fieldset class="box"><legend><%= l(:button_copy) %></legend>
<label class="block"><%= check_box_tag 'only[]', 'members', true %> <%= l(:label_member_plural) %> (<%= @source_project.members.count %>)</label>
<label class="block"><%= check_box_tag 'only[]', 'versions', true %> <%= l(:label_version_plural) %> (<%= @source_project.versions.count %>)</label>
<label class="block"><%= check_box_tag 'only[]', 'issue_categories', true %> <%= l(:label_work_package_category_plural) %> (<%= @source_project.issue_categories.count %>)</label>
<label class="block"><%= check_box_tag 'only[]', 'categories', true %> <%= l(:label_work_package_category_plural) %> (<%= @source_project.categories.count %>)</label>
<label class="block"><%= check_box_tag 'only[]', 'work_packages', true %> <%= l(:label_work_package_plural) %> (<%= @source_project.work_packages.count %>)</label>
<label class="block"><%= check_box_tag 'only[]', 'queries', true %> <%= l(:label_query_plural) %> (<%= @source_project.queries.count %>)</label>
<label class="block"><%= check_box_tag 'only[]', 'boards', true %> <%= l(:label_board_plural) %> (<%= @source_project.boards.count %>)</label>

@ -30,7 +30,7 @@ See doc/COPYRIGHT.rdoc for more details.
<h2><%=l(:label_project_new)%></h2>
<%= labelled_tabular_form_for @project do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= render :partial => 'form', :locals => { :f => f, :renderTypes => true } %>
<%= submit_tag l(:button_save) %>
<%= javascript_tag "Form.Element.focus('project_name');" %>
<% end %>

@ -31,17 +31,21 @@ See doc/COPYRIGHT.rdoc for more details.
<table class="list">
<thead><tr>
<th style="width:90px;" class='center'><%= Enumeration.human_attribute_name(:active) %></th>
<th><%= Enumeration.human_attribute_name(:name) %></th>
<th><%= l(:enumeration_system_activity) %></th>
<th class='center'><%= l(:enumeration_system_activity) %></th>
<% TimeEntryActivity.new.available_custom_fields.each do |value| %>
<th><%= h value.name %></th>
<% end %>
<th style="width:15%;"><%= Enumeration.human_attribute_name(:active) %></th>
</tr></thead>
<% @project.activities(true).each do |enumeration| %>
<%= fields_for "enumerations[#{enumeration.id}]", enumeration do |ff| %>
<tr class="<%= cycle('odd', 'even') %>">
<td align="center">
<%= label_tag "enumerations_#{enumeration.id}_active", l(:description_active), :class => "hidden-for-sighted" %>
<%= ff.check_box :active %>
</td>
<td>
<%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %>
<%= h(enumeration) %>
@ -52,10 +56,6 @@ See doc/COPYRIGHT.rdoc for more details.
<%= custom_field_tag "enumerations[#{enumeration.id}]", value %>
</td>
<% end %>
<td align="center" style="width:15%;">
<%= label_tag "enumerations_#{enumeration.id}_active", l(:description_active), :class => "hidden-for-sighted" %>
<%= ff.check_box :active %>
</td>
</tr>
<% end %>
<% end %>

@ -27,23 +27,23 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<% if @project.issue_categories.any? %>
<% if @project.categories.any? %>
<table class="list">
<thead><tr>
<th><%= IssueCategory.model_name.human %></th>
<th><%= IssueCategory.human_attribute_name(:assigned_to) %></th>
<th><%= Category.model_name.human %></th>
<th><%= Category.human_attribute_name(:assigned_to) %></th>
<th></th>
</tr></thead>
<tbody>
<% for category in @project.issue_categories %>
<% for category in @project.categories %>
<% unless category.new_record? %>
<tr class="<%= cycle 'odd', 'even' %>">
<td><%=h(category.name) %></td>
<td><%=h(category.assigned_to.name) if category.assigned_to %></td>
<td class="buttons">
<%= link_to_if_authorized l(:button_edit), { :controller => '/issue_categories', :action => 'edit', :id => category }, :class => 'icon icon-edit' %>
<%= link_to_if_authorized l(:button_edit), { :controller => '/categories', :action => 'edit', :id => category }, :class => 'icon icon-edit' %>
<%= link_to_if_authorized l(:button_delete),
{ :controller => '/issue_categories',
{ :controller => '/categories',
:action => 'destroy',
:id => category },
:method => :delete,
@ -59,4 +59,4 @@ See doc/COPYRIGHT.rdoc for more details.
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
<p><%= link_to_if_authorized l(:label_work_package_category_new), :controller => '/issue_categories', :action => 'new', :project_id => @project %></p>
<p><%= link_to_if_authorized l(:label_work_package_category_new), :controller => '/categories', :action => 'new', :project_id => @project %></p>

@ -1,78 +0,0 @@
<%#-- copyright
OpenProject is a project management system.
Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2013 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<% extend TimelinesHelper %>
<%= header_tags %>
<h3><%= Type.model_name.human %></h3>
<%= form_tag(:controller => "/projects", :action => "types", :id => @project) do %>
<table class='list'>
<thead>
<tr>
<th><%= Type.human_attribute_name(:is_default) %></th>
<th><%= Type.human_attribute_name(:active) %></th>
<th><%= Type.human_attribute_name(:name) %></th>
<th><%= Type.human_attribute_name(:in_aggregation) %></th>
</tr>
</thead>
<tbody>
<% Type.all.each do |type| %>
<tr class="<%= cycle('odd', 'even', :name => "pet_table") %>">
<td class='center'>
<%= checked_image(type.enabled_in?(@project)) %>
</td>
<td class='center'>
<%= check_box_tag "project[planning_element_type_ids][]",
type.id,
@project.types.include?(type),
:id => "project_planning_element_type_ids_#{type.id}" %>
<label class='hidden-for-sighted' for="project_planning_element_type_ids_<%= type.id %>">
<%= l('timelines.enable_planning_element_in_project', :type => type.name) %>
</label>
</td>
<td>
<label for="project_planning_element_type_ids_<%= type.id %>">
<%= icon_for_type(type) %>
<%=h type.name %>
</label>
</td>
<td class='center'>
<%= checked_image(type.in_aggregation) %>
</td>
</tr>
<% end %>
</tbody>
</table>
<p><%= submit_tag l(:button_save) %></p>
<% end %>
<br/>

@ -0,0 +1,43 @@
<%#-- copyright
OpenProject is a project management system.
Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2013 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<% extend TimelinesHelper %>
<%= header_tags %>
<%= form_for @project,
:url => { :action => 'types', :id => @project },
:method => :put,
:html => {:id => 'types-form'} do |f| %>
<%=l(:label_type_plural)%> <span style="font-size:0.9em">(<%= check_all_links 'project_types' %>)</span>
<%= render :partial => 'projects/types_form', :locals => { :f => f } %>
<p><%= submit_tag l(:button_save) %></p>
<% end %>
<br/>

@ -92,7 +92,9 @@ function apply_filters_observer() {
if(e.keyCode == Event.KEY_RETURN) {
<%= remote_function(:url => { :set_filter => 1},
:update => "content",
:with => "Form.serialize('query_form')",
:before => 'selectAllOptions("selected_columns");',
:method => :get,
:with => "jQuery('#query_form').serialize()",
:complete => "e.stop(); apply_filters_observer()") %>
}
});

@ -55,7 +55,7 @@ See doc/COPYRIGHT.rdoc for more details.
<em><%= l(:text_comma_separated) %></em></p>
<p><%= setting_text_field :commit_fix_keywords, :size => 30 %>
&nbsp;<%= l(:label_applied_status) %>: <%= setting_select :commit_fix_status_id, [["", 0]] + IssueStatus.find(:all).collect{|status| [status.name, status.id.to_s]}, :label => false %>
&nbsp;<%= l(:label_applied_status) %>: <%= setting_select :commit_fix_status_id, [["", 0]] + Status.find(:all).collect{|status| [status.name, status.id.to_s]}, :label => false %>
&nbsp;<%= WorkPackage.human_attribute_name(:done_ratio) %>: <%= setting_select :commit_fix_done_ratio, (0..10).to_a.collect {|r| ["#{r*10} %", "#{r*10}"] }, :blank => :label_no_change_option, :label => false %>
<br /><em><%= l(:text_comma_separated) %></em></p>

@ -27,25 +27,25 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= error_messages_for 'issue_status' %>
<%= error_messages_for 'status' %>
<div class="box">
<!--[form:issue_status]-->
<p><label for="issue_status_name"><%= IssueStatus.human_attribute_name(:name) %><span class="required"> *</span></label>
<%= text_field 'issue_status', 'name' %></p>
<!--[form:status]-->
<p><label for="status_name"><%= Status.human_attribute_name(:name) %><span class="required"> *</span></label>
<%= text_field 'status', 'name' %></p>
<% if WorkPackage.use_status_for_done_ratio? %>
<p><label for="issue_done_ratio"><%= WorkPackage.human_attribute_name(:done_ratio) %></label>
<%= select 'issue_status', :default_done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :include_blank => true %></p>
<%= select 'status', :default_done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :include_blank => true %></p>
<% end %>
<p><label for="issue_status_is_closed"><%=IssueStatus.human_attribute_name(:is_closed) %></label>
<%= check_box 'issue_status', 'is_closed' %></p>
<p><label for="status_is_closed"><%=Status.human_attribute_name(:is_closed) %></label>
<%= check_box 'status', 'is_closed' %></p>
<p><label for="issue_status_is_default"><%= IssueStatus.human_attribute_name(:is_default) %></label>
<%= check_box 'issue_status', 'is_default' %></p>
<p><label for="status_is_default"><%= Status.human_attribute_name(:is_default) %></label>
<%= check_box 'status', 'is_default' %></p>
<%= call_hook(:view_issue_statuses_form, :issue_status => @issue_status) %>
<%= call_hook(:view_statuses_form, :status => @status) %>
<!--[eoform:issue_status]-->
<!--[eoform:status]-->
</div>

@ -27,9 +27,9 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<h2><%= link_to l(:label_work_package_status_plural), :controller => '/issue_statuses', :action => 'index' %> &#187; <%=h @issue_status %></h2>
<h2><%= link_to l(:label_work_package_status_plural), :controller => '/statuses', :action => 'index' %> &#187; <%=h @status %></h2>
<%= form_tag({:action => 'update', :id => @issue_status}, :class => "tabular") do %>
<%= form_tag({:action => 'update', :id => @status}, :class => "tabular") do %>
<%= render :partial => 'form' %>
<%= submit_tag l(:button_save) %>
<% end %>

@ -29,24 +29,24 @@ See doc/COPYRIGHT.rdoc for more details.
<div class="contextual">
<%= link_to l(:label_work_package_status_new), {:action => 'new'}, :class => 'icon icon-add' %>
<%= link_to(l(:label_update_work_package_done_ratios), {:action => 'update_issue_done_ratio'}, :class => 'icon icon-multiple', :method => 'post', :confirm => l(:text_are_you_sure)) if WorkPackage.use_status_for_done_ratio? %>
<%= link_to(l(:label_update_work_package_done_ratios), {:action => 'update_work_package_done_ratio'}, :class => 'icon icon-multiple', :method => 'post', :confirm => l(:text_are_you_sure)) if WorkPackage.use_status_for_done_ratio? %>
</div>
<h2><%=l(:label_work_package_status_plural)%></h2>
<table class="list">
<thead><tr>
<th><%= IssueStatus.model_name.human %></th>
<th><%= Status.model_name.human %></th>
<% if WorkPackage.use_status_for_done_ratio? %>
<th><%= WorkPackage.human_attribute_name(:done_ratio) %></th>
<% end %>
<th><%= IssueStatus.human_attribute_name(:is_default) %></th>
<th><%= IssueStatus.human_attribute_name(:is_closed) %></th>
<th><%= Status.human_attribute_name(:is_default) %></th>
<th><%= Status.human_attribute_name(:is_closed) %></th>
<th><%=l(:button_sort)%></th>
<th></th>
</tr></thead>
<tbody>
<% for status in @issue_statuses %>
<% for status in @statuses %>
<tr class="<%= cycle("odd", "even") %>">
<td><%= link_to h(status.name), :action => 'edit', :id => status %></td>
<% if WorkPackage.use_status_for_done_ratio? %>
@ -54,7 +54,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %>
<td align="center"><%= checked_image status.is_default? %></td>
<td align="center"><%= checked_image status.is_closed? %></td>
<td align="center" style="width:15%;"><%= reorder_links('issue_status', {:action => 'update', :id => status}) %></td>
<td align="center" style="width:15%;"><%= reorder_links('status', {:action => 'update', :id => status}) %></td>
<td class="buttons">
<%= link_to(l(:button_delete), { :action => 'destroy', :id => status },
:method => :post,
@ -66,6 +66,6 @@ See doc/COPYRIGHT.rdoc for more details.
</tbody>
</table>
<%= pagination_links_full @issue_statuses %>
<%= pagination_links_full @statuses %>
<% html_title(l(:label_work_package_status_plural)) -%>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<h2><%= link_to l(:label_work_package_status_plural), :controller => '/issue_statuses', :action => 'index' %> &#187; <%=l(:label_work_package_status_new)%></h2>
<h2><%= link_to l(:label_work_package_status_plural), :controller => '/statuses', :action => 'index' %> &#187; <%=l(:label_work_package_status_new)%></h2>
<%= form_tag({:action => 'create'}, :class => "tabular") do %>
<%= render :partial => 'form' %>

@ -52,9 +52,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= select("timeline[options]",
:planning_element_status,
filter_select_with_none(
@timeline.available_planning_element_status,
timeline.available_planning_element_status,
:name, :id),
{:selected => @timeline.selected_planning_element_status.map(&:id)},
{:selected => timeline.selected_planning_element_status.map(&:id)},
{:multiple => true,
:size => 12}) %>
<% else %>
@ -62,7 +62,7 @@ See doc/COPYRIGHT.rdoc for more details.
options_for_select([]),
{},
{ :'data-ajaxURL' => url_for({:controller => "/api/v2/statuses",
:action => "paginate_issue_statuses"}),
:action => "paginate_statuses"}),
:multiple => true,
:'data-selected' => filter_select(
timeline.selected_planning_element_status,
@ -79,9 +79,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= select("timeline[options]",
:planning_element_types,
filter_select_with_none(
@timeline.available_planning_element_types,
timeline.available_planning_element_types,
:name, :id),
{:selected => @timeline.selected_planning_element_types.map(&:id)},
{:selected => timeline.selected_planning_element_types.map(&:id)},
{:multiple => true,
:size => 12}) %>
<% else %>
@ -106,9 +106,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= select("timeline[options]",
:planning_element_responsibles,
filter_select_with_none(
@timeline.available_responsibles,
timeline.available_responsibles,
:name, :id),
{:selected => @timeline.selected_planning_element_responsibles.map(&:id)},
{:selected => timeline.selected_planning_element_responsibles.map(&:id)},
{:multiple => true,
:size => 12}) %>
<% else %>

@ -59,9 +59,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= select("timeline[options]",
:project_types,
filter_select_with_none(
@timeline.available_project_types,
timeline.available_project_types,
:name, :id),
{:selected => @timeline.selected_project_types.map(&:id)},
{:selected => timeline.selected_project_types.map(&:id)},
{:multiple => true,
:size => 12}) %>
<% else %>
@ -88,9 +88,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= select("timeline[options]",
:project_status,
filter_select_with_none(
@timeline.available_project_status,
timeline.available_project_status,
:name, :id),
{:selected => @timeline.selected_project_status.map(&:id)},
{:selected => timeline.selected_project_status.map(&:id)},
{:multiple => true,
:size => 12}) %>
<% else %>
@ -116,9 +116,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= select("timeline[options]",
:project_responsibles,
filter_select_with_none(
@timeline.available_responsibles,
timeline.available_responsibles,
:name, :id),
{:selected => @timeline.selected_project_responsibles.map(&:id)},
{:selected => timeline.selected_project_responsibles.map(&:id)},
{:multiple => true,
:size => 12}) %>
<% else %>
@ -144,9 +144,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= select("timeline[options]",
:parents,
filter_select_with_none(
@timeline.available_parents,
timeline.available_parents,
:name, :id),
{:selected => @timeline.selected_parents.map(&:id)},
{:selected => timeline.selected_parents.map(&:id)},
{:multiple => true,
:size => 12}) %>
<% else %>
@ -171,9 +171,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= select("timeline[options]",
:planning_element_time_types,
filter_select_with_none(
@timeline.available_planning_element_types,
timeline.available_planning_element_types,
:name, :id),
{:selected => @timeline.selected_planning_element_time_types.map(&:id)},
{:selected => timeline.selected_planning_element_time_types.map(&:id)},
{:multiple => true,
:size => 12}) %>
<% else %>

@ -50,9 +50,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= select("timeline[options]",
:grouping_one_selection,
filter_select_with_none(
@timeline.available_grouping_projects,
timeline.available_grouping_projects,
:name, :id),
{:selected => @timeline.selected_grouping_projects.map(&:id)},
{:selected => timeline.selected_grouping_projects.map(&:id)},
{:multiple => true,
:size => 12}) %>
<% else %>
@ -103,9 +103,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= select("timeline[options]",
:grouping_two_selection,
filter_select_with_none(
@timeline.available_grouping_project_types,
timeline.available_grouping_project_types,
:name, :id),
{:selected => @timeline.selected_grouping_project_types.map(&:id)},
{:selected => timeline.selected_grouping_project_types.map(&:id)},
{:multiple => true,
:size => 12}) %>
<% else %>

@ -54,7 +54,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %>
<div id="status_by">
<%= render_issue_status_by(@version, params[:status_by]) if @version.fixed_issues.count > 0 %>
<%= render_status_by(@version, params[:status_by]) if @version.fixed_issues.count > 0 %>
</div>
</div>

@ -85,7 +85,7 @@ See doc/COPYRIGHT.rdoc for more details.
:rows => 10,
:class => 'wiki-edit' %>
<%= wikitoolbar_for 'work_package_notes' %>
<%= call_hook(:view_issues_edit_notes_bottom, { :issue => work_package,
<%= call_hook(:view_work_packages_edit_notes_bottom, { :issue => work_package,
:notes => work_package.journal_notes,
:form => f }) %>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= call_hook(:view_issues_form_details_top, { :issue => work_package, :form => f }) %>
<%= call_hook(:view_work_packages_form_details_top, { :issue => work_package, :form => f }) %>
<div id="work_package_descr_fields"<% unless work_package.new_record? || work_package.errors.any? %> style="display:none;"<% end %>>
@ -67,6 +67,6 @@ See doc/COPYRIGHT.rdoc for more details.
</p>
<% end %>
<%= call_hook(:view_issues_form_details_bottom, { :issue => work_package, :form => f }) %>
<%= call_hook(:view_work_packages_form_details_bottom, { :issue => work_package, :form => f }) %>
<%= wikitoolbar_for 'work_package_description' %>

@ -40,7 +40,7 @@ a journal as the cache could then not be used between all of an issue's journals
:quote_permission => :edit_work_packages,
:edit_own_permission => :edit_own_work_package_notes,
:cache => @journal_cache %>
<%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
<%= call_hook(:view_work_packages_history_journal_bottom, { :journal => journal }) %>
<% end %>
<% heads_for_wiki_formatter if User.current.allowed_to?(:edit_work_package_notes, work_package.project) || User.current.allowed_to?(:edit_own_work_package_notes, work_package.project) %>

@ -27,9 +27,9 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= call_hook(:view_issues_sidebar_issues_bottom) %>
<%= call_hook(:view_work_packages_sidebar_issues_bottom) %>
<%= call_hook(:view_issues_sidebar_planning_bottom) %>
<%= call_hook(:view_work_packages_sidebar_planning_bottom) %>
<%= render_sidebar_queries %>
<%= call_hook(:view_issues_sidebar_queries_bottom) %>
<%= call_hook(:view_work_packages_sidebar_queries_bottom) %>

@ -28,7 +28,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<ul class="menu">
<%= call_hook(:view_issues_context_menu_start, {:issues => @work_packages, :can => @can, :back => @back }) %>
<%= call_hook(:view_work_packages_context_menu_start, {:issues => @work_packages, :can => @can, :back => @back }) %>
<% if !@work_package.nil? -%>
<li class="edit">
@ -93,7 +93,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= context_menu_entry(params) %>
<% end %>
<% unless @project.nil? || (categories = @project.issue_categories.to_a).empty? -%>
<% unless @project.nil? || (categories = @project.categories.to_a).empty? -%>
<% categories << [nil, l(:label_none)] %>
<% params = default_params.merge(:collection => categories,
:attribute => 'category',
@ -158,5 +158,5 @@ See doc/COPYRIGHT.rdoc for more details.
:disabled => !@can[:delete] %>
</li>
<%= call_hook(:view_issues_context_menu_end, {:issues => @work_packages, :can => @can, :back => @back }) %>
<%= call_hook(:view_work_packages_context_menu_end, {:issues => @work_packages, :can => @can, :back => @back }) %>
</ul>

@ -69,7 +69,7 @@ See doc/COPYRIGHT.rdoc for more details.
</tr>
<% end %>
</table>
<%= call_hook(:view_issue_query_form_options_bottom, :query => query) %>
<%= call_hook(:view_work_package_query_form_options_bottom, :query => query) %>
</div>
</fieldset>
</div>
@ -119,11 +119,11 @@ See doc/COPYRIGHT.rdoc for more details.
<%= f.link_to I18n.t(:label_pdf_with_descriptions), :url => { :project_id => project,
:show_descriptions => true,
:format => 'pdf' } %>
<%= call_hook(:view_issues_index_other_formats, :link_formatter => f, :project => project) %>
<%= call_hook(:view_work_packages_index_other_formats, :link_formatter => f, :project => project) %>
<% end if User.current.allowed_to? :export_work_packages, project, :global => project.nil? %>
<% end %>
<%= call_hook(:view_issues_index_bottom, { :issues => work_packages, :project => project, :query => query }) %>
<%= call_hook(:view_work_packages_index_bottom, { :issues => work_packages, :project => project, :query => query }) %>
<% content_for :sidebar do %>
<%= render :partial => 'sidebar' %>

@ -31,10 +31,10 @@ See doc/COPYRIGHT.rdoc for more details.
<div class="splitcontentleft">
<%
{ 'type' => { :rows => @types, :data => @issues_by_type, :name => "type_id" },
'priority' => { :rows => @priorities, :data => @issues_by_priority, :name => "priority_id" },
'assigned_to' => { :rows => @assignees, :data => @issues_by_assigned_to, :name => "assigned_to_id" },
'author' => { :rows => @authors, :data => @issues_by_author, :name => "author_id" }
{ 'type' => { :rows => @types, :data => @work_packages_by_type, :name => "type_id" },
'priority' => { :rows => @priorities, :data => @work_packages_by_priority, :name => "priority_id" },
'assigned_to' => { :rows => @assignees, :data => @work_packages_by_assigned_to, :name => "assigned_to_id" },
'author' => { :rows => @authors, :data => @work_packages_by_author, :name => "author_id" }
}.each do |detail, variables| %>
<%= render :partial => 'report_category', :locals => { :detail => detail,
@ -49,9 +49,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%
details = {'version' => { :rows => @versions, :data => @version, :name => "fixed_version_id" } }
if @project.children.any?
details['subproject'] = { :data => @issues_by_subproject, :name => "project_id", :rows => @subprojects }
details['subproject'] = { :data => @work_packages_by_subproject, :name => "project_id", :rows => @subprojects }
end
details['category'] = { :data => @issues_by_category, :name => "category_id", :rows => @categories }
details['category'] = { :data => @work_packages_by_category, :name => "category_id", :rows => @categories }
%>
<% details.each do |detail, variables| %>

@ -61,7 +61,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %>
<%= render_custom_fields_rows(work_package) %>
<%= call_hook(:view_issues_show_details_bottom, :issue => work_package) %>
<%= call_hook(:view_work_packages_show_details_bottom, :issue => work_package) %>
</table>
</div>
</div>
@ -82,7 +82,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= link_to_attachments work_package %>
<% end -%>
<%= call_hook(:view_issues_show_description_bottom, :issue => work_package) %>
<%= call_hook(:view_work_packages_show_description_bottom, :issue => work_package) %>
<%= render :partial => 'subwork_packages_paragraph', :locals => { :work_package => work_package,

@ -62,7 +62,7 @@ See doc/COPYRIGHT.rdoc for more details.
</td>
<% for new_status in @statuses -%>
<td align="center">
<%= check_box_tag "issue_status[#{ old_status.id }][#{new_status.id}][]", name, workflows.detect {|w| w.old_status_id == old_status.id && w.new_status_id == new_status.id},
<%= check_box_tag "status[#{ old_status.id }][#{new_status.id}][]", name, workflows.detect {|w| w.old_status_id == old_status.id && w.new_status_id == new_status.id},
:class => "old-status-#{old_status.id} new-status-#{new_status.id}" %>
</td>
<% end -%>

@ -90,7 +90,7 @@ de:
delay: "Pufferzeit"
from: "Arbeitspaket"
to: "Zugehöriges Arbeitspaket"
issue_status:
status:
is_closed: "Ticket geschlossen"
journal:
notes: "Kommentare"
@ -239,8 +239,8 @@ de:
custom_field: "Benutzerdefiniertes Feld"
group: "Gruppe"
issue: "Ticket"
issue_category: "Ticket-Kategorie"
issue_status: "Ticket-Status"
category: "Kategorie"
status: "Ticket-Status"
member: "Mitglied"
news: "News"
project: "Projekt"
@ -413,12 +413,12 @@ de:
default_activity_design: "Design"
default_activity_development: "Entwicklung"
default_issue_status_closed: "Erledigt"
default_issue_status_feedback: "Feedback"
default_issue_status_in_progress: "In Bearbeitung"
default_issue_status_new: "Neu"
default_issue_status_rejected: "Abgewiesen"
default_issue_status_resolved: "Gelöst"
default_status_closed: "Erledigt"
default_status_feedback: "Feedback"
default_status_in_progress: "In Bearbeitung"
default_status_new: "Neu"
default_status_rejected: "Abgewiesen"
default_status_resolved: "Gelöst"
default_priority_high: "Hoch"
default_priority_immediate: "Sofort"
default_priority_low: "Niedrig"
@ -457,7 +457,7 @@ de:
description_enter_text: "Text eingeben"
description_filter: "Filter"
description_filter_toggle: "Filter aus/einblenden"
description_issue_category_reassign: "Neue Kategorie wählen"
description_category_reassign: "Neue Kategorie wählen"
description_message_content: "Nachrichteninhalt"
description_my_project: "Sie sind Mitglied"
description_noscript: "Sie müssen JavaScript aktiveren, um OpenProject nutzen zu können!"
@ -500,7 +500,7 @@ de:
error_scm_annotate: "Der Eintrag existiert nicht oder kann nicht annotiert werden."
error_scm_command_failed: "Beim Zugriff auf das Projektarchiv ist ein Fehler aufgetreten: %{value}"
error_scm_not_found: "Eintrag und/oder Revision existiert nicht im Projektarchiv."
error_unable_delete_issue_status: "Der Ticket-Status konnte nicht gelöscht werden."
error_unable_delete_status: "Der Ticket-Status konnte nicht gelöscht werden."
error_unable_to_connect: "Fehler beim Verbinden (%{value})"
error_workflow_copy_source: "Bitte wählen Sie einen Quell-Typ und eine Quell-Rolle."
error_workflow_copy_target: "Bitte wählen Sie die Ziel-Typ und -Rollen."
@ -614,6 +614,7 @@ de:
label_bulk_edit_selected_issues: "Alle ausgewählten Tickets bearbeiten"
label_calendar: "Kalender"
label_calendar_show: "Kalender anzeigen"
label_category: "Kategorie"
label_change_plural: "Änderungen"
label_change_properties: "Eigenschaften ändern"
label_change_status: "Statuswechsel"
@ -1111,6 +1112,7 @@ de:
permission_rename_wiki_pages: "Wiki-Seiten umbenennen"
permission_save_queries: "Filter speichern"
permission_select_project_modules: "Projektmodule auswählen"
permission_manage_types: "Typen auswählen"
permission_view_calendar: "Kalender ansehen"
permission_view_changesets: "Changesets ansehen"
permission_view_commit_author_statistics: "Commit Autor Statistiken ansehen"
@ -1177,8 +1179,8 @@ de:
setting_gravatar_enabled: "Gravatar-Benutzerbilder benutzen"
setting_host_name: "Hostname"
setting_work_package_done_ratio: "Berechne den Arbeitspaket-Fortschritt mittels"
setting_work_package_done_ratio_issue_field: "Arbeitspaket-Feld %-erledigt"
setting_work_package_done_ratio_issue_status: "Arbeitspaket-Status"
setting_work_package_done_ratio_field: "Arbeitspaket-Feld %-erledigt"
setting_work_package_done_ratio_status: "Arbeitspaket-Status"
setting_work_package_done_ratio_disabled: "Deaktivieren (Fortschritt verstecken)"
setting_work_package_list_default_columns: "Standardmäßig anzeigen"
setting_work_package_list_summable_columns: "Summierbar"

@ -89,7 +89,7 @@ en:
delay: "Delay"
from: "Work Package"
to: "Related work package"
issue_status:
status:
is_closed: "Work package closed"
journal:
notes: "Notes"
@ -240,8 +240,8 @@ en:
custom_field: "Custom field"
group: "Group"
issue: "Issue"
issue_category: "Category"
issue_status: "Issue status"
category: "Category"
status: "Issue status"
member: "Member"
news: "News"
project: "Project"
@ -414,12 +414,12 @@ en:
default_activity_design: "Design"
default_activity_development: "Development"
default_issue_status_closed: "Closed"
default_issue_status_feedback: "Feedback"
default_issue_status_in_progress: "In Progress"
default_issue_status_new: "New"
default_issue_status_rejected: "Rejected"
default_issue_status_resolved: "Resolved"
default_status_closed: "Closed"
default_status_feedback: "Feedback"
default_status_in_progress: "In Progress"
default_status_new: "New"
default_status_rejected: "Rejected"
default_status_resolved: "Resolved"
default_priority_high: "High"
default_priority_immediate: "Immediate"
default_priority_low: "Low"
@ -453,7 +453,7 @@ en:
description_enter_text: "Enter text"
description_filter: "Filter"
description_filter_toggle: "Show/Hide filter"
description_issue_category_reassign: "Choose category"
description_category_reassign: "Choose category"
description_message_content: "Message content"
description_my_project: "You are member"
description_noscript: "You need to activate JavaScript in order to use OpenProject!"
@ -496,7 +496,7 @@ en:
error_scm_annotate: "The entry does not exist or cannot be annotated."
error_scm_command_failed: "An error occurred when trying to access the repository: %{value}"
error_scm_not_found: "The entry or revision was not found in the repository."
error_unable_delete_issue_status: "Unable to delete work package status"
error_unable_delete_status: "Unable to delete work package status"
error_unable_to_connect: "Unable to connect (%{value})"
error_workflow_copy_source: "Please select a source type or role"
error_workflow_copy_target: "Please select target type(s) and role(s)"
@ -596,6 +596,7 @@ en:
label_bulk_edit_selected_issues: "Bulk edit selected issues"
label_calendar: "Calendar"
label_calendar_show: "Show Calendar"
label_category: "Category"
label_change_plural: "Changes"
label_change_properties: "Change properties"
label_change_status: "Change status"
@ -1087,6 +1088,7 @@ en:
permission_rename_wiki_pages: "Rename wiki pages"
permission_save_queries: "Save queries"
permission_select_project_modules: "Select project modules"
permission_manage_types: "Select types"
permission_view_calendar: "View calendar"
permission_view_changesets: "View changesets"
permission_view_commit_author_statistics: "View commit author statistics"
@ -1153,8 +1155,8 @@ en:
setting_gravatar_enabled: "Use Gravatar user icons"
setting_host_name: "Host name and path"
setting_work_package_done_ratio: "Calculate the work package done ratio with"
setting_work_package_done_ratio_issue_field: "Use the work package field"
setting_work_package_done_ratio_issue_status: "Use the work package status"
setting_work_package_done_ratio_field: "Use the work package field"
setting_work_package_done_ratio_status: "Use the work package status"
setting_work_package_done_ratio_disabled: "Disable (hide the progress)"
setting_work_package_list_default_columns: "Display by default"
setting_work_package_list_summable_columns: "Summable"

@ -61,7 +61,7 @@ OpenProject::Application.routes.draw do
resources :planning_element_journals
resources :statuses do
collection do
get :paginate_issue_statuses
get :paginate_statuses
end
end
resources :colors, :controller => 'planning_element_type_colors'
@ -213,13 +213,6 @@ OpenProject::Application.routes.draw do
# work as a catchall for everything under /wiki
get 'wiki' => "wiki#show"
resources :issues, :only => [] do
collection do
match '/report/:detail' => 'issues/reports#report_details', :via => :get
match '/report' => 'issues/reports#report', :via => :get
end
end
namespace :work_packages do
resources :calendar, :controller => 'calendars', :only => [:index]
end
@ -227,13 +220,18 @@ OpenProject::Application.routes.draw do
resources :work_packages, :only => [:new, :create, :index] do
get :new_type, :on => :collection
put :preview, :on => :collection
collection do
match '/report/:detail' => 'work_packages/reports#report_details', :via => :get
match '/report' => 'work_packages/reports#report', :via => :get
end
end
resources :activity, :activities, :only => :index, :controller => 'activities'
resources :boards
resources :issue_categories, :except => [:index, :show], :shallow => true
resources :categories, :except => [:index, :show], :shallow => true
resources :members, :only => [:create, :update, :destroy], :shallow => true do
get :autocomplete, :on => :collection

@ -191,7 +191,7 @@ work_package_list_summable_columns:
display_subprojects_work_packages:
default: 1
work_package_done_ratio:
default: 'issue_field'
default: 'field'
default_projects_public:
default: 1
default_projects_modules:

@ -45,7 +45,7 @@ class LegacyIssuesToWorkPackages < ActiveRecord::Migration
end
def reset_public_key_sequence_in_postgres
return unless ActiveRecord::Base.connection.instance_values["config"][:adapter] == "postgres"
return unless ActiveRecord::Base.connection.instance_values["config"][:adapter] == "postgresql"
ActiveRecord::Base.connection.reset_pk_sequence!('work_packages')
end

@ -0,0 +1,5 @@
class RenameIssueCategoryToCategory < ActiveRecord::Migration
def change
rename_table :issue_categories, :categories
end
end

@ -0,0 +1,5 @@
class RenameIssueStatusesToStatuses < ActiveRecord::Migration
def change
rename_table :issue_statuses, :statuses
end
end

@ -52,7 +52,7 @@ project = Project.create(name: "Seeded Project",
)
# this will fail rather miserably, when there are no statuses present
statuses = IssueStatus.all
statuses = Status.all
# don't bother with milestones, too difficult to handle all cases
types = project.types.all.reject{|type| type.is_milestone?}

@ -29,13 +29,20 @@ See doc/COPYRIGHT.rdoc for more details.
# Changelog
## 3.0.0pre20
* `#1281` I18n.js Not working correctly. Always returns English Translations
* `#1560` WorkPackage/update does not retain some fields when validations fail
* `#1560` WorkPackage/update does not retain some fields when validations fail
* `#1771` Refactor Types Project Settings into new Tab
* `#1929` Too many lines in work package view
* `#1946` Modal shown within in Modal
* `#1949` External links within modals do not work
* `#1992` Prepare schema migrations table
* `#2125` All AJAX actions on work package not working after update
* `#2237` Migrate reports controller tests
* `#2246` Migrate issue categories controller tests
* `#2262` Migrate issue statuses controller tests
* `#2267` Rename view issue hooks
## 3.0.0pre19

@ -59,7 +59,7 @@ Feature: Project creation with support for project type
When the following types are enabled for projects of type "Standard Project"
| Phase |
| Milestone |
And I go to the settings page of the project called "Fancy Pants"
And I go to the "types" tab of the settings page of the project called "Fancy Pants"
Then the "Phase" checkbox should be checked
And the "Milestone" checkbox should be checked

@ -69,7 +69,7 @@ end
When(/^I call the work_package\-api on project "(.*?)" requesting format "(.*?)" filtering for status "(.*?)"$/) do |project_name, format, status_names|
statuses = IssueStatus.where(name: status_names.split(','))
statuses = Status.where(name: status_names.split(','))
get_filtered_json(project_name: project_name,
format: format,

@ -267,8 +267,8 @@ end
Given /^there are the following issue status:$/ do |table|
table.hashes.each_with_index do |t, i|
status = IssueStatus.find_by_name(t['name'])
status = IssueStatus.new :name => t['name'] if status.nil?
status = Status.find_by_name(t['name'])
status = Status.new :name => t['name'] if status.nil?
status.is_closed = t['is_closed'] == 'true' ? true : false
status.is_default = t['is_default'] == 'true' ? true : false
status.position = t['position'] ? t['position'] : i
@ -282,7 +282,7 @@ Given /^the type "(.+?)" has the default workflow for the role "(.+?)"$/ do |typ
type = Type.find_by_name(type_name)
type.workflows = []
IssueStatus.all(:order => "id ASC").collect(&:id).combination(2).each do |c|
Status.all(:order => "id ASC").collect(&:id).combination(2).each do |c|
type.workflows.build(:old_status_id => c[0], :new_status_id => c[1], :role => role)
end
type.save!

@ -1,29 +0,0 @@
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
InstanceFinder.register(IssueStatus, Proc.new { |name| IssueStatus.find_by_name(name) })

@ -39,7 +39,7 @@ Given (/^there are the following work packages(?: in project "([^"]*)")?:$/) do
["type", Type],
["fixed_version", Version],
["priority", IssuePriority],
["status", IssueStatus],
["status", Status],
["parent", WorkPackage]
].each do |key, const|
if type_attributes[key].present?

@ -28,7 +28,7 @@
Given /^there is a(?:n)? (default )?(?:issue)?status with:$/ do |default, table|
name = table.raw.select { |ary| ary.include? "name" }.first[table.raw.first.index("name") + 1].to_s
IssueStatus.find_by_name(name) || IssueStatus.create(:name => name.to_s, :is_default => !!default)
Status.find_by_name(name) || Status.create(:name => name.to_s, :is_default => !!default)
end
Given /^there are the following status:$/ do |table|
@ -36,7 +36,8 @@ Given /^there are the following status:$/ do |table|
attributes = row.inject({}) { |mem, (k, v)| mem[k.to_sym] = v if v.present?; mem }
attributes[:is_default] = attributes.delete(:default) == "true"
FactoryGirl.create(:issue_status, attributes)
FactoryGirl.create(:status, attributes)
end
end
InstanceFinder.register(Status, Proc.new { |name| Status.find_by_name(name) })

@ -47,6 +47,19 @@ module NavigationHelpers
when /^the login page$/
'/login'
when /^the(?: "(.+?)" tab of the)? settings page (?:of|for) the project called "(.+?)"$/
tab = $1 || ""
project_identifier = $2.gsub("\"", "")
tab.gsub("\"", "")
project_identifier = Project.find_by_name(project_identifier).identifier.gsub(' ', '%20')
if tab == ""
"/projects/#{project_identifier}/settings"
else
"/projects/#{project_identifier}/settings/#{tab}"
end
when /^the [wW]iki [pP]age "([^\"]+)" (?:for|of) the project called "([^\"]+)"$/
wiki_page = Wiki.titleize($1)
project_identifier = $2.gsub("\"", "")

@ -47,19 +47,20 @@ Feature: Types Settings
And there is a role "project admin"
And the role "project admin" may have the following rights:
| edit_project |
| manage_types |
| manage_project_configuration |
And the user "padme" is a "project admin"
And I am already logged in as "padme"
Scenario: The project admin may see the currently enabled types
When I go to the settings page of the project called "ecookbook"
When I go to the "types" tab of the settings page of the project called "ecookbook"
Then the "Phase" checkbox should be checked
And the "Milestone" checkbox should be checked
And the "Something else" checkbox should not be checked
Scenario: The project admin may set the currently enabled types
When I go to the settings page of the project called "ecookbook"
When I go to the "types" tab of the settings page of the project called "ecookbook"
And I check "Something else"
And I uncheck "Milestone"
And I press "Save"

@ -44,7 +44,7 @@ Feature: Navigating from reports to index
And the user "bob" is a "member" in the project "parent"
And I am already logged in as "bob"
Scenario: Navigating from issue reports back to issue overview
When I go to the issues/report page of the project called "parent"
Scenario: Navigating from work package reports back to work package overview
When I go to the work_packages/report page of the project called "parent"
And I follow "Work packages" within "#main-menu"
Then I should be on the work packages index page of the project called "parent"

@ -49,7 +49,7 @@ module OpenProject
#
# 2.0.0debian-2
def self.special
'pre19'
'pre20'
end
def self.revision

@ -58,9 +58,20 @@
# search_for Project do |query|
# do_something
# end
#
# Note that this needs to return an actual scope or its corresponding hash.
#
# To change the response the action will give:
# response_for Project, :my_custom_response
# response_for Project, Proc.new {
# respond_to do |format|
# DO SOMETHING
# end
# }
# This needs to return something that can be #instance_eval'ed AND #call'ed, i.e. a Proc.
# A String containing code will NOT work.
#
#
#
module Pagination::Controller
class Paginator
attr_accessor :model, :action, :pagination, :search, :controller, :last_action, :block, :response

@ -86,11 +86,12 @@ Redmine::AccessControl.map do |map|
map.permission :select_project_modules, {:projects => :modules}, :require => :member
map.permission :manage_members, {:projects => :settings, :members => [:create, :update, :destroy, :autocomplete_for_member]}, :require => :member
map.permission :manage_versions, {:projects => :settings, :versions => [:new, :create, :edit, :update, :close_completed, :destroy]}, :require => :member
map.permission :manage_types, {:projects => :types}, :require => :member
map.permission :add_subprojects, {:projects => [:new, :create]}, :require => :member
map.project_module :issue_tracking do |map|
# Issue categories
map.permission :manage_categories, {:projects => :settings, :issue_categories => [:new, :create, :edit, :update, :destroy]}, :require => :member
map.permission :manage_categories, {:projects => :settings, :categories => [:new, :create, :edit, :update, :destroy]}, :require => :member
# Issues
map.permission :view_work_packages, {:'issues' => [:index, :all, :show],
:auto_complete => [:issues],
@ -99,7 +100,7 @@ Redmine::AccessControl.map do |map|
:journals => [:index, :diff],
:queries => :index,
:work_packages => [:show, :index],
:'issues/reports' => [:report, :report_details],
:'work_packages/reports' => [:report, :report_details],
:planning_elements => [:index, :all, :show, :recycle_bin],
:planning_element_journals => [:index]}
map.permission :export_work_packages, {:'work_packages' => [:index, :all]}
@ -252,8 +253,8 @@ Redmine::MenuManager.map :admin_menu do |menu|
menu.push :groups, {:controller => '/groups'}, :caption => :label_group_plural
menu.push :roles, {:controller => '/roles'}, :caption => :label_role_and_permissions
menu.push :types, {:controller => '/types'}, :caption => :label_type_plural
menu.push :issue_statuses, {:controller => '/issue_statuses'}, :caption => :label_work_package_status_plural,
:html => {:class => 'issue_statuses'}
menu.push :statuses, {:controller => '/statuses'}, :caption => :label_work_package_status_plural,
:html => {:class => 'statuses'}
menu.push :workflows, {:controller => '/workflows', :action => 'edit'}, :caption => Proc.new { Workflow.model_name.human }
menu.push :custom_fields, {:controller => '/custom_fields'}, :caption => :label_custom_field_plural,
:html => {:class => 'custom_fields'}

@ -40,7 +40,7 @@ module Redmine
def no_data?
!Role.find(:first, :conditions => {:builtin => 0}) &&
!Type.find(:first, :conditions => {is_standard: false}) &&
!IssueStatus.find(:first) &&
!Status.find(:first) &&
!Enumeration.find(:first)
end
@ -176,17 +176,17 @@ module Redmine
:position => 5
# Issue statuses
new = IssueStatus.create!(:name => l(:default_issue_status_new), :is_closed => false, :is_default => true, :position => 1)
in_progress = IssueStatus.create!(:name => l(:default_issue_status_in_progress), :is_closed => false, :is_default => false, :position => 3)
resolved = IssueStatus.create!(:name => l(:default_issue_status_resolved), :is_closed => false, :is_default => false, :position => 3)
feedback = IssueStatus.create!(:name => l(:default_issue_status_feedback), :is_closed => false, :is_default => false, :position => 4)
closed = IssueStatus.create!(:name => l(:default_issue_status_closed), :is_closed => true, :is_default => false, :position => 5)
rejected = IssueStatus.create!(:name => l(:default_issue_status_rejected), :is_closed => true, :is_default => false, :position => 6)
new = Status.create!(:name => l(:default_status_new), :is_closed => false, :is_default => true, :position => 1)
in_progress = Status.create!(:name => l(:default_status_in_progress), :is_closed => false, :is_default => false, :position => 3)
resolved = Status.create!(:name => l(:default_status_resolved), :is_closed => false, :is_default => false, :position => 3)
feedback = Status.create!(:name => l(:default_status_feedback), :is_closed => false, :is_default => false, :position => 4)
closed = Status.create!(:name => l(:default_status_closed), :is_closed => true, :is_default => false, :position => 5)
rejected = Status.create!(:name => l(:default_status_rejected), :is_closed => true, :is_default => false, :position => 6)
# Workflow
Type.find(:all).each { |t|
IssueStatus.find(:all).each { |os|
IssueStatus.find(:all).each { |ns|
Status.find(:all).each { |os|
Status.find(:all).each { |ns|
Workflow.create!(:type_id => t.id, :role_id => manager.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
}
}

@ -40,7 +40,7 @@ module Redmine
notifications << Notifiable.new('issue_added')
notifications << Notifiable.new('issue_updated')
notifications << Notifiable.new('issue_note_added', 'issue_updated')
notifications << Notifiable.new('issue_status_updated', 'issue_updated')
notifications << Notifiable.new('status_updated', 'issue_updated')
notifications << Notifiable.new('issue_priority_updated', 'issue_updated')
notifications << Notifiable.new('news_added')
notifications << Notifiable.new('news_comment_added')

@ -29,7 +29,7 @@
class ScenarioDisabler
def self.empty_if_disabled(scenario)
if self.disabled?(scenario)
scenario.instance_variable_set(:@steps,::Cucumber::Ast::StepCollection.new([]))
scenario.skip_invoke!
true
else
false

@ -28,8 +28,6 @@ namespace :migrations do
def user_agrees
questions = []
a = true
questions << "CAUTION: This rake task will delete ALL attachments attached to versions or projects!"
questions << "DISCLAIMER: This is the final warning: You're going to lose information!"
@ -43,9 +41,9 @@ namespace :migrations do
def ask_question(question)
puts "\n\n"
puts question
puts "\nDo you want to continue? (Y/n)"
puts "\nDo you want to continue? [y/N]"
STDIN.gets.chomp == 'Y'
STDIN.gets.chomp == 'y'
end
end
end

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save