Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix overriding the parent element with a text value, removing the input

Oliver Güntherf80378817aed
diff --git a/modules/budgets/app/controllers/budgets_controller.rb b/modules/budgets/app/controllers/budgets_controller.rb
index ab7a8c735fc..037e1f404f0 100644
--- a/modules/budgets/app/controllers/budgets_controller.rb
+++ b/modules/budgets/app/controllers/budgets_controller.rb
@@ -239,7 +239,7 @@ class BudgetsController < ApplicationController
}
if current_user.allowed_to?(permission, project)
- response["#{element_id}_costs"] = number_to_currency(costs)
+ response["#{element_id}_costs_text"] = number_to_currency(costs)
response["#{element_id}_cost_value"] = unitless_currency_number(costs)
end
diff --git a/modules/budgets/app/views/budgets/items/_labor_budget_item.html.erb b/modules/budgets/app/views/budgets/items/_labor_budget_item.html.erb
index 68df94b24e2..589db1987f1 100644
--- a/modules/budgets/app/views/budgets/items/_labor_budget_item.html.erb
+++ b/modules/budgets/app/views/budgets/items/_labor_budget_item.html.erb
@@ -96,7 +96,9 @@ See docs/COPYRIGHT.rdoc for more details.
<a id="<%= "#{id_prefix}_costs" %>" class="costs--edit-planned-costs-btn icon-context icon-edit" title="<%= t(:help_click_to_edit) %>">
<% if labor_budget_item.costs_visible_by?(User.current) %>
<%= cost_form.hidden_field :cost_value, index: id_or_index, value: unitless_currency_number(cost_value) %>
- <%= number_to_currency(cost_value) %>
+ <span id="<%= "#{id_prefix}_costs_text" %>">
+ <%= number_to_currency(cost_value) %>
+ </span>
<% end %>
</a>
</cost-unit-subform>
diff --git a/modules/budgets/app/views/budgets/items/_material_budget_item.html.erb b/modules/budgets/app/views/budgets/items/_material_budget_item.html.erb
index 5c583c0dc66..1fcb53409a3 100644
--- a/modules/budgets/app/views/budgets/items/_material_budget_item.html.erb
+++ b/modules/budgets/app/views/budgets/items/_material_budget_item.html.erb
@@ -98,7 +98,9 @@ See docs/COPYRIGHT.rdoc for more details.
obj-name="<%= "#{name_prefix}[amount]" %>"
data-placeholder="<%= t(:label_example_placeholder, decimal: unitless_currency_number(1000.50)) %>" %>
<a id="<%= id_prefix %>_costs" class="costs--edit-planned-costs-btn icon-context icon-edit" role="button" title="<%= t(:help_click_to_edit) %>">
- <%= number_to_currency(cost_value) %>
+ <span id="<%= "#{id_prefix}_costs_text" %>">
+ <%= number_to_currency(cost_value) %>
+ </span>
</a>
</cost-unit-subform>
</td>
diff --git a/modules/costs/app/views/costlog/edit.html.erb b/modules/costs/app/views/costlog/edit.html.erb
index 494fcfe4f3d..e6ea6b58c29 100644
--- a/modules/costs/app/views/costlog/edit.html.erb
+++ b/modules/costs/app/views/costlog/edit.html.erb
@@ -126,7 +126,9 @@ See docs/COPYRIGHT.rdoc for more details.
id="cost_entry_costs"
class="costs--edit-planned-costs-btn icon-context icon-edit"
title="<%= t(:help_click_to_edit) %>">
- <%= number_to_currency(@cost_entry.real_costs) %>
+ <span id="cost_entry_costs_text">
+ <%= number_to_currency(@cost_entry.real_costs) %>
+ </span>
</a>
</span>
<% else %>