Merge pull request #8219 from opf/fix/replace_fixed_version_reference

rename fixed_version to version
pull/8220/head
Oliver Günther 5 years ago committed by GitHub
commit 779d959af7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/contracts/projects/archive_contract.rb
  2. 2
      app/contracts/versions/delete_contract.rb
  3. 14
      app/contracts/work_packages/base_contract.rb
  4. 2
      app/contracts/work_packages/copy_project_contract.rb
  5. 2
      app/controllers/time_entries/reports_controller.rb
  6. 4
      app/controllers/versions_controller.rb
  7. 2
      app/controllers/work_packages/moves_controller.rb
  8. 6
      app/helpers/work_packages_filter_helper.rb
  9. 5
      app/models/mail_handler.rb
  10. 2
      app/models/permitted_params.rb
  11. 6
      app/models/projects/copy.rb
  12. 6
      app/models/queries/work_packages/columns/property_column.rb
  13. 4
      app/models/queries/work_packages/filter/version_filter.rb
  14. 13
      app/models/version.rb
  15. 32
      app/models/work_package.rb
  16. 2
      app/models/work_package/journalized.rb
  17. 2
      app/models/work_package/validations.rb
  18. 2
      app/seeders/demo_data/query_builder.rb
  19. 2
      app/seeders/demo_data/work_package_seeder.rb
  20. 2
      app/services/reports/version_report.rb
  21. 2
      app/services/versions/update_service.rb
  22. 10
      app/services/work_packages/set_attributes_service.rb
  23. 2
      app/views/user_mailer/_issue_details.html.erb
  24. 2
      app/views/user_mailer/_issue_details.text.erb
  25. 6
      app/views/versions/_overview.html.erb
  26. 2
      app/views/versions/create.js.erb
  27. 2
      app/views/versions/show.html.erb
  28. 4
      app/views/work_packages/bulk/edit.html.erb
  29. 4
      app/views/work_packages/moves/new.html.erb
  30. 2
      config/constants/ar_to_api_conversions.rb
  31. 2
      config/locales/crowdin/ar.yml
  32. 2
      config/locales/crowdin/bg.yml
  33. 2
      config/locales/crowdin/ca.yml
  34. 2
      config/locales/crowdin/cs.yml
  35. 2
      config/locales/crowdin/da.yml
  36. 2
      config/locales/crowdin/de.yml
  37. 2
      config/locales/crowdin/el.yml
  38. 2
      config/locales/crowdin/es.yml
  39. 2
      config/locales/crowdin/fi.yml
  40. 2
      config/locales/crowdin/fil.yml
  41. 2
      config/locales/crowdin/fr.yml
  42. 2
      config/locales/crowdin/hr.yml
  43. 2
      config/locales/crowdin/hu.yml
  44. 2
      config/locales/crowdin/id.yml
  45. 2
      config/locales/crowdin/it.yml
  46. 2
      config/locales/crowdin/ja.yml
  47. 2
      config/locales/crowdin/ko.yml
  48. 2
      config/locales/crowdin/lt.yml
  49. 2
      config/locales/crowdin/nl.yml
  50. 2
      config/locales/crowdin/no.yml
  51. 2
      config/locales/crowdin/pl.yml
  52. 2
      config/locales/crowdin/pt-BR.yml
  53. 2
      config/locales/crowdin/pt.yml
  54. 2
      config/locales/crowdin/ro.yml
  55. 2
      config/locales/crowdin/ru.yml
  56. 2
      config/locales/crowdin/sk.yml
  57. 2
      config/locales/crowdin/sv.yml
  58. 2
      config/locales/crowdin/tr.yml
  59. 2
      config/locales/crowdin/uk.yml
  60. 2
      config/locales/crowdin/vi.yml
  61. 2
      config/locales/crowdin/zh-CN.yml
  62. 2
      config/locales/crowdin/zh-TW.yml
  63. 2
      config/locales/en.yml
  64. 37
      db/migrate/20200326102408_rename_fixed_version.rb
  65. 2
      docs/installation-and-operations/configuration/incoming-emails/README.md
  66. 2
      features/step_definitions/issue_steps.rb
  67. 2
      lib/api/utilities/property_name_converter.rb
  68. 2
      lib/api/v3/work_packages/eager_loading/checksum.rb
  69. 3
      lib/api/v3/work_packages/work_package_representer.rb
  70. 1
      lib/plugins/acts_as_journalized/lib/acts_as_journalized.rb
  71. 88
      lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/reload.rb
  72. 17
      lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/reversion.rb
  73. 2
      lib/tasks/email.rake
  74. 2
      modules/backlogs/app/assets/javascripts/backlogs/impediment.js
  75. 2
      modules/backlogs/app/assets/javascripts/backlogs/story.js
  76. 2
      modules/backlogs/app/assets/stylesheets/backlogs/master_backlog.sass
  77. 2
      modules/backlogs/app/controllers/rb_impediments_controller.rb
  78. 4
      modules/backlogs/app/controllers/rb_queries_controller.rb
  79. 2
      modules/backlogs/app/controllers/rb_stories_controller.rb
  80. 4
      modules/backlogs/app/models/impediment.rb
  81. 4
      modules/backlogs/app/models/sprint.rb
  82. 10
      modules/backlogs/app/models/story.rb
  83. 2
      modules/backlogs/app/views/rb_stories/_story.html.erb
  84. 2
      modules/backlogs/config/locales/crowdin/ar.yml
  85. 2
      modules/backlogs/config/locales/crowdin/bg.yml
  86. 2
      modules/backlogs/config/locales/crowdin/ca.yml
  87. 2
      modules/backlogs/config/locales/crowdin/cs.yml
  88. 2
      modules/backlogs/config/locales/crowdin/da.yml
  89. 2
      modules/backlogs/config/locales/crowdin/de.yml
  90. 2
      modules/backlogs/config/locales/crowdin/el.yml
  91. 2
      modules/backlogs/config/locales/crowdin/es.yml
  92. 2
      modules/backlogs/config/locales/crowdin/fi.yml
  93. 2
      modules/backlogs/config/locales/crowdin/fil.yml
  94. 2
      modules/backlogs/config/locales/crowdin/fr.yml
  95. 2
      modules/backlogs/config/locales/crowdin/hr.yml
  96. 2
      modules/backlogs/config/locales/crowdin/hu.yml
  97. 2
      modules/backlogs/config/locales/crowdin/id.yml
  98. 2
      modules/backlogs/config/locales/crowdin/it.yml
  99. 2
      modules/backlogs/config/locales/crowdin/ja.yml
  100. 2
      modules/backlogs/config/locales/crowdin/ko.yml
  101. Some files were not shown because too many files have changed in this diff Show More

