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

This commit is contained in:
Laurent Destailleur 2022-12-30 12:15:46 +01:00
commit dab6b5f8a5
10 changed files with 17 additions and 21 deletions

View File

@ -446,7 +446,7 @@ class AccountancyCategory // extends CommonObject
} else {
$this->error = "Error ".$this->db->lasterror();
$this->errors[] = $this->error;
dol_syslog(__METHOD__." ".implode(','.$this->errors), LOG_ERR);
dol_syslog(__METHOD__." ".implode(',', $this->errors), LOG_ERR);
return -1;
}
@ -488,7 +488,7 @@ class AccountancyCategory // extends CommonObject
} else {
$this->error = "Error ".$this->db->lasterror();
$this->errors[] = $this->error;
dol_syslog(__METHOD__." ".implode(','.$this->errors), LOG_ERR);
dol_syslog(__METHOD__." ".implode(',', $this->errors), LOG_ERR);
return -1;
}

View File

@ -565,7 +565,7 @@ if (empty($reshook)) {
}
if (!empty($object->url) && !isValidUrl($object->url)) {
$langs->load("errors");
setEventMessages('', $langs->trans("ErrorBadUrl", $object->url), 'errors');
setEventMessages($langs->trans("ErrorBadUrl", $object->url), null, 'errors');
}
$public = 0;
if (isset($public)) {

View File

@ -413,9 +413,9 @@ $result = $api->r->handle();
if (Luracast\Restler\Defaults::$returnResponse) {
// We try to compress the data received data
if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'br') !== false && is_callable('brotli_compress')) {
if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'br') !== false && is_callable('brotli_compress') && defined('BROTLI_TEXT')) {
header('Content-Encoding: br');
$result = brotli_compress($result, 11, BROTLI_TEXT);
$result = brotli_compress($result, 11, constant('BROTLI_TEXT'));
} elseif (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'bz') !== false && is_callable('bzcompress')) {
header('Content-Encoding: bz');
$result = bzcompress($result, 9);

View File

@ -304,7 +304,7 @@ class BlockedLogAuthority
$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$signature.'&b='.$block->signature;
$res = getURLContent($url);
echo $block->signature.' '.$url.' '.$res.'<br>';
echo $block->signature.' '.$url.' '.$res['content'].'<br>';
if ($res === 'blockalreadyadded' || $res === 'blockadded') {
$block->setCertified();
} else {

View File

@ -86,8 +86,8 @@ class DolGeoIP
dol_syslog('DolGeoIP '.$this->errorlabel, LOG_ERR);
return 0;
}
} elseif (function_exists('geoip_open')) {
$this->gi = geoip_open($datfile, GEOIP_STANDARD);
} elseif (function_exists('geoip_open') && defined('GEOIP_STANDARD')) {
$this->gi = geoip_open($datfile, constant('GEOIP_STANDARD'));
} elseif (function_exists('geoip_country_code_by_name')) {
$this->gi = 'NOGI'; // We are using embedded php geoip functions
//print 'function_exists(geoip_country_code_by_name))='.function_exists('geoip_country_code_by_name');

View File

@ -2322,7 +2322,7 @@ class EmailCollector extends CommonObject
'class' => 'compta/facture/class/facture.class.php',
'object' => 'Facture'),
'fournisseur/facture' => array('table' => 'facture_fourn',
'fields' => array('ref', ref_client),
'fields' => array('ref', 'ref_client'),
'class' => 'fourn/class/fournisseur.facture.class.php',
'object' => 'FactureFournisseur'),
'produit' => array('table' => 'product',

View File

@ -77,7 +77,7 @@ class MailmanSpip
*/
public function isSpipEnabled()
{
if (defined("ADHERENT_USE_SPIP") && (ADHERENT_USE_SPIP == 1)) {
if (getDolGlobalInt("ADHERENT_USE_SPIP") == 1) {
return true;
}
@ -91,10 +91,8 @@ class MailmanSpip
*/
public function checkSpipConfig()
{
if (defined('ADHERENT_SPIP_SERVEUR') && defined('ADHERENT_SPIP_USER') && defined('ADHERENT_SPIP_PASS') && defined('ADHERENT_SPIP_DB')) {
if (ADHERENT_SPIP_SERVEUR != '' && ADHERENT_SPIP_USER != '' && ADHERENT_SPIP_PASS != '' && ADHERENT_SPIP_DB != '') {
return true;
}
if (getDolGlobalString('ADHERENT_SPIP_SERVEUR') != '' && getDolGlobalString('ADHERENT_SPIP_USER') != '' && getDolGlobalString('ADHERENT_SPIP_PASS') != '' && getDolGlobalString('ADHERENT_SPIP_DB') != '') {
return true;
}
return false;

View File

@ -781,9 +781,7 @@ class FormProduct
*/
public function selectLotDataList($htmlname = 'batch_id', $empty = 0, $fk_product = 0, $fk_entrepot = 0, $objectLines = array())
{
global $conf, $langs;
dol_syslog(get_class($this)."::selectLotDataList $htmlname, $empty, $fk_product, $fk_entrepot,$objectLines", LOG_DEBUG);
dol_syslog(get_class($this)."::selectLotDataList $htmlname, $empty, $fk_product, $fk_entrepot", LOG_DEBUG);
$out = '';
$productIdArray = array();
@ -817,7 +815,7 @@ class FormProduct
if (empty($fk_entrepot) || $fk_entrepot == $arraytypes['entrepot_id']) {
$label = $arraytypes['entrepot_label'] . ' - ';
$label .= $arraytypes['batch'];
$out .= '<option>' . $arraytypes['batch'] . '</option>';
$out .= '<option data-warehouse="'.dol_escape_htmltag($label).'">' . $arraytypes['batch'] . '</option>';
}
}
}

View File

@ -574,11 +574,11 @@ if (empty($reshook)) {
if (!empty($object->email) && !isValidEMail($object->email)) {
$langs->load("errors");
$error++;
setEventMessages('', $langs->trans("ErrorBadEMail", $object->email), 'errors');
setEventMessages($langs->trans("ErrorBadEMail", $object->email), null, 'errors');
}
if (!empty($object->url) && !isValidUrl($object->url)) {
$langs->load("errors");
setEventMessages('', $langs->trans("ErrorBadUrl", $object->url), 'errors');
setEventMessages($langs->trans("ErrorBadUrl", $object->url), null, 'errors');
}
if (!empty($object->webservices_url)) {
//Check if has transport, without any the soap client will give error

View File

@ -962,7 +962,7 @@ function getListOfProductsOrServices($authentication, $filterproduct)
* Get list of products for a category
*
* @param array $authentication Array of authentication information
* @param array $id Category id
* @param int $id Category id
* @param Translate $lang Force lang
* @return array Array result
*/