Dynamically load updateIssueFrom javascript path

This commit is contained in:
2026-01-26 10:08:53 -05:00
parent c1af031d22
commit 479be461a6

View File

@@ -12,6 +12,8 @@ module Hooks
class IssuesFormHookListener < Redmine::Hook::ViewListener
include IssuesHelper
# Edit Issue Form
# Here we build the required form components before passing them to a partial view formatting.
def view_issues_form_details_bottom(context={})
@@ -31,7 +33,7 @@ module Hooks
selected_vehicle = issue.vehicles_id ? issue.vehicles_id : nil
# Gernerate edit.js link
js_link = issue.new_record? ? "updateIssueFrom('/projects/rmt/issues/new.js', this)" : "updateIssueFrom('/issues/#{issue.id}/edit.js', this)"
js_link = "updateIssueFrom('#{escape_javascript update_issue_form_path(issue.project, issue)}', this)"
# Load customer information
customer = Customer.find_by_id(selected_customer) if selected_customer