@ -50,7 +50,7 @@ module Projects
exists = WorkPackage
.where.not(project_id: model.self_and_descendants.select(:id))
.where(fixed_version_id: version_ids)
.where(version_id: version_ids)
.exists?
errors.add :base, :foreign_wps_reference_version if exists

@ -39,7 +39,7 @@ module Versions
protected
def validate_no_work_packages_attached
return unless model.fixed_issues.exists?
return unless model.work_packages.exists?
errors.add(:base, :undeletable_work_packages_attached)
end

@ -44,9 +44,9 @@ module WorkPackages
attribute :type_id
attribute :priority_id
attribute :category_id
attribute :fixed_version_id,
attribute :version_id,
permission: :assign_versions do
validate_fixed_version_is_assignable
validate_version_is_assignable
end
validate :validate_no_reopen_on_closed_version
@ -266,14 +266,14 @@ module WorkPackages
end
end
def validate_fixed_version_is_assignable
if model.fixed_version_id && !model.assignable_versions.map(&:id).include?(model.fixed_version_id)
errors.add :fixed_version_id, :inclusion
def validate_version_is_assignable
if model.version_id && !model.assignable_versions.map(&:id).include?(model.version_id)
errors.add :version_id, :inclusion
end
end
def validate_no_reopen_on_closed_version
if model.fixed_version_id && model.reopened? && model.fixed_version.closed?
if model.version_id && model.reopened? && model.version.closed?
errors.add :base, I18n.t(:error_can_not_reopen_work_package_on_closed_version)
end
end
@ -371,7 +371,7 @@ module WorkPackages
end
def closed_version_and_status?(status = model.status)
model.fixed_version&.closed? && status.is_closed?
model.version&.closed? && status.is_closed?
end
def new_statuses_by_workflow(status)

@ -42,7 +42,7 @@ module WorkPackages
private
def validate_fixed_version_is_assignable; end
def validate_version_is_assignable; end
def validate_no_reopen_on_closed_version; end
end

