diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php
index b856a2cef3e..7123b487b8e 100644
--- a/htdocs/admin/barcode.php
+++ b/htdocs/admin/barcode.php
@@ -459,7 +459,7 @@ if (isModEnabled('product')) {
print '
';
print '| '.$langs->trans("SetDefaultBarcodeTypeProducts").' | ';
print '';
- print $formbarcode->selectBarcodeType($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE, "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
+ print $formbarcode->selectBarcodeType(getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
print ' | ';
print ' | ';
print '
';
@@ -470,7 +470,7 @@ if (isModEnabled('societe')) {
print '';
print '| '.$langs->trans("SetDefaultBarcodeTypeThirdParties").' | ';
print '';
- print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
+ print $formbarcode->selectBarcodeType(getDolGlobalString('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
print ' | ';
print ' | ';
print '
';
diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php
index ff8fb505202..992e676b89e 100644
--- a/htdocs/core/class/html.formbarcode.class.php
+++ b/htdocs/core/class/html.formbarcode.class.php
@@ -80,8 +80,8 @@ class FormBarCode
}
// We check if barcode is already selected by default
- if (((isModEnabled("product") || isModEnabled("service")) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) ||
- (isModEnabled("societe") && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) {
+ if (((isModEnabled("product") || isModEnabled("service")) && getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE') == $code_id) ||
+ (isModEnabled("societe") && getDolGlobalString('GENBARCODE_BARCODETYPE_THIRDPARTY') == $code_id)) {
$disable = 'disabled';
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 3b347c8fc30..669a402e298 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -8657,6 +8657,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__MEMBER_PHONEMOBILE__'] = (isset($object->phone_mobile) ? dol_print_phone($object->phone_mobile) : '');
$substitutionarray['__MEMBER_TYPE__'] = (isset($object->type) ? $object->type : '');
$substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE__'] = dol_print_date($object->first_subscription_date, 'day');
+
$substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_RFC__'] = dol_print_date($object->first_subscription_date, 'dayrfc');
$substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_START__'] = (isset($object->first_subscription_date_start) ? dol_print_date($object->first_subscription_date_start, 'day') : '');
$substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_START_RFC__'] = (isset($object->first_subscription_date_start) ? dol_print_date($object->first_subscription_date_start, 'dayrfc') : '');
@@ -8796,6 +8797,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = dol_print_date($dateplannedstart, 'day');
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE_RFC__'] = dol_print_date($dateplannedstart, 'dayrfc');
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = dol_print_date($dateplannedstart, 'standard');
+
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = dol_print_date($datenextexpiration, 'day');
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE_RFC__'] = dol_print_date($datenextexpiration, 'dayrfc');
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = dol_print_date($datenextexpiration, 'standard');
diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
index 8c959a42db1..0bcd4c10dcf 100644
--- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php
+++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
@@ -175,9 +175,10 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/barcode.lib.php'; // to be able to call function barcode_gen_ean_sum($ean)
+ // Get barcode type configuration for products if $type not set
if (empty($type)) {
$type = getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE');
- } //get barcode type configuration for products if $type not set
+ }
// Get Mask value
$mask = getDolGlobalString('BARCODE_STANDARD_PRODUCT_MASK');
diff --git a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php
index b7d7a1ca8ff..5e7e402dcad 100644
--- a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php
+++ b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php
@@ -182,9 +182,10 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/barcode.lib.php'; // to be able to call function barcode_gen_ean_sum($ean)
+ // Get barcode type configuration for products if $type not set
if (empty($type)) {
$type = getDolGlobalString('GENBARCODE_BARCODETYPE_THIRDPARTY');
- } //get barcode type configuration for companies if $type not set
+ }
// Get Mask value
$mask = getDolGlobalString('BARCODE_STANDARD_THIRDPARTY_MASK');
diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
index 7f41166988c..6599bd2ba58 100644
--- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
+++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
@@ -115,6 +115,13 @@ class InterfaceWorkflowManager extends DolibarrTriggers
$ret = $newobject->createFromOrder($object, $user);
if ($ret < 0) {
$this->setErrorsFromObject($newobject);
+ } else {
+ if (empty($object->fk_account) && !empty($object->thirdparty->fk_account) && !getDolGlobalInt('BANK_ASK_PAYMENT_BANK_DURING_ORDER')) {
+ $res = $newobject->setBankAccount($object->thirdparty->fk_account, true, $user);
+ if ($ret < 0) {
+ $this->setErrorsFromObject($newobject);
+ }
+ }
}
$object->clearObjectLinkedCache();
diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php
index 115505139db..9cc8ecb0bf2 100644
--- a/htdocs/emailcollector/class/emailcollector.class.php
+++ b/htdocs/emailcollector/class/emailcollector.class.php
@@ -1694,6 +1694,7 @@ class EmailCollector extends CommonObject
$operationslog .= " - ".dol_escape_htmltag((string) $imapemail);
}
$operationslog .= " - References: ".dol_escape_htmltag($headers['References'] ?? '')." - Subject: ".dol_escape_htmltag($headers['Subject']);
+
dol_syslog("** Process email ".$iforemailloop." References: ".($headers['References'] ?? '')." Subject: ".$headers['Subject']);
@@ -1715,7 +1716,7 @@ class EmailCollector extends CommonObject
if (empty($trackidfoundintorecipienttype)) {
if (empty($headers['References']) || !preg_match('/@'.preg_quote($host, '/').'/', $headers['References'])) {
$nbemailprocessed++;
- dol_syslog(" Discarded - No suffix in email recipient and no Header References found matching signature of application so with a trackid");
+ dol_syslog(" Discarded - No suffix in email recipient and no Header References found matching the signature of the application, so with a trackid coming from the application");
continue; // Exclude email
}
}
@@ -2062,8 +2063,9 @@ class EmailCollector extends CommonObject
}*/
} elseif (preg_match('/<(.*@.*)>/', $reference, $reg)) {
// This is an external reference, we check if we have it in our database
- if (!is_object($objectemail)) {
- $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."ticket where email_msgid = '".$this->db->escape($reg[1])."' OR origin_references like '%".$this->db->escape($this->db->escapeforlike($reg[1]))."%'";
+ if (!is_object($objectemail) && isModEnabled('ticket')) {
+ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."ticket";
+ $sql .= " WHERE email_msgid = '".$this->db->escape($reg[1])."' OR origin_references like '%".$this->db->escape($this->db->escapeforlike($reg[1]))."%'";
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
@@ -2077,7 +2079,7 @@ class EmailCollector extends CommonObject
}
}
- if (!is_object($objectemail)) {
+ if (!is_object($objectemail) && isModEnabled('project')) {
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."projet where email_msgid = '".$this->db->escape($reg[1])."'";
$resql = $this->db->query($sql);
if ($resql) {
@@ -2092,7 +2094,7 @@ class EmailCollector extends CommonObject
}
}
- if (!is_object($objectemail)) {
+ if (!is_object($objectemail) && isModEnabled('recruitment')) {
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature where email_msgid = '".$this->db->escape($reg[1])."'";
$resql = $this->db->query($sql);
if ($resql) {
diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php
index 59ac708cad1..b5e66d14f5f 100644
--- a/htdocs/holiday/month_report.php
+++ b/htdocs/holiday/month_report.php
@@ -73,7 +73,11 @@ if ($user->socid > 0) { // Protection if external user
//$socid = $user->socid;
accessforbidden();
}
-$result = restrictedArea($user, 'holiday', $id, '', 'readall');
+$result = restrictedArea($user, 'holiday', $id);
+
+if (!$user->hasRight('holiday', 'readall')) {
+ accessforbidden();
+}
/*