Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2024-04-29 13:39:20 +02:00
8 changed files with 29 additions and 12 deletions

View File

@@ -459,7 +459,7 @@ if (isModEnabled('product')) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>'; print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
print '<td width="60" class="right">'; print '<td width="60" class="right">';
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 '</td>'; print '</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
@@ -470,7 +470,7 @@ if (isModEnabled('societe')) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>'; print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
print '<td width="60" class="right">'; print '<td width="60" class="right">';
print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1); print $formbarcode->selectBarcodeType(getDolGlobalString('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
print '</td>'; print '</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';

View File

@@ -80,8 +80,8 @@ class FormBarCode
} }
// We check if barcode is already selected by default // We check if barcode is already selected by default
if (((isModEnabled("product") || isModEnabled("service")) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) || if (((isModEnabled("product") || isModEnabled("service")) && getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE') == $code_id) ||
(isModEnabled("societe") && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) { (isModEnabled("societe") && getDolGlobalString('GENBARCODE_BARCODETYPE_THIRDPARTY') == $code_id)) {
$disable = 'disabled'; $disable = 'disabled';
} }

View File

@@ -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_PHONEMOBILE__'] = (isset($object->phone_mobile) ? dol_print_phone($object->phone_mobile) : '');
$substitutionarray['__MEMBER_TYPE__'] = (isset($object->type) ? $object->type : ''); $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__'] = 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_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__'] = (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') : ''); $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__'] = dol_print_date($dateplannedstart, 'day');
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE_RFC__'] = dol_print_date($dateplannedstart, 'dayrfc'); $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_HIGHEST_PLANNED_START_DATETIME__'] = dol_print_date($dateplannedstart, 'standard');
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = dol_print_date($datenextexpiration, 'day'); $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_DATE_RFC__'] = dol_print_date($datenextexpiration, 'dayrfc');
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = dol_print_date($datenextexpiration, 'standard'); $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = dol_print_date($datenextexpiration, 'standard');

View File

@@ -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/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/barcode.lib.php'; // to be able to call function barcode_gen_ean_sum($ean) 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)) { if (empty($type)) {
$type = getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE'); $type = getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE');
} //get barcode type configuration for products if $type not set }
// Get Mask value // Get Mask value
$mask = getDolGlobalString('BARCODE_STANDARD_PRODUCT_MASK'); $mask = getDolGlobalString('BARCODE_STANDARD_PRODUCT_MASK');

View File

@@ -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/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/barcode.lib.php'; // to be able to call function barcode_gen_ean_sum($ean) 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)) { if (empty($type)) {
$type = getDolGlobalString('GENBARCODE_BARCODETYPE_THIRDPARTY'); $type = getDolGlobalString('GENBARCODE_BARCODETYPE_THIRDPARTY');
} //get barcode type configuration for companies if $type not set }
// Get Mask value // Get Mask value
$mask = getDolGlobalString('BARCODE_STANDARD_THIRDPARTY_MASK'); $mask = getDolGlobalString('BARCODE_STANDARD_THIRDPARTY_MASK');

View File

@@ -115,6 +115,13 @@ class InterfaceWorkflowManager extends DolibarrTriggers
$ret = $newobject->createFromOrder($object, $user); $ret = $newobject->createFromOrder($object, $user);
if ($ret < 0) { if ($ret < 0) {
$this->setErrorsFromObject($newobject); $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(); $object->clearObjectLinkedCache();

View File

@@ -1694,6 +1694,7 @@ class EmailCollector extends CommonObject
$operationslog .= " - ".dol_escape_htmltag((string) $imapemail); $operationslog .= " - ".dol_escape_htmltag((string) $imapemail);
} }
$operationslog .= " - References: ".dol_escape_htmltag($headers['References'] ?? '')." - Subject: ".dol_escape_htmltag($headers['Subject']); $operationslog .= " - References: ".dol_escape_htmltag($headers['References'] ?? '')." - Subject: ".dol_escape_htmltag($headers['Subject']);
dol_syslog("** Process email ".$iforemailloop." References: ".($headers['References'] ?? '')." Subject: ".$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($trackidfoundintorecipienttype)) {
if (empty($headers['References']) || !preg_match('/@'.preg_quote($host, '/').'/', $headers['References'])) { if (empty($headers['References']) || !preg_match('/@'.preg_quote($host, '/').'/', $headers['References'])) {
$nbemailprocessed++; $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 continue; // Exclude email
} }
} }
@@ -2062,8 +2063,9 @@ class EmailCollector extends CommonObject
}*/ }*/
} elseif (preg_match('/<(.*@.*)>/', $reference, $reg)) { } elseif (preg_match('/<(.*@.*)>/', $reference, $reg)) {
// This is an external reference, we check if we have it in our database // This is an external reference, we check if we have it in our database
if (!is_object($objectemail)) { if (!is_object($objectemail) && isModEnabled('ticket')) {
$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]))."%'"; $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); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
$obj = $this->db->fetch_object($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])."'"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."projet where email_msgid = '".$this->db->escape($reg[1])."'";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { 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])."'"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature where email_msgid = '".$this->db->escape($reg[1])."'";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {

View File

@@ -73,7 +73,11 @@ if ($user->socid > 0) { // Protection if external user
//$socid = $user->socid; //$socid = $user->socid;
accessforbidden(); accessforbidden();
} }
$result = restrictedArea($user, 'holiday', $id, '', 'readall'); $result = restrictedArea($user, 'holiday', $id);
if (!$user->hasRight('holiday', 'readall')) {
accessforbidden();
}
/* /*