@ -118,7 +118,7 @@ class TimeEntries::ReportsController < ApplicationController
@available_criterias = { 'project' => { sql: "#{TimeEntry.table_name}.project_id",
klass: Project,
label: Project.model_name.human },
'version' => { sql: "#{WorkPackage.table_name}.fixed_version_id",
'version' => { sql: "#{WorkPackage.table_name}.version_id",
klass: Version,
label: Version.model_name.human },
'category' => { sql: "#{WorkPackage.table_name}.category_id",

@ -56,7 +56,7 @@ class VersionsController < ApplicationController
def show
@issues = @version
.fixed_issues
.work_packages
.visible
.includes(:status, :type, :priority)
.order("#{::Type.table_name}.position, #{WorkPackage.table_name}.id")
@ -163,7 +163,7 @@ class VersionsController < ApplicationController
def work_packages_of_version(version, project_ids, selected_type_ids)
version
.fixed_issues
.work_packages
.visible
.includes(:project, :status, :type, :priority)
.where(type_id: selected_type_ids, project_id: project_ids)

@ -161,7 +161,7 @@ class WorkPackages::MovesController < ApplicationController
:start_date,
:due_date,
:status_id,
:fixed_version_id,
:version_id,
:priority_id)
.to_h
.reject { |_, v| v.blank? }

@ -34,7 +34,7 @@ module WorkPackagesFilterHelper
query = {
f: [
filter_object('status_id', 'c'),
filter_object('fixed_version_id', '=', version.id)
filter_object('version_id', '=', version.id)
]
}
project_work_packages_with_query_path(version.project, query, options)
@ -44,7 +44,7 @@ module WorkPackagesFilterHelper
query = {
f: [
filter_object('status_id', 'o'),
filter_object('fixed_version_id', '=', version.id)
filter_object('version_id', '=', version.id)
]
}
project_work_packages_with_query_path(version.project, query, options)
@ -104,7 +104,7 @@ module WorkPackagesFilterHelper
query = {
f: [
filter_object('status_id', '*'),
filter_object('fixed_version_id', '=', version.id),
filter_object('version_id', '=', version.id),
filter_object(property_name, '=', property_id)
],
t: default_sort

@ -262,7 +262,8 @@ class MailHandler < ActionMailer::Base
container: container,
file: file,
author: user,
content_type: attachment.mime_type)
content_type: attachment.mime_type
)
end
end
@ -340,7 +341,7 @@ class MailHandler < ActionMailer::Base
'priority_id' => lookup_case_insensitive_key(IssuePriority, :priority),
'category_id' => lookup_case_insensitive_key(project.categories, :category),
'assigned_to_id' => assigned_to.try(:id),
'fixed_version_id' => lookup_case_insensitive_key(project.shared_versions, :fixed_version, Arel.sql("#{Version.table_name}.name")),
'version_id' => lookup_case_insensitive_key(project.shared_versions, :version, Arel.sql("#{Version.table_name}.name")),
'start_date' => get_keyword(:start_date, override: true, format: '\d{4}-\d{2}-\d{2}'),
'due_date' => get_keyword(:due_date, override: true, format: '\d{4}-\d{2}-\d{2}'),
'estimated_hours' => get_keyword(:estimated_hours, override: true),

@ -527,7 +527,7 @@ class PermittedParams
:done_ratio,
:due_date,
:estimated_hours,
:fixed_version_id,
:version_id,
:parent_id,
:priority_id,
:responsible_id,

@ -156,7 +156,7 @@ module Projects::Copy
# so that parents get copied before their children.
to_copy = project
.work_packages
.includes(:custom_values, :fixed_version, :assigned_to, :responsible)
.includes(:custom_values, :version, :assigned_to, :responsible)
.order_by_ancestors('asc')
.order('id ASC')
@ -348,7 +348,7 @@ module Projects::Copy
{
project: self,
parent_id: parent_id,
fixed_version: work_package_version(source_work_package),
version: work_package_version(source_work_package),
assigned_to: work_package_assigned_to(source_work_package),
responsible: work_package_responsible(source_work_package),
custom_field_values: custom_value_attributes,
@ -359,7 +359,7 @@ module Projects::Copy
end
def work_package_version(source_work_package)
source_work_package.fixed_version && versions.detect { |v| v.name == source_work_package.fixed_version.name }
source_work_package.version && versions.detect { |v| v.name == source_work_package.version.name }
end
def work_package_assigned_to(source_work_package)

@ -95,12 +95,12 @@ class Queries::WorkPackages::Columns::PropertyColumn < Queries::WorkPackages::Co
sortable: "name",
groupable: "#{WorkPackage.table_name}.category_id"
},
fixed_version: {
association: 'fixed_version',
version: {
association: 'version',
sortable: [->(table_name = Version.table_name) { Versions::Scopes::OrderBySemverName.semver_sql(table_name) }, 'name'],
default_order: 'ASC',
null_handling: 'NULLS LAST',
groupable: "#{WorkPackage.table_name}.fixed_version_id"
groupable: "#{WorkPackage.table_name}.version_id"
},
start_date: {
sortable: "#{WorkPackage.table_name}.start_date",

@ -42,11 +42,11 @@ class Queries::WorkPackages::Filter::VersionFilter <
end
def human_name
WorkPackage.human_attribute_name('fixed_version')
WorkPackage.human_attribute_name('version')
end
def self.key
:fixed_version_id
:version_id
end
def ar_object_filter?

@ -33,8 +33,7 @@ class Version < ActiveRecord::Base
include ::Scopes::Scoped
belongs_to :project
has_many :fixed_issues, class_name: 'WorkPackage', foreign_key: 'fixed_version_id', dependent: :nullify
has_many :work_packages, foreign_key: :fixed_version_id
has_many :work_packages, foreign_key: :version_id, dependent: :nullify
acts_as_customizable
VERSION_STATUSES = %w(open locked closed).freeze
@ -77,14 +76,14 @@ class Version < ActiveRecord::Base
# Returns the total estimated time for this version
# (sum of leaves estimated_hours)
def estimated_hours
@estimated_hours ||= fixed_issues.hierarchy_leaves.sum(:estimated_hours).to_f
@estimated_hours ||= work_packages.hierarchy_leaves.sum(:estimated_hours).to_f
end
# Returns the total reported time for this version
def spent_hours
@spent_hours ||= TimeEntry
.includes(:work_package)
.where(work_packages: { fixed_version_id: id })
.where(work_packages: { version_id: id })
.sum(:hours)
.to_f
end
@ -141,7 +140,7 @@ class Version < ActiveRecord::Base
# Returns assigned issues count
def issues_count
@issue_count ||= fixed_issues.count
@issue_count ||= work_packages.count
end
# Returns the total amount of open issues for this version.
@ -198,7 +197,7 @@ class Version < ActiveRecord::Base
# Used to weight unestimated issues in progress calculation
def estimated_average
if @estimated_average.nil?
average = fixed_issues.average(:estimated_hours).to_f
average = work_packages.average(:estimated_hours).to_f
if average.zero?
average = 1
end
@ -224,7 +223,7 @@ class Version < ActiveRecord::Base
["COALESCE(#{WorkPackage.table_name}.estimated_hours, ?) * #{ratio}", estimated_average]
)
done = fixed_issues
done = work_packages
.where(statuses: { is_closed: !open })
.includes(:status)
.sum(sum_sql)

@ -43,8 +43,6 @@ class WorkPackage < ActiveRecord::Base
include OpenProject::Journal::AttachmentHelper
DONE_RATIO_OPTIONS = %w(field status disabled).freeze
ATTRIBS_WITH_VALUES_FROM_CHILDREN =
%w(start_date due_date estimated_hours done_ratio).freeze
belongs_to :project
belongs_to :type
@ -52,7 +50,7 @@ class WorkPackage < ActiveRecord::Base
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: 'Principal', foreign_key: 'responsible_id'
belongs_to :fixed_version, class_name: 'Version', foreign_key: 'fixed_version_id'
belongs_to :version
belongs_to :priority, class_name: 'IssuePriority', foreign_key: 'priority_id'
belongs_to :category, class_name: 'Category', foreign_key: 'category_id'
@ -104,7 +102,7 @@ class WorkPackage < ActiveRecord::Base
}
scope :without_version, -> {
where(fixed_version_id: nil)
where(version_id: nil)
}
scope :with_query, ->(query) {
@ -264,7 +262,7 @@ class WorkPackage < ActiveRecord::Base
# (to make sure, that you can still update closed tickets)
def assignable_versions
@assignable_versions ||= begin
current_version = fixed_version_id_changed? ? Version.find_by(id: fixed_version_id_was) : fixed_version
current_version = version_id_changed? ? Version.find_by(id: version_id_was) : version
((project&.assignable_versions || []) + [current_version]).compact.uniq
end
end
@ -432,7 +430,7 @@ class WorkPackage < ActiveRecord::Base
# Unassigns issues from +version+ if it's no longer shared with issue's project
def self.update_versions_from_sharing_change(version)
# Update issues assigned to the version
update_versions(["#{WorkPackage.table_name}.fixed_version_id = ?", version.id])
update_versions(["#{WorkPackage.table_name}.version_id = ?", version.id])
end
# Unassigns issues from versions that are no longer shared
@ -456,7 +454,7 @@ class WorkPackage < ActiveRecord::Base
def self.by_version(project)
count_and_group_by project: project,
field: 'fixed_version_id',
field: 'version_id',
joins: Version.table_name
end
@ -641,28 +639,28 @@ class WorkPackage < ActiveRecord::Base
default_id && attributes.except(key).values.all?(&:blank?)
end
def self.having_fixed_version_from_other_project
def self.having_version_from_other_project
where(
"#{WorkPackage.table_name}.fixed_version_id IS NOT NULL" +
"#{WorkPackage.table_name}.version_id IS NOT NULL" +
" AND #{WorkPackage.table_name}.project_id <> #{Version.table_name}.project_id" +
" AND #{Version.table_name}.sharing <> 'system'"
)
end
private_class_method :having_fixed_version_from_other_project
private_class_method :having_version_from_other_project
# Update issues so their versions are not pointing to a
# fixed_version that is not shared with the issue's project
# version that is not shared with the issue's project
def self.update_versions(conditions = nil)
# Only need to update issues with a fixed_version from
# Only need to update issues with a version from
# a different project and that is not systemwide shared
having_fixed_version_from_other_project
having_version_from_other_project
.where(conditions)
.includes(:project, :fixed_version)
.includes(:project, :version)
.references(:versions).each do |issue|
next if issue.project.nil? || issue.fixed_version.nil?
next if issue.project.nil? || issue.version.nil?
unless issue.project.shared_versions.include?(issue.fixed_version)
issue.fixed_version = nil
unless issue.project.shared_versions.include?(issue.version)
issue.version = nil
issue.save
end
end

@ -91,7 +91,7 @@ module WorkPackage::Journalized
register_on_journal_formatter :named_association, :parent_id, :project_id,
:status_id, :type_id,
:assigned_to_id, :priority_id,
:category_id, :fixed_version_id,
:category_id, :version_id,
:planning_element_status_id,
:author_id, :responsible_id
register_on_journal_formatter :datetime, :start_date, :due_date

@ -50,7 +50,7 @@ module WorkPackage::Validations
:status,
:author,
:category,
:fixed_version)
:version)
}
end
end

