enforce signing order
This commit is contained in:
@@ -15,6 +15,7 @@ class AccountConfigsController < ApplicationController
|
||||
AccountConfig::DOWNLOAD_LINKS_AUTH_KEY,
|
||||
AccountConfig::FORCE_SSO_AUTH_KEY,
|
||||
AccountConfig::FLATTEN_RESULT_PDF_KEY,
|
||||
AccountConfig::ENFORCE_SIGNING_ORDER_KEY,
|
||||
AccountConfig::WITH_SIGNATURE_ID,
|
||||
AccountConfig::COMBINE_PDF_RESULT_KEY,
|
||||
AccountConfig::REQUIRE_SIGNING_REASON_KEY,
|
||||
|
||||
@@ -20,7 +20,11 @@ class SubmitFormController < ApplicationController
|
||||
@submitter.account.archived_at?
|
||||
return render :expired if submission.expired?
|
||||
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.preload_with_pages(@submitter)
|
||||
@@ -29,8 +33,6 @@ class SubmitFormController < ApplicationController
|
||||
|
||||
@attachments_index = build_attachments_index(submission)
|
||||
|
||||
@form_configs = Submitters::FormConfigs.call(@submitter, CONFIG_KEYS)
|
||||
|
||||
return unless @form_configs[:prefill_signature]
|
||||
|
||||
if (user_signature = UserConfigs.load_signature(current_user))
|
||||
|
||||
@@ -30,6 +30,7 @@ class AccountConfig < ApplicationRecord
|
||||
ALLOW_TO_RESUBMIT = 'allow_to_resubmit'
|
||||
ALLOW_TO_DECLINE_KEY = 'allow_to_decline'
|
||||
SUBMITTER_REMINDERS = 'submitter_reminders'
|
||||
ENFORCE_SIGNING_ORDER_KEY = 'enforce_signing_order'
|
||||
FORM_COMPLETED_BUTTON_KEY = 'form_completed_button'
|
||||
FORM_COMPLETED_MESSAGE_KEY = 'form_completed_message'
|
||||
FORM_WITH_CONFETTI_KEY = 'form_with_confetti'
|
||||
|
||||
@@ -151,6 +151,20 @@
|
||||
</div>
|
||||
<% 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>
|
||||
<% end %>
|
||||
<%= render 'compliances' %>
|
||||
|
||||
@@ -322,15 +322,17 @@
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= 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">
|
||||
<span>
|
||||
<%= t('enforce_recipients_order') %>
|
||||
</span>
|
||||
<%= f.fields_for :preferences, Struct.new(:submitters_order).new(@template.preferences['submitters_order']) do |ff| %>
|
||||
<%= ff.check_box :submitters_order, { class: 'toggle', onchange: 'this.form.requestSubmit()' }, 'preserved', '' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% 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| %>
|
||||
<div class="flex items-center pt-4 mt-4 justify-between border-t w-full">
|
||||
<span>
|
||||
<%= t('enforce_recipients_order') %>
|
||||
</span>
|
||||
<%= f.fields_for :preferences, Struct.new(:submitters_order).new(@template.preferences['submitters_order']) do |ff| %>
|
||||
<%= ff.check_box :submitters_order, { class: 'toggle', onchange: 'this.form.requestSubmit()' }, 'preserved', '' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<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 %>
|
||||
|
||||
@@ -21,6 +21,7 @@ en: &en
|
||||
hi_there: Hi there
|
||||
thanks: Thanks
|
||||
bcc_recipients: BCC recipients
|
||||
always_enforce_signing_order: Always enforce the signing order
|
||||
edit_per_party: Edit per party
|
||||
reply_to: Reply to
|
||||
pending_by_me: Pending by me
|
||||
@@ -746,6 +747,7 @@ en: &en
|
||||
read: Read your data
|
||||
|
||||
es: &es
|
||||
always_enforce_signing_order: Siempre imponer el orden de firma
|
||||
bcc_recipients: Destinatarios CCO
|
||||
edit_per_party: Editar por parte
|
||||
signed: Firmado
|
||||
@@ -1474,6 +1476,7 @@ es: &es
|
||||
read: Leer tus datos
|
||||
|
||||
it: &it
|
||||
always_enforce_signing_order: Applicare sempre l'ordine di firma
|
||||
bcc_recipients: Destinatari BCC
|
||||
edit_per_party: Modifica per partito
|
||||
signed: Firmato
|
||||
@@ -2201,6 +2204,7 @@ it: &it
|
||||
read: Leggi i tuoi dati
|
||||
|
||||
fr: &fr
|
||||
always_enforce_signing_order: Toujours appliquer l'ordre de signature
|
||||
bcc_recipients: Destinataires en CCI
|
||||
edit_per_party: Éditer par partie
|
||||
signed: Signé
|
||||
@@ -2930,6 +2934,7 @@ fr: &fr
|
||||
read: Lire vos données
|
||||
|
||||
pt: &pt
|
||||
always_enforce_signing_order: Sempre impor a ordem de assinatura
|
||||
bcc_recipients: Destinatários BCC
|
||||
edit_per_party: Edita por festa
|
||||
signed: Assinado
|
||||
@@ -3658,6 +3663,7 @@ pt: &pt
|
||||
read: Ler seus dados
|
||||
|
||||
de: &de
|
||||
always_enforce_signing_order: Immer die Reihenfolge der Unterschriften erzwingen
|
||||
bcc_recipients: BCC-Empfänger
|
||||
edit_per_party: Bearbeiten pro Partei
|
||||
signed: Unterschrieben
|
||||
|
||||
@@ -8,6 +8,7 @@ module Submitters
|
||||
AccountConfig::FORM_PREFILL_SIGNATURE_KEY,
|
||||
AccountConfig::WITH_SIGNATURE_ID,
|
||||
AccountConfig::ALLOW_TO_DECLINE_KEY,
|
||||
AccountConfig::ENFORCE_SIGNING_ORDER_KEY,
|
||||
AccountConfig::REQUIRE_SIGNING_REASON_KEY,
|
||||
AccountConfig::REUSE_SIGNATURE_KEY,
|
||||
AccountConfig::ALLOW_TYPED_SIGNATURE,
|
||||
@@ -27,6 +28,7 @@ module Submitters
|
||||
with_decline = find_safe_value(configs, AccountConfig::ALLOW_TO_DECLINE_KEY) != false
|
||||
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
|
||||
enforce_signing_order = find_safe_value(configs, AccountConfig::ENFORCE_SIGNING_ORDER_KEY) == true
|
||||
policy_links = find_safe_value(configs, AccountConfig::POLICY_LINKS_KEY)
|
||||
|
||||
attrs = {
|
||||
@@ -36,6 +38,7 @@ module Submitters
|
||||
reuse_signature:,
|
||||
with_decline:,
|
||||
policy_links:,
|
||||
enforce_signing_order:,
|
||||
completed_message:,
|
||||
require_signing_reason:,
|
||||
prefill_signature:,
|
||||
|
||||
Reference in New Issue
Block a user