enforce signing order

pull/475/head
Pete Matsyburka 7 months ago
parent 4e1fa336a2
commit 47c7270911

@ -15,6 +15,7 @@ class AccountConfigsController < ApplicationController
AccountConfig::DOWNLOAD_LINKS_AUTH_KEY, AccountConfig::DOWNLOAD_LINKS_AUTH_KEY,
AccountConfig::FORCE_SSO_AUTH_KEY, AccountConfig::FORCE_SSO_AUTH_KEY,
AccountConfig::FLATTEN_RESULT_PDF_KEY, AccountConfig::FLATTEN_RESULT_PDF_KEY,
AccountConfig::ENFORCE_SIGNING_ORDER_KEY,
AccountConfig::WITH_SIGNATURE_ID, AccountConfig::WITH_SIGNATURE_ID,
AccountConfig::COMBINE_PDF_RESULT_KEY, AccountConfig::COMBINE_PDF_RESULT_KEY,
AccountConfig::REQUIRE_SIGNING_REASON_KEY, AccountConfig::REQUIRE_SIGNING_REASON_KEY,

@ -20,7 +20,11 @@ class SubmitFormController < ApplicationController
@submitter.account.archived_at? @submitter.account.archived_at?
return render :expired if submission.expired? return render :expired if submission.expired?
return render :declined if @submitter.declined_at? return render :declined if @submitter.declined_at?
return render :awaiting if submission.template.preferences['submitters_order'] == 'preserved' &&
@form_configs = Submitters::FormConfigs.call(@submitter, CONFIG_KEYS)
return render :awaiting if (@form_configs[:enforce_signing_order] ||
submission.template.preferences['submitters_order'] == 'preserved') &&
!Submitters.current_submitter_order?(@submitter) !Submitters.current_submitter_order?(@submitter)
Submitters.preload_with_pages(@submitter) Submitters.preload_with_pages(@submitter)
@ -29,8 +33,6 @@ class SubmitFormController < ApplicationController
@attachments_index = build_attachments_index(submission) @attachments_index = build_attachments_index(submission)
@form_configs = Submitters::FormConfigs.call(@submitter, CONFIG_KEYS)
return unless @form_configs[:prefill_signature] return unless @form_configs[:prefill_signature]
if (user_signature = UserConfigs.load_signature(current_user)) if (user_signature = UserConfigs.load_signature(current_user))

@ -30,6 +30,7 @@ class AccountConfig < ApplicationRecord
ALLOW_TO_RESUBMIT = 'allow_to_resubmit' ALLOW_TO_RESUBMIT = 'allow_to_resubmit'
ALLOW_TO_DECLINE_KEY = 'allow_to_decline' ALLOW_TO_DECLINE_KEY = 'allow_to_decline'
SUBMITTER_REMINDERS = 'submitter_reminders' SUBMITTER_REMINDERS = 'submitter_reminders'
ENFORCE_SIGNING_ORDER_KEY = 'enforce_signing_order'
FORM_COMPLETED_BUTTON_KEY = 'form_completed_button' FORM_COMPLETED_BUTTON_KEY = 'form_completed_button'
FORM_COMPLETED_MESSAGE_KEY = 'form_completed_message' FORM_COMPLETED_MESSAGE_KEY = 'form_completed_message'
FORM_WITH_CONFETTI_KEY = 'form_with_confetti' FORM_WITH_CONFETTI_KEY = 'form_with_confetti'

@ -151,6 +151,20 @@
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
<% if !Docuseal.multitenant? || can?(:manage, :personalization_advanced) %>
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::ENFORCE_SIGNING_ORDER_KEY) %>
<% if can?(:manage, account_config) %>
<%= form_for account_config, url: account_configs_path, method: :post do |f| %>
<%= f.hidden_field :key %>
<div class="flex items-center justify-between py-2.5">
<span>
<%= t('always_enforce_signing_order') %>
</span>
<%= f.check_box :value, class: 'toggle', checked: account_config.value, onchange: 'this.form.requestSubmit()' %>
</div>
<% end %>
<% end %>
<% end %>
</div> </div>
<% end %> <% end %>
<%= render 'compliances' %> <%= render 'compliances' %>

@ -322,6 +322,7 @@
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<% unless current_account.account_configs.exists?(key: AccountConfig::ENFORCE_SIGNING_ORDER_KEY, value: true) %>
<%= form_for @template, url: template_preferences_path(@template), method: :post, html: { autocomplete: 'off', class: 'mt-2' }, data: { close_on_submit: false } do |f| %> <%= form_for @template, url: template_preferences_path(@template), method: :post, html: { autocomplete: 'off', class: 'mt-2' }, data: { close_on_submit: false } do |f| %>
<div class="flex items-center pt-4 mt-4 justify-between border-t w-full"> <div class="flex items-center pt-4 mt-4 justify-between border-t w-full">
<span> <span>
@ -332,6 +333,7 @@
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<% end %>
<div class="form-control mt-5 pb-2"> <div class="form-control mt-5 pb-2">
<%= button_tag button_title(title: t('save'), disabled_with: t('updating')), class: 'base-button', form: :submitters_form %> <%= button_tag button_title(title: t('save'), disabled_with: t('updating')), class: 'base-button', form: :submitters_form %>
</div> </div>