@ -136,7 +136,7 @@ module DemoData
def set_version_filter!(filters)
if version = config[:version].presence
filters[:fixed_version_id] = {
filters[:version_id] = {
operator: "=",
values: [Version.find_by(name: version).id]
}

@ -138,7 +138,7 @@ module DemoData
def set_version!(wp_attr, attributes)
if attributes[:version]
wp_attr[:fixed_version] = Version.find_by!(name: attributes[:version])
wp_attr[:version] = Version.find_by!(name: attributes[:version])
end
end

@ -33,7 +33,7 @@ class Reports::VersionReport < Reports::Report
end
def field
@field ||= 'fixed_version_id'
@field ||= 'version_id'
end
def rows

@ -38,7 +38,7 @@ module Versions
service_call
end
# Update the issue's fixed versions. Used if a version's sharing changes.
# Update the issue's versions. Used if a version's sharing changes.
def update_wps_from_sharing_change
if no_valid_version_before_or_now? ||
sharing_now_less_broad?

@ -131,7 +131,7 @@ class WorkPackages::SetAttributesService < ::BaseServices::SetAttributes
return unless work_package.project_id_changed? && work_package.project_id
change_by_system do
set_fixed_version_to_nil
set_version_to_nil
reassign_category
reassign_type unless work_package.type_id_changed?
@ -149,11 +149,11 @@ class WorkPackages::SetAttributesService < ::BaseServices::SetAttributes
end
end
def set_fixed_version_to_nil
if work_package.fixed_version &&
def set_version_to_nil
if work_package.version &&
!(work_package.project &&
work_package.project.shared_versions.include?(work_package.fixed_version))
work_package.fixed_version = nil
work_package.project.shared_versions.include?(work_package.version))
work_package.version = nil
end
end

@ -36,7 +36,7 @@ See docs/COPYRIGHT.rdoc for more details.
<li><%= WorkPackage.human_attribute_name(:assigned_to) %>: <%= issue.assigned_to %></li>
<li><%= WorkPackage.human_attribute_name(:responsible) %>: <%= issue.responsible %></li>
<li><%= WorkPackage.human_attribute_name(:category) %>: <%= issue.category %></li>
<li><%= WorkPackage.human_attribute_name(:fixed_version) %>: <%= issue.fixed_version %></li>
<li><%= WorkPackage.human_attribute_name(:version) %>: <%= issue.version %></li>
<li><%= WorkPackage.human_attribute_name(:start_date) %>: <%= issue.start_date %></li>
<li><%= WorkPackage.human_attribute_name(:due_date) %>: <%= issue.due_date %></li>
<li><%= WorkPackage.human_attribute_name(:estimated_hours)%>: <%= issue.estimated_hours %></li>

@ -36,7 +36,7 @@ See docs/COPYRIGHT.rdoc for more details.
<%= WorkPackage.human_attribute_name(:assigned_to) %>: <%= issue.assigned_to %>
<%= WorkPackage.human_attribute_name(:responsible) %>: <%= issue.responsible %>
<%= WorkPackage.human_attribute_name(:category) %>: <%= issue.category %>
<%= WorkPackage.human_attribute_name(:fixed_version) %>: <%= issue.fixed_version %>
<%= WorkPackage.human_attribute_name(:version) %>: <%= issue.version %>
<%= WorkPackage.human_attribute_name(:start_date) %>: <%= issue.start_date %>
<%= WorkPackage.human_attribute_name(:due_date) %>: <%= issue.due_date %>
<%= WorkPackage.human_attribute_name(:estimated_hours)%>: <%= issue.estimated_hours %>

@ -50,18 +50,18 @@ See docs/COPYRIGHT.rdoc for more details.
<% end %>
</ul>
<% if version.fixed_issues.count > 0 %>
<% if version.work_packages.count > 0 %>
<%= progress_bar([version.closed_percent, version.completed_percent], width: '40%', legend: ('%0.0f' % version.completed_percent)) %>
<p class="progress-info">
<%= link_to_if(version.closed_issues_count > 0,
l(:label_x_closed_work_packages_abbr, count: version.closed_issues_count),
project_work_packages_closed_version_path(version)) %>
(<%= '%0.0f' % (version.closed_issues_count.to_f / version.fixed_issues.count * 100) %>%)
(<%= '%0.0f' % (version.closed_issues_count.to_f / version.work_packages.count * 100) %>%)
&#160;
<%= link_to_if(version.open_issues_count > 0,
l(:label_x_open_work_packages_abbr, count: version.open_issues_count),
project_work_packages_open_version_path(version)) %>
(<%= '%0.0f' % (version.open_issues_count.to_f / version.fixed_issues.count * 100) %>%)
(<%= '%0.0f' % (version.open_issues_count.to_f / version.work_packages.count * 100) %>%)
</p>
<% else %>
<%= no_results_box %>

@ -27,4 +27,4 @@ See docs/COPYRIGHT.rdoc for more details.
++#%>
jQuery('#work_package_fixed_version_id').empty().append("<%= escape_javascript(version_options_for_select(versions, version)) %>");
jQuery('#work_package_version_id').empty().append("<%= escape_javascript(version_options_for_select(versions, version)) %>");

@ -95,7 +95,7 @@ See docs/COPYRIGHT.rdoc for more details.
</div>
<% end %>
<% if @version.fixed_issues.count > 0 %>
<% if @version.work_packages.count > 0 %>
<div class="widget-box -thin -wider">
<wp-overview-graph
additional-filter='{ "version": { "operator": "=", "values": [<%= @version.id %>] }}'>

