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

This commit is contained in:
Laurent Destailleur 2024-04-03 12:25:45 +02:00
commit b9cf6fcf34
9 changed files with 12 additions and 30 deletions

View file

@ -480,6 +480,7 @@ if (empty($reshook)) {
$rang = ($nbOrders > 1) ? -1 : $lines[$i]->rang;
//there may already be rows from previous orders
if (!empty($createbills_onebythird)) {
$TFactThirdNbLines[$cmd->socid]++;
$rang = $TFactThirdNbLines[$cmd->socid];
}
@ -515,9 +516,6 @@ if (empty($reshook)) {
);
if ($result > 0) {
$lineid = $result;
if (!empty($createbills_onebythird)) { //increment rang to keep order
$TFactThirdNbLines[$cmd->socid]++;
}
} else {
$lineid = 0;
$error++;

View file

@ -978,6 +978,9 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options
}
break;
case 'intcomma':
if (is_array($out)) {
$out = implode(',', $out);
}
if (preg_match('/[^0-9,-]+/i', $out)) {
$out = '';
}

View file

@ -996,12 +996,6 @@ class pdf_espadon extends ModelePdfExpedition
}
$pdf->SetDrawColor(128, 128, 128);
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);
}
$posx = $this->page_largeur - $w - $this->marge_droite;
$posy = $this->marge_haute;

View file

@ -906,12 +906,6 @@ class pdf_rouget extends ModelePdfExpedition
}
$pdf->SetDrawColor(128, 128, 128);
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);
}
$posx = $this->page_largeur - $w - $this->marge_droite;
$posy = $this->marge_haute;

View file

@ -906,12 +906,6 @@ class pdf_squille extends ModelePdfReception
}
$pdf->SetDrawColor(128, 128, 128);
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for reception ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);
}
$posx = $this->page_largeur - $w - $this->marge_droite;
$posy = $this->marge_haute;

View file

@ -992,12 +992,6 @@ class pdf_eagle extends ModelePDFStockTransfer
}
$pdf->SetDrawColor(128, 128, 128);
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);
}
$posx = $this->page_largeur - $w - $this->marge_droite;
$posy = $this->marge_haute;

View file

@ -1295,11 +1295,10 @@ class Cronjob extends CommonObject
} else {
$result = call_user_func_array(array($object, $this->methodename), $params_arr);
}
$errmsg = '';
if ($result === false || (!is_bool($result) && $result != 0)) {
$langs->load("errors");
$errmsg = '';
if (!is_array($object->errors) || !in_array($object->error, $object->errors)) {
$errmsg .= $object->error;
}

View file

@ -292,7 +292,7 @@ class TraceableDB extends DoliDB
*/
public function escapeforlike($stringtoencode)
{
return str_replace(array('_', '\\', '%'), array('\_', '\\\\', '\%'), (string) $stringtoencode);
return $this->db->escapeforlike($stringtoencode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps

View file

@ -224,6 +224,9 @@ class UserGroup extends CommonObject
$ret[$obj->rowid] = $newgroup;
}
if (!is_array($ret[$obj->rowid]->usergroup_entity)) {
$ret[$obj->rowid]->usergroup_entity = array();
}
$ret[$obj->rowid]->usergroup_entity[] = $obj->usergroup_entity;
}
@ -299,6 +302,9 @@ class UserGroup extends CommonObject
}
}
if ($mode != 1 && !empty($obj->usergroup_entity)) {
if (!is_array($ret[$obj->rowid]->usergroup_entity)) {
$ret[$obj->rowid]->usergroup_entity = array();
}
$ret[$obj->rowid]->usergroup_entity[] = $obj->usergroup_entity;
}
}