@ -21,6 +21,7 @@ en: &en
hi_there: Hi there hi_there: Hi there
thanks: Thanks thanks: Thanks
bcc_recipients: BCC recipients bcc_recipients: BCC recipients
always_enforce_signing_order: Always enforce the signing order
edit_per_party: Edit per party edit_per_party: Edit per party
reply_to: Reply to reply_to: Reply to
pending_by_me: Pending by me pending_by_me: Pending by me
@ -746,6 +747,7 @@ en: &en
read: Read your data read: Read your data
es: &es es: &es
always_enforce_signing_order: Siempre imponer el orden de firma
bcc_recipients: Destinatarios CCO bcc_recipients: Destinatarios CCO
edit_per_party: Editar por parte edit_per_party: Editar por parte
signed: Firmado signed: Firmado
@ -1474,6 +1476,7 @@ es: &es
read: Leer tus datos read: Leer tus datos
it: &it it: &it
always_enforce_signing_order: Applicare sempre l'ordine di firma
bcc_recipients: Destinatari BCC bcc_recipients: Destinatari BCC
edit_per_party: Modifica per partito edit_per_party: Modifica per partito
signed: Firmato signed: Firmato
@ -2201,6 +2204,7 @@ it: &it
read: Leggi i tuoi dati read: Leggi i tuoi dati
fr: &fr fr: &fr
always_enforce_signing_order: Toujours appliquer l'ordre de signature
bcc_recipients: Destinataires en CCI bcc_recipients: Destinataires en CCI
edit_per_party: Éditer par partie edit_per_party: Éditer par partie
signed: Signé signed: Signé
@ -2930,6 +2934,7 @@ fr: &fr
read: Lire vos données read: Lire vos données
pt: &pt pt: &pt
always_enforce_signing_order: Sempre impor a ordem de assinatura
bcc_recipients: Destinatários BCC bcc_recipients: Destinatários BCC
edit_per_party: Edita por festa edit_per_party: Edita por festa
signed: Assinado signed: Assinado
@ -3658,6 +3663,7 @@ pt: &pt
read: Ler seus dados read: Ler seus dados
de: &de de: &de
always_enforce_signing_order: Immer die Reihenfolge der Unterschriften erzwingen
bcc_recipients: BCC-Empfänger bcc_recipients: BCC-Empfänger
edit_per_party: Bearbeiten pro Partei edit_per_party: Bearbeiten pro Partei
signed: Unterschrieben signed: Unterschrieben

@ -8,6 +8,7 @@ module Submitters
AccountConfig::FORM_PREFILL_SIGNATURE_KEY, AccountConfig::FORM_PREFILL_SIGNATURE_KEY,
AccountConfig::WITH_SIGNATURE_ID, AccountConfig::WITH_SIGNATURE_ID,
AccountConfig::ALLOW_TO_DECLINE_KEY, AccountConfig::ALLOW_TO_DECLINE_KEY,
AccountConfig::ENFORCE_SIGNING_ORDER_KEY,
AccountConfig::REQUIRE_SIGNING_REASON_KEY, AccountConfig::REQUIRE_SIGNING_REASON_KEY,
AccountConfig::REUSE_SIGNATURE_KEY, AccountConfig::REUSE_SIGNATURE_KEY,
AccountConfig::ALLOW_TYPED_SIGNATURE, AccountConfig::ALLOW_TYPED_SIGNATURE,
@ -27,6 +28,7 @@ module Submitters
with_decline = find_safe_value(configs, AccountConfig::ALLOW_TO_DECLINE_KEY) != false with_decline = find_safe_value(configs, AccountConfig::ALLOW_TO_DECLINE_KEY) != false
with_signature_id = find_safe_value(configs, AccountConfig::WITH_SIGNATURE_ID) == true with_signature_id = find_safe_value(configs, AccountConfig::WITH_SIGNATURE_ID) == true
require_signing_reason = find_safe_value(configs, AccountConfig::REQUIRE_SIGNING_REASON_KEY) == true require_signing_reason = find_safe_value(configs, AccountConfig::REQUIRE_SIGNING_REASON_KEY) == true
enforce_signing_order = find_safe_value(configs, AccountConfig::ENFORCE_SIGNING_ORDER_KEY) == true
policy_links = find_safe_value(configs, AccountConfig::POLICY_LINKS_KEY) policy_links = find_safe_value(configs, AccountConfig::POLICY_LINKS_KEY)
attrs = { attrs = {
@ -36,6 +38,7 @@ module Submitters
reuse_signature:, reuse_signature:,
with_decline:, with_decline:,
policy_links:, policy_links:,
enforce_signing_order:,
completed_message:, completed_message:,
require_signing_reason:, require_signing_reason:,
prefill_signature:, prefill_signature:,

Loading…
Cancel
Save