Let plugins add fields to the Create issues from estimate page

View hook view_qbo_estimate_issues_form draws plugins' fields in the shared Issue fields box; values
posted as issue_plugin_fields[name] override the plugin defaults and reach qbo_billing_build_issue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
Claude committed 2026-10-31 10:25:03 -04:00
1 parent b84f39afce
commit abeb0fe0f5
4 files changed
+21 -4

No files matched your search

@@ -136,12 +136,15 @@
</tbody>
</table>
<%# Custom fields for the chosen trackers, entered once and applied to every issue that uses them %>
<% if @field_set&.any? %>
<%# Fields entered once and applied to every issue: plugins' own (e.g. redmine_qbo_vehicles' vehicle, posted as
issue_plugin_fields[...]) and the custom fields for the chosen trackers %>
<% plugin_fields = call_hook(:view_qbo_estimate_issues_form, { estimate: @estimate, defaults: @defaults, project: @target_project }) %>
<% if @field_set&.any? || plugin_fields.present? %>
<fieldset class="box tabular estimate-issue-fields" id="estimate-issue-fields">
<legend><%= l(:label_estimate_issue_fields) %></legend>
<p class="estimate-issue-fields-info"><em class="info"><%= l(:text_estimate_issue_fields_info) %></em></p>
<% @field_set.fields.each do |field| %>
<%= plugin_fields %>
<% Array(@field_set&.fields).each do |field| %>
<p class="estimate-issue-field"
data-tracker-ids="<%= field.tracker_ids.join(',') %>"
data-required-tracker-ids="<%= field.required_tracker_ids.join(',') %>">