add signed option in filename
This commit is contained in:
@@ -173,7 +173,7 @@
|
||||
<%= t('document_download_filename_format') %>
|
||||
</span>
|
||||
<div class="mt-3">
|
||||
<%= f.select :value, [["#{I18n.t('document_name')}.pdf", '{document.name}'], ["#{I18n.t('document_name')} - name@domain.com.pdf", '{document.name} - {submission.submitters}'], ["#{I18n.t('document_name')} - name@domain.com - #{I18n.l(Time.current.beginning_of_year.in_time_zone(current_account.timezone), format: :short)}.pdf", '{document.name} - {submission.submitters} - {submission.completed_at}']], {}, class: 'base-select', onchange: 'this.form.requestSubmit()' %>
|
||||
<%= f.select :value, [["#{I18n.t('document_name')}.pdf", '{document.name}'], ["#{I18n.t('document_name')} - #{I18n.t(:signed)}.pdf", '{document.name} - {submission.status}'], ["#{I18n.t('document_name')} - name@domain.com.pdf", '{document.name} - {submission.submitters}'], ["#{I18n.t('document_name')} - name@domain.com - #{I18n.l(Time.current.beginning_of_year.in_time_zone(current_account.timezone), format: :short)}.pdf", '{document.name} - {submission.submitters} - {submission.completed_at}']], {}, class: 'base-select', onchange: 'this.form.requestSubmit()' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -24,6 +24,7 @@ en: &en
|
||||
pending_by_me: Pending by me
|
||||
partially_completed: Partially completed
|
||||
unarchive: Unarchive
|
||||
signed: Signed
|
||||
first_party: 'First Party'
|
||||
remove_filter: Remove filter
|
||||
add: Add
|
||||
@@ -725,6 +726,7 @@ en: &en
|
||||
read: Read your data
|
||||
|
||||
es: &es
|
||||
signed: Firmado
|
||||
reply_to: Responder a
|
||||
partially_completed: Parcialmente completado
|
||||
pending_by_me: Pendiente por mi
|
||||
@@ -1432,6 +1434,7 @@ es: &es
|
||||
read: Leer tus datos
|
||||
|
||||
it: &it
|
||||
signed: Firmato
|
||||
reply_to: Rispondi a
|
||||
pending_by_me: In sospeso da me
|
||||
add: Aggiungi
|
||||
@@ -2138,6 +2141,7 @@ it: &it
|
||||
read: Leggi i tuoi dati
|
||||
|
||||
fr: &fr
|
||||
signed: Signé
|
||||
reply_to: Répondre à
|
||||
partially_completed: Partiellement complété
|
||||
pending_by_me: En attente par moi
|
||||
@@ -2846,6 +2850,7 @@ fr: &fr
|
||||
read: Lire vos données
|
||||
|
||||
pt: &pt
|
||||
signed: Assinado
|
||||
reply_to: Responder a
|
||||
partially_completed: Parcialmente concluído
|
||||
pending_by_me: Pendente por mim
|
||||
@@ -3553,6 +3558,7 @@ pt: &pt
|
||||
read: Ler seus dados
|
||||
|
||||
de: &de
|
||||
signed: Unterschrieben
|
||||
reply_to: Antworten auf
|
||||
partially_completed: Teilweise abgeschlossen
|
||||
pending_by_me: Ausstehend von mir
|
||||
|
||||
@@ -123,6 +123,18 @@ module Submitters
|
||||
filename = ReplaceEmailVariables.call(filename_format, submitter:)
|
||||
|
||||
filename = filename.gsub('{document.name}', blob.filename.base)
|
||||
filename = filename.gsub(' - {submission.status}') do
|
||||
if submitter.submission.submitters.all?(&:completed_at?)
|
||||
status =
|
||||
if submitter.submission.template_fields.any? { |f| f['type'] == 'signature' }
|
||||
I18n.t(:signed)
|
||||
else
|
||||
I18n.t(:completed)
|
||||
end
|
||||
|
||||
" - #{status}"
|
||||
end
|
||||
end
|
||||
|
||||
filename = filename.gsub(
|
||||
'{submission.completed_at}',
|
||||
|
||||
Reference in New Issue
Block a user