@ -124,9 +124,9 @@ See docs/COPYRIGHT.rdoc for more details.
<% #TODO: allow editing versions when multiple projects %>
<% if @project %>
<div class="form--field">
<label class="form--label" for='work_package_fixed_version_id'><%= WorkPackage.human_attribute_name(:fixed_version) %></label>
<label class="form--label" for='work_package_version_id'><%= WorkPackage.human_attribute_name(:version) %></label>
<div class="form--field-container">
<%= styled_select_tag('work_package[fixed_version_id]', content_tag('option', l(:label_no_change_option), value: '') +
<%= styled_select_tag('work_package[version_id]', content_tag('option', l(:label_no_change_option), value: '') +
content_tag('option', l(:label_none), value: 'none') +
version_options_for_select(@project.shared_versions.with_status_open.order_by_semver_name)) %>
</div>

@ -80,9 +80,9 @@ See docs/COPYRIGHT.rdoc for more details.
</div>
</div>
<div class="form--field">
<label class="form--label" for='fixed_version_id'><%= WorkPackage.human_attribute_name(:version) %></label>
<label class="form--label" for='version_id'><%= WorkPackage.human_attribute_name(:version) %></label>
<div class="form--field-container">
<%= styled_select_tag('fixed_version_id',
<%= styled_select_tag('version_id',
content_tag('option', l(:label_no_change_option), value: '') +
version_options_for_select(@available_versions)) %>
</div>

@ -30,7 +30,7 @@ module Constants
class ARToAPIConversions
WELL_KNOWN_CONVERSIONS = {
assigned_to: 'assignee',
fixed_version: 'version',
version: 'version',
done_ratio: 'percentageDone',
estimated_hours: 'estimatedTime',
created_on: 'createdAt',

@ -468,7 +468,7 @@ ar:
done_ratio: "التقدم (%)"
end_insertion: "نهاية الإدراج"
end_deletion: "نهاية الحذف"
fixed_version: "الإصدار"
version: "الإصدار"
parent: "الجذر"
parent_issue: "الجذر"
parent_work_package: "الجذر"

@ -464,7 +464,7 @@ bg:
done_ratio: "Прогрес (%)"
end_insertion: "Край на вмъкване"
end_deletion: "Края на изтриване"
fixed_version: "Версия"
version: "Версия"
parent: "Горна категория"
parent_issue: "Горна категория"
parent_work_package: "Горна категория"

@ -464,7 +464,7 @@ ca:
done_ratio: "Progrés (%)"
end_insertion: "Final de la inserció"
end_deletion: "Final de la supressió"
fixed_version: "Versió"
version: "Versió"
parent: "Pare"
parent_issue: "Pare"
parent_work_package: "Pare"

@ -466,7 +466,7 @@ cs:
done_ratio: "Průběh (%)"
end_insertion: "Konec vložení"
end_deletion: "Konec odstranění"
fixed_version: "Verze"
version: "Verze"
parent: "Rodič"
parent_issue: "Rodič"
parent_work_package: "Rodič"

@ -464,7 +464,7 @@ da:
done_ratio: "Fremskridt (%)"
end_insertion: "End of the insertion"
end_deletion: "End of the deletion"
fixed_version: "Version"
version: "Version"
parent: "Overordnet"
parent_issue: "Overordnet"
parent_work_package: "Overordnet"

@ -460,7 +460,7 @@ de:
done_ratio: "Fortschritt (%)"
end_insertion: "Ende der Einfügung"
end_deletion: "Ende des Löschvorgangs"
fixed_version: "Version"
version: "Version"
parent: "Übergeordnetes Arbeitspaket"
parent_issue: "Übergeordnetes Arbeitspaket"
parent_work_package: "Übergeordnetes Arbeitspaket"

@ -461,7 +461,7 @@ el:
done_ratio: "Πρόοδος (%)"
end_insertion: "Λήξη της εισαγωγής"
end_deletion: "Λήξη της διαγραφής"
fixed_version: "Έκδοση"
version: "Έκδοση"
parent: "Γονέας"
parent_issue: "Γονέας"
parent_work_package: "Γονέας"

@ -461,7 +461,7 @@ es:
done_ratio: "Progreso (%)"
end_insertion: "Final de la inserción"
end_deletion: "Final de la eliminación"
fixed_version: "Versión"
version: "Versión"
parent: "Padre"
parent_issue: "Padre"
parent_work_package: "Padre"

@ -464,7 +464,7 @@ fi:
done_ratio: "Edistyminen (%)"
end_insertion: "Lisäyksen loppu"
end_deletion: "Poistokohdan loppu"
fixed_version: "Versio"
version: "Versio"
parent: "Ylätaso"
parent_issue: "Ylätaso"
parent_work_package: "Ylätaso"

@ -464,7 +464,7 @@ fil:
done_ratio: "Isinasagawa (%)"
end_insertion: "Katapusan na"
end_deletion: "Katapusan ng pagbubura"
fixed_version: "Bersyon"
version: "Bersyon"
parent: "Magulang"
parent_issue: "Magulang"
parent_work_package: "Magulang"

@ -463,7 +463,7 @@ fr:
done_ratio: "Progrès (%)"
end_insertion: "Fin de l’insertion"
end_deletion: "Fin de la suppression"
fixed_version: "Version"
version: "Version"
parent: "Parent"
parent_issue: "Parent"
parent_work_package: "Parent"

@ -465,7 +465,7 @@ hr:
done_ratio: "Napredak (%)"
end_insertion: "Kraj umetanja"
end_deletion: "Kraj brisanja"
fixed_version: "Verzija"
version: "Verzija"
parent: "Matični"
parent_issue: "Matični"
parent_work_package: "Matični"

@ -461,7 +461,7 @@ hu:
done_ratio: "Folyamat állapot (%)"
end_insertion: "Beillesztés vége"
end_deletion: "Törlés vége"
fixed_version: "Verzió"
version: "Verzió"
parent: "Szülő"
parent_issue: "Szülő"
parent_work_package: "Szülő"

@ -462,7 +462,7 @@ id:
done_ratio: "Progress (%)"
end_insertion: "End of the insertion"
end_deletion: "End of the deletion"
fixed_version: "Versi"
version: "Versi"
parent: "Induk"
parent_issue: "Induk"
parent_work_package: "Induk"

@ -460,7 +460,7 @@ it:
done_ratio: "Avanzamento (%)"
end_insertion: "Fine inserimento"
end_deletion: "Fine cancellazione"
fixed_version: "Versione"
version: "Versione"
parent: "Superiore"
parent_issue: "Superiore"
parent_work_package: "Superiore"

@ -461,7 +461,7 @@ ja:
done_ratio: "進行状況 (%)"
end_insertion: "挿入の終わり"
end_deletion: "削除の終わり"
fixed_version: "バージョン"
version: "バージョン"
parent: "親項目"
parent_issue: "親項目"
parent_work_package: "親項目"

@ -462,7 +462,7 @@ ko:
done_ratio: "진행률 (%)"
end_insertion: "삽입 끝"
end_deletion: "삭제 끝"
fixed_version: "버전"
version: "버전"
parent: "부모"
parent_issue: "부모"
parent_work_package: "부모"

@ -463,7 +463,7 @@ lt:
done_ratio: "Progresas (%)"
end_insertion: "Įterpimo pabaigoje"
end_deletion: "Ištrynimo pabaigoje"
fixed_version: "Versija"
version: "Versija"
parent: "Tėvas"
parent_issue: "Tėvas"
parent_work_package: "Tėvas"

@ -464,7 +464,7 @@ nl:
done_ratio: "Voortgang (%)"
end_insertion: "Einde van het invoegen"
end_deletion: "Einde van de verwijdering"
fixed_version: "Versie"
version: "Versie"
parent: "Bovenliggend werkpakket"
parent_issue: "Bovenliggend werkpakket"
parent_work_package: "Bovenliggend werkpakket"

@ -464,7 +464,7 @@
done_ratio: "Progress (%)"
end_insertion: "End of the insertion"
end_deletion: "End of the deletion"
fixed_version: "Versjon"
version: "Versjon"
parent: "Overordnet"
parent_issue: "Overordnet"
parent_work_package: "Overordnet"

@ -464,7 +464,7 @@ pl:
done_ratio: "Postęp (%)"
end_insertion: "Koniec wstawiania"
end_deletion: "Koniec usuwania"
fixed_version: "Wersja"
version: "Wersja"
parent: "Rodzic"
parent_issue: "Rodzic"
parent_work_package: "Rodzic"

@ -463,7 +463,7 @@ pt-BR:
done_ratio: "Progresso (%)"
end_insertion: "Final da inserção"
end_deletion: "Final da exclusão"
fixed_version: "Versão"
version: "Versão"
parent: "Pai"
parent_issue: "Pai"
parent_work_package: "Pai"

@ -462,7 +462,7 @@ pt:
done_ratio: "Progresso (%)"
end_insertion: "Final da inserção"
end_deletion: "Final da exclusão"
fixed_version: "Versão"
version: "Versão"
parent: "Mãe"
parent_issue: "Mãe"
parent_work_package: "Mãe"

@ -465,7 +465,7 @@ ro:
done_ratio: "Progres (%)"
end_insertion: "Sfârșit de inserare"
end_deletion: "Sfârșit de ștergere"
fixed_version: "Versiune"
version: "Versiune"
parent: "Părinte"
parent_issue: "Părinte"
parent_work_package: "Părinte"

@ -465,7 +465,7 @@ ru:
done_ratio: "Прогресс (%)"
end_insertion: "Завершение вставки"
end_deletion: "Завершение удаления"
fixed_version: "Стадия"
version: "Стадия"
parent: "Родитель"
parent_issue: "Родитель"
parent_work_package: "Родитель"

@ -466,7 +466,7 @@ sk:
done_ratio: "Stav spracovania (%)"
end_insertion: "Koniec vkladania"
end_deletion: "Koniec odstraňovania"
fixed_version: "Verzia"
version: "Verzia"
parent: "Nadradený balíček"
parent_issue: "Nadradený balíček"
parent_work_package: "Nadradený balíček"

@ -463,7 +463,7 @@ sv:
done_ratio: "Progress (%)"
end_insertion: "Slutet av införandet"
end_deletion: "Slutet av raderingen"
fixed_version: "Version"
version: "Version"
parent: "Överordnad"
parent_issue: "Överordnad"
parent_work_package: "Överordnad"

@ -464,7 +464,7 @@ tr:
done_ratio: "İlerleme (%)"
end_insertion: "Ekleme işlemi bitti"
end_deletion: "Silme işlemi bitti"
fixed_version: "Sürüm"
version: "Sürüm"
parent: "Üst"
parent_issue: "Üst"
parent_work_package: "Üst"

@ -466,7 +466,7 @@ uk:
done_ratio: "Прогрес (%)"
end_insertion: "Кінець вставки"
end_deletion: "Кінець видалення"
fixed_version: "Версія"
version: "Версія"
parent: "Джерело"
parent_issue: "Джерело"
parent_work_package: "Джерело"

@ -465,7 +465,7 @@ vi:
done_ratio: "Progress (%)"
end_insertion: "End of the insertion"
end_deletion: "End of the deletion"
fixed_version: "Phiên bản"
version: "Phiên bản"
parent: "Cha"
parent_issue: "Cha"
parent_work_package: "Cha"

@ -460,7 +460,7 @@ zh-CN:
done_ratio: "进度 (%)"
end_insertion: "结束插入"
end_deletion: "结束删除"
fixed_version: "版本"
version: "版本"
parent: "父"
parent_issue: "父"
parent_work_package: "父"

@ -463,7 +463,7 @@ zh-TW:
done_ratio: "進度 (%)"
end_insertion: "結束插入"
end_deletion: "結束刪除"
fixed_version: "版本"
version: "版本"
parent: "上層目錄:"
parent_issue: "上層目錄:"
parent_work_package: "上層目錄:"

@ -514,7 +514,7 @@ en:
done_ratio: "Progress (%)"
end_insertion: "End of the insertion"
end_deletion: "End of the deletion"
fixed_version: "Version"
version: "Version"
parent: "Parent"
parent_issue: "Parent"
parent_work_package: "Parent"

@ -0,0 +1,37 @@
class RenameFixedVersion < ActiveRecord::Migration[6.0]
def up
rename_column :work_packages, :fixed_version_id, :version_id
rename_column :work_package_journals, :fixed_version_id, :version_id
rename_query_attributes('fixed_version', 'version')
end
def down
rename_column :work_packages, :version_id, :fixed_version_id
rename_column :work_package_journals, :version_id, :fixed_version_id
rename_query_attributes('version', 'fixed_version')
end
def rename_query_attributes(from, to)
ActiveRecord::Base.connection.exec_query(
<<-SQL
UPDATE
queries q_sink
SET
filters = regexp_replace(q_source.filters, '(\n)#{from}_id:(\n)', '\1#{to}_id:\2'),
column_names = regexp_replace(q_source.column_names, ':#{from}', ':#{to}'),
sort_criteria = regexp_replace(q_source.sort_criteria, '#{from}', '#{to}'),
group_by = regexp_replace(q_source.group_by, '#{from}', '#{to}')
FROM
queries q_source
WHERE
(q_source.filters LIKE '%#{from}_id:%'
OR q_source.column_names LIKE '%#{from}%'
OR q_source.sort_criteria LIKE '%#{from}%'
OR q_source.group_by = '#{from}')
AND q_sink.id = q_source.id
SQL
)
end
end

@ -55,7 +55,7 @@ Available arguments that change how the work packages are handled:
| `category` | name of the target category |
| `priority` | name of the target priority |
| `status` | name of the target status |
| `fixed_version` | name of the target version |
| `version` | name of the target version |
| `type` | name of the target type |
| `priority` | name of the target priority |
| `unknown_user`| ignore: email is ignored (default), accept: accept as anonymous user, create: create a user account |

@ -116,7 +116,7 @@ Given (/^there are the following issues with attributes:$/) do |table|
attributes.merge! type_id: type.id if type
version = Version.find_by(name: attributes.delete('version'))
attributes.merge! fixed_version_id: version.id if version
attributes.merge! version_id: version.id if version
category = Category.find_by(name: attributes.delete('category'))
attributes.merge! category_id: category.id if category

@ -37,7 +37,7 @@ module API
# - APIv3 defines some properties as a different type, which requires a name change
# e.g. estimatedTime vs estimated_hours (AR: hours; API: generic duration)
# - some names used in AR are even there kind of deprecated
# e.g. fixed_version, which everyone refers to as version
# e.g. version, which everyone refers to as version
# - some names in AR are plainly inconsistent, whereas the API tries to be as consistent as
# possible, e.g. updated_at vs updated_on
#

@ -49,7 +49,7 @@ module API
def fetch_checksums_for(work_packages)
WorkPackage
.where(id: work_packages.map(&:id).uniq)
.left_joins(:status, :author, :responsible, :assigned_to, :fixed_version, :priority, :category, :type)
.left_joins(:status, :author, :responsible, :assigned_to, :version, :priority, :category, :type)
.pluck('work_packages.id', Arel.sql(md5_concat.squish))
.to_h
end

@ -435,8 +435,7 @@ module API
setter: PrincipalSetter.lambda(:assigned_to, :assignee),
link: ::API::V3::Principals::AssociatedSubclassLambda.link(:assigned_to)
associated_resource :fixed_version,
as: :version,
associated_resource :version,
v3_path: :version,
representer: ::API::V3::Versions::VersionRepresenter

@ -80,7 +80,6 @@ module Redmine
include Users
include Reversion
include Reset
include Reload
include Permissions
include SaveHooks
include FormatHooks

@ -1,88 +0,0 @@
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# 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-2017 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 docs/COPYRIGHT.rdoc for more details.
#++
#-- encoding: UTF-8
# This file included as part of the acts_as_journalized plugin for
# the redMine project management 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.
#
# The original copyright and license conditions are:
# Copyright (c) 2009 Steve Richert
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
module Redmine::Acts::Journalized
# Ties into the existing ActiveRecord::Base#reload method to ensure that journal information
# is properly reset.
module Reload
def self.included(base) # :nodoc:
base.class_eval do
prepend InstanceMethods
end
end
# Adds instance methods into ActiveRecord::Base to tap into the +reload+ method.
module InstanceMethods
# Overrides ActiveRecord::Base#reload, resetting the instance-variable-cached journal number
# before performing the original +reload+ method.
def reload(*args)
reset_journal
super
end
end
end
end

@ -27,6 +27,7 @@
#++
#-- encoding: UTF-8
# This file included as part of the acts_as_journalized plugin for
# the redMine project management software; You can redistribute it
# and/or modify it under the terms of the GNU General Public License
@ -75,11 +76,6 @@ module Redmine::Acts::Journalized
# Provides the base instance methods required to revert a journaled instance.
module InstanceMethods
# Returns the current version number for the versioned object.
def version
@version ||= last_version
end
def last_journal
journals.last
end
@ -114,16 +110,12 @@ module Redmine::Acts::Journalized
changes_between(journal, to_number).each do |attribute, change|
write_attribute(attribute, change.last)
end
reset_journal(to_number)
end
# Behaves similarly to the +revert_to+ method except that it automatically saves the record
# after the rejournal. The return value is the success of the save.
def revert_to!(value)
revert_to(value)
reset_journal if saved = save
saved
end
# Returns a boolean specifying whether the object has been reverted to a previous journal or
@ -140,13 +132,6 @@ module Redmine::Acts::Journalized
def last_version
@last_version ||= journals.maximum(:version) || 0
end
# Clears the cached version number instance variables so that they can be recalculated.
# Useful after a new version is created.
def reset_journal(version = nil)
@last_version = nil if version.nil?
@version = version
end
end
end
end

@ -205,7 +205,7 @@ END_DESC
def options_from_env
{ issue: {} }.tap do |options|
default_fields = (ENV['default_fields'] || '').split
default_fields |= %w[project status type category priority assigned_to fixed_version]
default_fields |= %w[project status type category priority assigned_to version]
default_fields.each do |field| options[:issue][field.to_sym] = ENV[field] if ENV[field] end
options[:allow_override] = ENV['allow_override'] if ENV['allow_override']

@ -57,7 +57,7 @@ RB.Impediment = (function ($) {
data = j.find('.editor').serialize() +
"&is_impediment=true" +
"&fixed_version_id=" + RB.constants.sprint_id +
"&version_id=" + RB.constants.sprint_id +
"&status_id=" + statusID +
"&prev=" + (prev.length === 1 ? prev.data('this').getID() : '') +
(this.isNew() ? "" : "&id=" + j.children('.id').text());

@ -101,7 +101,7 @@ RB.Story = (function ($) {
data = "prev=" +
(prev.length === 1 ? prev.data('this').getID() : '') +
"&fixed_version_id=" + sprintId;
"&version_id=" + sprintId;
if (this.$.find('.editor').length > 0) {
data += "&" + this.$.find('.editor').serialize();

@ -260,7 +260,7 @@
min-height: 14px
height: 2rem
text-align: center
.type_id .v, .id .v, .status_id .v, .fixed_version_id, .higher_item_id
.type_id .v, .id .v, .status_id .v, .version_id, .higher_item_id
display: none
.rb_dialog

@ -64,7 +64,7 @@ class RbImpedimentsController < RbApplicationController
params.delete(:project_id)
hash = params
.permit(:fixed_version_id, :status_id, :id, :sprint_id,
.permit(:version_id, :status_id, :id, :sprint_id,
:assigned_to_id, :remaining_hours, :subject, :blocks_ids)
.to_h
.symbolize_keys

@ -33,11 +33,11 @@ class RbQueriesController < RbApplicationController
filters = []
if @sprint_id
filters.push(filter_object('status_id', '*'))
filters.push(filter_object('fixed_version_id', '=', [@sprint_id]))
filters.push(filter_object('version_id', '=', [@sprint_id]))
# Note: We need a filter for backlogs_work_package_type but currently it's not possible for plugins to introduce new filter types
else
filters.push(filter_object('status_id', 'o'))
filters.push(filter_object('fixed_version_id', '!*', [@sprint_id]))
filters.push(filter_object('version_id', '!*', [@sprint_id]))
# Same as above
end

@ -32,7 +32,7 @@ class RbStoriesController < RbApplicationController
# This is a constant here because we will recruit it elsewhere to whitelist
# attributes. This is necessary for now as we still directly use `attributes=`
# in non-controller code.
PERMITTED_PARAMS = [:id, :status_id, :fixed_version_id,
PERMITTED_PARAMS = [:id, :status_id, :version_id,
:story_points, :type_id, :subject, :author_id,
:sprint_id]

@ -58,8 +58,8 @@ class Impediment < Task
if blocks_ids.size == 0
errors.add :blocks_ids, :must_block_at_least_one_work_package
else
other_version_ids = WorkPackage.where(id: blocks_ids).pluck(:fixed_version_id).uniq
errors.add :blocks_ids, :can_only_contain_work_packages_of_current_sprint if other_version_ids.size != 1 || other_version_ids[0] != fixed_version_id
other_version_ids = WorkPackage.where(id: blocks_ids).pluck(:version_id).uniq
errors.add :blocks_ids, :can_only_contain_work_packages_of_current_sprint if other_version_ids.size != 1 || other_version_ids[0] != version_id
end
end
end

@ -141,7 +141,7 @@ class Sprint < Version
# Assume a sprint is active if it's only 2 days old
return true if bd.remaining_hours.size <= 2
WorkPackage.exists?(['fixed_version_id = ? and ((updated_on between ? and ?) or (created_on between ? and ?))',
WorkPackage.exists?(['version_id = ? and ((updated_on between ? and ?) or (created_on between ? and ?))',
id, -2.days.from_now, Time.now, -2.days.from_now, Time.now])
end
@ -164,6 +164,6 @@ class Sprint < Version
def impediments(project)
# for reasons beyond me,
# the default_scope needs to be explicitly applied.
Impediment.default_scope.where(fixed_version_id: self, project_id: project)
Impediment.default_scope.where(version_id: self, project_id: project)
end
end

@ -40,12 +40,12 @@ class Story < WorkPackage
end
candidates.each do |story|
last_rank = stories_by_version[story.fixed_version_id].size > 0 ?
stories_by_version[story.fixed_version_id].last.rank :
last_rank = stories_by_version[story.version_id].size > 0 ?
stories_by_version[story.version_id].last.rank :
0
story.rank = last_rank + 1
stories_by_version[story.fixed_version_id] << story
stories_by_version[story.version_id] << story
end
stories_by_version
@ -135,7 +135,7 @@ class Story < WorkPackage
extras = ["and not #{WorkPackage.table_name}.position is NULL and #{WorkPackage.table_name}.position <= ?", position]
end
@rank ||= WorkPackage.where(Story.condition(project.id, fixed_version_id, extras))
@rank ||= WorkPackage.where(Story.condition(project.id, version_id, extras))
.joins(:status)
.count
@rank
@ -144,7 +144,7 @@ class Story < WorkPackage
private
def self.condition(project_id, sprint_ids, extras = [])
c = ['project_id = ? AND type_id in (?) AND fixed_version_id in (?)',
c = ['project_id = ? AND type_id in (?) AND version_id in (?)',
project_id, Story.types, sprint_ids]
if extras.size > 0

@ -42,7 +42,7 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="v"><%= type_id_or_empty(story) %></div>
</div>
<div class="subject editable ellipsis" fieldname="subject" fieldorder="2" title="<%= h story.subject %>" field_id=<%= story.id %>><%=h story.subject %></div>
<div class="fixed_version_id"><%= story.fixed_version_id %></div>
<div class="version_id"><%= story.version_id %></div>
<div class="higher_item_id"><%= !defined?(higher_item) || higher_item.nil? ? '' : higher_item.id %></div>
<div class="meta">
<%= render(:partial => "shared/model_errors", :object => story.errors) if story.errors.size > 0 %>

@ -45,7 +45,7 @@ ar:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "هو غير صالح لأن مجموعة العمل '%{work_package_name}' هي مهمة عمل متراكم غير منجز ولذلك لا يمكن أن يكون أحد الأصول خارج المشروع الحالي."

@ -45,7 +45,7 @@ bg:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "is invalid because the work package '%{work_package_name}' is a backlog task and therefore cannot have a parent outside of the current project."

@ -45,7 +45,7 @@ ca:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "no és vàlid perquè el paquet de treball '%{work_package_name}' és una tasca de la llista de pendents i per tant no pot tenir un pare fora el projecte actual."

@ -45,7 +45,7 @@ cs:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "musí být stejná jako verze nadřazeného příběhu."
parent_id:
parent_child_relationship_across_projects: "je neplatný, protože pracovní balíček '%{work_package_name}' je nevyřízený úkol, a proto nemůže mít nadřazený mimo aktuální projekt."

@ -45,7 +45,7 @@ da:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "er ugyldig, da arbejdspakken '%{work_package_name}' er en backlog-opgave og derfor ikke kan have en forælder uden for det aktuelle projekt."

@ -45,7 +45,7 @@ de:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "muss der Version der übergeordneten Story entsprechen."
parent_id:
parent_child_relationship_across_projects: "ist ungültig da '%{work_package_name}' ein backlog Task ist und daher kein Eltern-Arbeitspaket außerhalb des jetzigen Projekts haben kann."

@ -45,7 +45,7 @@ el:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "πρέπει να είναι το ίδιο με την έκδοση ιστορίας του γονέα."
parent_id:
parent_child_relationship_across_projects: "δεν είναι έγκυρο επειδή το πακέτο εργασίας '%{work_package_name}' είναι μια εργασία backlog επομένως δεν μπορεί να έχει γονέα εκτός του τρέχοντος έργου."

@ -45,7 +45,7 @@ es:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "debe coincidir con la versión de la historia principal."
parent_id:
parent_child_relationship_across_projects: "no es valido porque el paquete de trabjo '%{work_package_name}' es una tarea de backlog y por lo tanto no puede tener un padre fuera del proyecto actual."

@ -45,7 +45,7 @@ fi:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "ei kelpaa, koska työpaketti \"%{work_package_name}\" on työjonossa ja siksi sillä ei voi olla edeltäjää nykyisen projektin ulkopuolella."

@ -45,7 +45,7 @@ fil:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "is invalid because the work package '%{work_package_name}' is a backlog task and therefore cannot have a parent outside of the current project."

@ -45,7 +45,7 @@ fr:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "doit être identique à la version de l'histoire parente."
parent_id:
parent_child_relationship_across_projects: "n'est pas valide parce que le lot de travaux «%{work_package_name}» est une tâche de backlog et par conséquent ne peut avoir un parent en dehors du projet actuel."

@ -45,7 +45,7 @@ hr:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "je neispravan zato što radni paket %{work_package_name} je backlog zadatak i kao takav ne može imati nadređenog izvan trenutnog projekta."

@ -45,7 +45,7 @@ hu:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "érvénytelen, mert a munka csomag \"%{work_package_name}\" egy backlog feladat, ezért nem lehet a szülő nem az aktuális projektben."

@ -45,7 +45,7 @@ id:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "harus sama seperti versi kisah orang tua."
parent_id:
parent_child_relationship_across_projects: "tidak valid karena paket kerja '%{work_package_name}' adalah tugas backlog dan oleh karena itu tidak dapat memiliki orang tua di luar proyek saat ini."

@ -45,7 +45,7 @@ it:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "deve essere uguale alla versione della storia del genitore."
parent_id:
parent_child_relationship_across_projects: "non è valido perché il pacchetto di lavoro '%{work_package_name}' è un task di backlog e pertanto non può avere una dipendenza esterna al progetto corrente."

@ -45,7 +45,7 @@ ja:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "親ストーリーのバージョンと同じでなければなりません。"
parent_id:
parent_child_relationship_across_projects: "は無効です。作業項目'%{work_package_name}'はバックログタスクで、現在のプロジェクト外の親を持つことはできません。"

@ -45,7 +45,7 @@ ko:
models:
work_package:
attributes:
fixed_version_id:
version_id:
task_version_must_be_the_same_as_story_version: "은(는) 부모 스토리의 버전과 동일해야 합니다."
parent_id:
parent_child_relationship_across_projects: "은(는) 유효하지 않습니다. 작업 패키지 '%{work_package_name}'이(가) 백로그 작업이기 때문입니다. 따라서 현재 프로젝트 외부에 부모가 있을 수 없습니다."

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

Loading…
Cancel
Save