Fixed pdf hooks

This commit is contained in:
2026-01-26 23:22:23 -05:00
parent b603cb634a
commit 241dd594d0

View File

@@ -59,8 +59,12 @@ module Patches
#left << [l(:field_fixed_version), issue.fixed_version] unless issue.disabled_core_fields.include?('fixed_version_id') #left << [l(:field_fixed_version), issue.fixed_version] unless issue.disabled_core_fields.include?('fixed_version_id')
logger.debug "Calling :pdf_left hook" logger.debug "Calling :pdf_left hook"
context = Redmine::Hook.call_hook :pdf_left, { array: left, issue: issue } left_hook_output = Redmine::Hook.call_hook :pdf_left, { issue: issue }
left << context.first unless context.nil? unless left_hook_output.nil?
left_hook_output.each do |l|
left.concat l unless l.nil?
end
end
right = [] right = []
right << [l(:field_start_date), format_date(issue.start_date)] unless issue.disabled_core_fields.include?('start_date') right << [l(:field_start_date), format_date(issue.start_date)] unless issue.disabled_core_fields.include?('start_date')
@@ -70,8 +74,12 @@ module Patches
right << [l(:label_spent_time), l_hours(issue.total_spent_hours)] if User.current.allowed_to?(:view_time_entries, issue.project) right << [l(:label_spent_time), l_hours(issue.total_spent_hours)] if User.current.allowed_to?(:view_time_entries, issue.project)
logger.debug "Calling :pdf_right hook" logger.debug "Calling :pdf_right hook"
context = Redmine::Hook.call_hook :pdf_right, { array: right, issue: issue } right_hook_output = Redmine::Hook.call_hook :pdf_right, { issue: issue }
right << context.first unless context.nil? unless right_hook_output.nil?
right_hook_output.each do |r|
right.concat r unless r.nil?
end
end
rows = left.size > right.size ? left.size : right.size rows = left.size > right.size ? left.size : right.size
while left.size < rows while left.size < rows