diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php
index ef365881feb..59288101f36 100644
--- a/htdocs/admin/bank.php
+++ b/htdocs/admin/bank.php
@@ -243,7 +243,7 @@ while ($i < $nbofbank) {
}
print "\n";
- if ($conf->global->BANK_SHOW_ORDER_OPTION == $i) {
+ if (getDolGlobalInt('BANK_SHOW_ORDER_OPTION') == $i) {
print '
';
print img_picto($langs->trans("Activated"), 'on');
print ' | ';
@@ -415,7 +415,7 @@ print '| ';
print $langs->trans('BankColorizeMovementDesc');
print " | ";
// Active
-if ($conf->global->BANK_COLORIZE_MOVEMENT) {
+if (!empty(getDolGlobalInt('BANK_COLORIZE_MOVEMENT'))) {
print ''."\n";
print '';
print img_picto($langs->trans("Enabled"), 'switch_on');
@@ -429,7 +429,7 @@ if ($conf->global->BANK_COLORIZE_MOVEMENT) {
print " |
\n";
-if (!empty($conf->global->BANK_COLORIZE_MOVEMENT)) {
+if (!empty(getDolGlobalInt('BANK_COLORIZE_MOVEMENT'))) {
$i = 1;
while ($i <= 2) {
$key = $i;
@@ -471,7 +471,7 @@ print "\n";
print $langs->trans('AutoReportLastAccountStatement');
print ' | ';
// Active
-if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
+if (!empty(getDolGlobalString('BANK_REPORT_LAST_NUM_RELEVE'))) {
print ''."\n";
print '';
print img_picto($langs->trans("Enabled"), 'switch_on');
@@ -482,8 +482,18 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
print ''.img_picto($langs->trans("Disabled"), 'switch_off').'';
print " | ";
}
-
print "\n";
+
+// Allow SEPA Mandate OnLine Sign
+if (empty(getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT'))) {
+ print '';
+ print '| '.$langs->trans("AllowOnLineSign").' | '.$langs->trans("BankAccountModelModule").' | ';
+ print '';
+ print ajax_constantonoff('SOCIETE_RIB_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1);
+ print ' |
';
+}
+
+
print '';
print dol_get_fiche_end();
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index 10044e33b5b..201b75a8ab7 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -632,7 +632,12 @@ print '';
print ajax_constantonoff('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
print ' | ';
-
+// Allow external download
+print '';
+print '| '.$langs->trans("AllowOnLineSign").' | ';
+print '';
+print ajax_constantonoff('PROPOSAL_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1);
+print ' |
';
// default update prices on cloning a proposal
/*
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index e31b43f5a43..4a58711197f 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -3035,7 +3035,7 @@ if ($action == 'create') {
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList);
// Show online signature link
- $useonlinesignature = 1;
+ $useonlinesignature = getDolGlobalInt('PROPOSAL_ALLOW_ONLINESIGN');
if ($object->statut != Propal::STATUS_DRAFT && $useonlinesignature) {
print '
';
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 31bd7888a86..314658cefae 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -5536,32 +5536,35 @@ abstract class CommonObject
// Set the public "share" key
$setsharekey = false;
if ($this->element == 'propal' || $this->element == 'proposal') {
- if (!isset($conf->global->PROPOSAL_ALLOW_ONLINESIGN) || !empty($conf->global->PROPOSAL_ALLOW_ONLINESIGN)) {
+ if (!emptygetDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
$setsharekey = true; // feature to make online signature is not set or set to on (default)
}
- if (!empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) {
+ if (!empty(getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD"))) {
$setsharekey = true;
}
}
- if ($this->element == 'commande' && !empty($conf->global->ORDER_ALLOW_EXTERNAL_DOWNLOAD)) {
+ if ($this->element == 'commande' && !empty(getDolGlobalInt("ORDER_ALLOW_EXTERNAL_DOWNLOAD"))) {
$setsharekey = true;
}
- if ($this->element == 'facture' && !empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) {
+ if ($this->element == 'facture' && !empty(getDolGlobalInt("INVOICE_ALLOW_EXTERNAL_DOWNLOAD"))) {
$setsharekey = true;
}
- if ($this->element == 'bank_account' && !empty($conf->global->BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD)) {
+ if ($this->element == 'bank_account' && !empty(getDolGlobalInt("BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD"))) {
$setsharekey = true;
}
- if ($this->element == 'product' && !empty($conf->global->PRODUCT_ALLOW_EXTERNAL_DOWNLOAD)) {
+ if ($this->element == 'product' && !empty(getDolGlobalInt("PRODUCT_ALLOW_EXTERNAL_DOWNLOAD"))) {
$setsharekey = true;
}
- if ($this->element == 'contrat' && !empty($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD)) {
+ if ($this->element == 'contrat' && !empty(getDolGlobalInt("CONTRACT_ALLOW_EXTERNAL_DOWNLOAD"))) {
$setsharekey = true;
}
- if ($this->element == 'fichinter' && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) {
+ if ($this->element == 'fichinter' && !empty(getDolGlobalInt("FICHINTER_ALLOW_EXTERNAL_DOWNLOAD"))) {
$setsharekey = true;
}
- if ($this->element == 'supplier_proposal' && !empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) {
+ if ($this->element == 'supplier_proposal' && !empty(getDolGlobalInt("SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD"))) {
+ $setsharekey = true;
+ }
+ if ($this->element == 'societe_rib' && !empty(getDolGlobalInt("SOCIETE_RIB_ALLOW_ONLINESIGN"))) {
$setsharekey = true;
}
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 0fc2d733a38..3f4f0eeeaf7 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -188,7 +188,7 @@ function societe_prepare_head(Societe $object)
}
// Bank accounts
- if (empty($conf->global->SOCIETE_DISABLE_BANKACCOUNT)) {
+ if (empty(getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT'))) {
$nbBankAccount = 0;
$foundonexternalonlinesystem = 0;
$langs->load("bills");
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 8ad67df141d..4687ccc799e 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -2882,7 +2882,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if (empty($entity) || empty($conf->societe->multidir_output[$entity])) {
return array('accessallowed'=>0, 'error'=>'Value entity must be provided');
}
- if ($fuser->rights->societe->{$lire} || preg_match('/^specimen/i', $original_file)) {
+ if ($fuser->hasRight('societe', $lire) || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1;
}
$original_file = $conf->societe->multidir_output[$entity].'/'.$original_file;
diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php
index c3ca77e9a0c..ad0475091fc 100644
--- a/htdocs/core/modules/modPropale.class.php
+++ b/htdocs/core/modules/modPropale.class.php
@@ -104,6 +104,13 @@ class modPropale extends DolibarrModules
$this->const[$r][4] = 0;
$r++;
+ $this->const[$r][0] = "PROPOSAL_ALLOW_ONLINESIGN";
+ $this->const[$r][1] = "chaine";
+ $this->const[$r][2] = "1";
+ $this->const[$r][3] = "";
+ $this->const[$r][4] = 0;
+ $r++;
+
/*$this->const[$r][0] = "PROPALE_DRAFT_WATERMARK";
$this->const[$r][2] = "__(Draft)__";
$this->const[$r][3] = 'Watermark to show on draft proposals';
diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql
index 80b2f3be0b5..e1d0dcb503f 100644
--- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql
+++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql
@@ -412,3 +412,5 @@ CREATE TABLE llx_c_invoice_subtype (
ALTER TABLE llx_c_invoice_subtype ADD UNIQUE INDEX uk_c_invoice_subtype (entity, code);
ALTER TABLE llx_societe_rib ADD COLUMN last_main_doc varchar(255) AFTER currency_code;
+
+INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('PROPOSAL_ALLOW_ONLINESIGN', 1, '1', 'string', 0);
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 9c5d62fc38b..5532c5648e9 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2387,3 +2387,4 @@ Defaultfortype=Default
DefaultForTypeDesc=Template used by default when creating a new email for the template type
OptionXShouldBeEnabledInModuleY=Option "%s" should be enabled into module %s
OptionXIsCorrectlyEnabledInModuleY=Option "%s" is enabled into module %s
+AllowOnLineSign=Allow On Line signature
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 4fc55bfd30b..564f8527668 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -2377,5 +2377,5 @@ WarningModuleHasChangedSecurityCsrfParameter=Attention : le module %sa désactiv
EMailsInGoingDesc=La réception des e-mails est gérée par le module %s. Vous devez l'activer et le configurer si vous avez besoin de prendre en charge messages entrants.
MAIN_IMAP_USE_PHPIMAP=Utiliser la librairie PHP-IMAP pour la prise en charge IMAP, à la place du support IMAP natif de PHP. Ceci permet également l'utilisation d'une connexion OAuth2 pour IMAP (le module OAuth doit aussi être activé).
MAIN_CHECKBOX_LEFT_COLUMN=Afficher la colonne de sélection de champ et de ligne à gauche (à droite par défaut)
-
CSSPage=Style CSS
+AllowOnLineSign=Activer la signature en ligne
diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php
index a8c5988ab6a..ec61f626d60 100644
--- a/htdocs/public/onlinesign/newonlinesign.php
+++ b/htdocs/public/onlinesign/newonlinesign.php
@@ -565,10 +565,11 @@ if ($source == 'proposal') {
'force_dir_output'=>$diroutput
);
$result = $object->thirdparty->generateDocument($defaulttemplate, $langs, 0, 0, 0, $moreparams);
+ $object->last_main_doc=$object->thirdparty->last_main_doc;
}
-
+ var_dump($object->last_main_doc);
$directdownloadlink = $object->getLastMainDocLink('company');
- var_dump($directdownloadlink);
+ var_dump('toto', $directdownloadlink);
if ($directdownloadlink) {
print '
';
print img_mime($object->last_main_doc, '');
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index a9f9cdea193..78e217f3b6e 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -4993,6 +4993,7 @@ class Societe extends CommonObject
dol_print_error($this->db, $companybankaccount->error, $companybankaccount->errors);
}
$result = $companybankaccount->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
+ $this->last_main_doc=$companybankaccount->last_main_doc;
} else {
// Positionne le modele sur le nom du modele a utiliser
if (!dol_strlen($modele)) {
diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php
index 7e5ef9caf3e..18519821b82 100644
--- a/htdocs/societe/paymentmodes.php
+++ b/htdocs/societe/paymentmodes.php
@@ -1446,6 +1446,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print_liste_field_titre("WithdrawMode");
}
print_liste_field_titre("Default", '', '', '', '', '', '', '', 'center ');
+
print_liste_field_titre('', '', '', '', '', '', '', '', 'center ');
print_liste_field_titre('', '', '', '', '', '', '', '', 'center ');
// Fields from hook