|
|
|
@ -140,8 +140,7 @@ module Submissions
|
|
|
|
AccountConfig::WITH_TIMESTAMP_SECONDS_KEY,
|
|
|
|
AccountConfig::WITH_TIMESTAMP_SECONDS_KEY,
|
|
|
|
AccountConfig::ROTATE_INCREMENTAL_PDF_KEY,
|
|
|
|
AccountConfig::ROTATE_INCREMENTAL_PDF_KEY,
|
|
|
|
AccountConfig::WITH_SUBMITTER_TIMEZONE_KEY,
|
|
|
|
AccountConfig::WITH_SUBMITTER_TIMEZONE_KEY,
|
|
|
|
AccountConfig::WITH_SIGNATURE_ID_REASON_KEY,
|
|
|
|
AccountConfig::WITH_SIGNATURE_ID_REASON_KEY])
|
|
|
|
AccountConfig::WITH_SIGNATURE_ID_COMPLETED_AT_KEY])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with_signature_id = configs.find { |c| c.key == AccountConfig::WITH_SIGNATURE_ID }&.value == true
|
|
|
|
with_signature_id = configs.find { |c| c.key == AccountConfig::WITH_SIGNATURE_ID }&.value == true
|
|
|
|
is_flatten = configs.find { |c| c.key == AccountConfig::FLATTEN_RESULT_PDF_KEY }&.value != false
|
|
|
|
is_flatten = configs.find { |c| c.key == AccountConfig::FLATTEN_RESULT_PDF_KEY }&.value != false
|
|
|
|
@ -151,8 +150,6 @@ module Submissions
|
|
|
|
with_file_links = configs.find { |c| c.key == AccountConfig::WITH_FILE_LINKS_KEY }&.value == true
|
|
|
|
with_file_links = configs.find { |c| c.key == AccountConfig::WITH_FILE_LINKS_KEY }&.value == true
|
|
|
|
with_signature_id_reason =
|
|
|
|
with_signature_id_reason =
|
|
|
|
configs.find { |c| c.key == AccountConfig::WITH_SIGNATURE_ID_REASON_KEY }&.value != false
|
|
|
|
configs.find { |c| c.key == AccountConfig::WITH_SIGNATURE_ID_REASON_KEY }&.value != false
|
|
|
|
with_signature_id_completed_at =
|
|
|
|
|
|
|
|
configs.find { |c| c.key == AccountConfig::WITH_SIGNATURE_ID_COMPLETED_AT_KEY }&.value == true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
file_links_expire_at = Accounts.link_expires_at(submitter.account) if with_file_links
|
|
|
|
file_links_expire_at = Accounts.link_expires_at(submitter.account) if with_file_links
|
|
|
|
|
|
|
|
|
|
|
|
@ -204,14 +201,12 @@ module Submissions
|
|
|
|
with_file_links:,
|
|
|
|
with_file_links:,
|
|
|
|
with_timestamp_seconds:,
|
|
|
|
with_timestamp_seconds:,
|
|
|
|
with_signature_id_reason:,
|
|
|
|
with_signature_id_reason:,
|
|
|
|
with_signature_id_completed_at:,
|
|
|
|
|
|
|
|
file_links_expire_at:)
|
|
|
|
file_links_expire_at:)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def fill_submitter_fields(submitter, account, pdfs_index, with_signature_id:, is_flatten:, with_headings: nil,
|
|
|
|
def fill_submitter_fields(submitter, account, pdfs_index, with_signature_id:, is_flatten:, with_headings: nil,
|
|
|
|
with_submitter_timezone: false, with_signature_id_reason: true,
|
|
|
|
with_submitter_timezone: false, with_signature_id_reason: true,
|
|
|
|
with_timestamp_seconds: false, with_signature_id_completed_at: false,
|
|
|
|
with_timestamp_seconds: false, with_file_links: nil,
|
|
|
|
with_file_links: nil,
|
|
|
|
|
|
|
|
file_links_expire_at: Accounts.link_expires_at(account))
|
|
|
|
file_links_expire_at: Accounts.link_expires_at(account))
|
|
|
|
cell_layouters = Hash.new do |hash, valign|
|
|
|
|
cell_layouters = Hash.new do |hash, valign|
|
|
|
|
hash[valign] = HexaPDF::Layout::TextLayouter.new(text_valign: valign.to_sym, text_align: :center)
|
|
|
|
hash[valign] = HexaPDF::Layout::TextLayouter.new(text_valign: valign.to_sym, text_align: :center)
|
|
|
|
@ -342,17 +337,14 @@ module Submissions
|
|
|
|
|
|
|
|
|
|
|
|
time_format = with_timestamp_seconds ? :detailed : :long
|
|
|
|
time_format = with_timestamp_seconds ? :detailed : :long
|
|
|
|
|
|
|
|
|
|
|
|
signature_timestamp =
|
|
|
|
|
|
|
|
(with_signature_id_completed_at ? submitter.completed_at : nil) || attachment.created_at
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if with_signature_id_reason || field.dig('preferences', 'reasons').present?
|
|
|
|
if with_signature_id_reason || field.dig('preferences', 'reasons').present?
|
|
|
|
"#{"#{I18n.t('reason')}: " if reason_value}#{reason_value || I18n.t('digitally_signed_by')} " \
|
|
|
|
"#{"#{I18n.t('reason')}: " if reason_value}#{reason_value || I18n.t('digitally_signed_by')} " \
|
|
|
|
"#{submitter.name}#{" <#{submitter.email}>" if submitter.email.present?}\n" \
|
|
|
|
"#{submitter.name}#{" <#{submitter.email}>" if submitter.email.present?}\n" \
|
|
|
|
"#{I18n.l(signature_timestamp.in_time_zone(timezone), format: time_format)} " \
|
|
|
|
"#{I18n.l(attachment.created_at.in_time_zone(timezone), format: time_format)} " \
|
|
|
|
"#{TimeUtils.timezone_abbr(timezone, signature_timestamp)}"
|
|
|
|
"#{TimeUtils.timezone_abbr(timezone, attachment.created_at)}"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
"#{I18n.l(signature_timestamp.in_time_zone(timezone), format: time_format)} " \
|
|
|
|
"#{I18n.l(attachment.created_at.in_time_zone(timezone), format: time_format)} " \
|
|
|
|
"#{TimeUtils.timezone_abbr(timezone, signature_timestamp)}"
|
|
|
|
"#{TimeUtils.timezone_abbr(timezone, attachment.created_at)}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|