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