diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index f8b3aa59d66..ad7c1af6e0c 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -243,6 +243,7 @@ class BookKeeping extends CommonObject } if (isset($this->doc_ref)) { $this->doc_ref = trim($this->doc_ref); + $this->doc_ref = dol_trunc($this->doc_ref, 300); // We limit to 300 chars to avoid problems with too long ref in DB } if (isset($this->fk_doc)) { $this->fk_doc = (int) $this->fk_doc; diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index 4b27a958ac4..3a6a8aa0473 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -87,18 +87,10 @@ if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc))) } // To be sure vars is defined - if (empty($hidedetails)) { - $hidedetails = 0; - } - if (empty($hidedesc)) { - $hidedesc = 0; - } - if (empty($hideref)) { - $hideref = 0; - } - if (empty($moreparams)) { - $moreparams = null; - } + $hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); + $hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); + $hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); + $moreparams = isset($moreparams) ? $moreparams : null; $result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); if ($result <= 0) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 9557282bbad..ff8b38693f6 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -34,6 +34,7 @@ // $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined // $uploaddir may be defined (example to $conf->project->dir_output."/";) +// $hidedetails, $hidedesc, $hideref and $moreparams may have been set or not. // $toselect may be defined // $diroutputmassaction may be defined // $confirm @@ -1082,11 +1083,12 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) { } $model = $objecttmp->model_pdf; $ret = $objecttmp->fetch($objecttmp->id); // Reload to get new records + // To be sure vars is defined - $hidedetails = !empty($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); - $hidedesc = !empty($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); - $hideref = !empty($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); - $moreparams = !empty($moreparams) ? $moreparams : null; + $hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); + $hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); + $hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); + $moreparams = isset($moreparams) ? $moreparams : null; $result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { @@ -1246,18 +1248,10 @@ EOPHAN; } // To be sure vars is defined - if (empty($hidedetails)) { - $hidedetails = (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); - } - if (empty($hidedesc)) { - $hidedesc = (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); - } - if (empty($hideref)) { - $hideref = (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); - } - if (empty($moreparams)) { - $moreparams = null; - } + $hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); + $hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); + $hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); + $moreparams = isset($moreparams) ? $moreparams : null; $result = $objecttmp->generateDocument($objecttmp->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 54c3de7f579..4b1bb5c5ba1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6188,8 +6188,8 @@ class Form $formconfirm .= ' resizable: false, - height: \'' . ((int) $height) . '\', - width: \'' . ((int) $width) . '\', + height: \'' . dol_escape_js($height) . '\', + width: \'' . dol_escape_js($width) . '\', modal: true, closeOnEscape: false, buttons: { diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 343009af969..f8da3efa128 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -426,7 +426,6 @@ class Export } break; case 'Duree': - break; case 'Numeric': // if there is a signe + if (strpos($ValueField, "+") > 0) { @@ -649,7 +648,6 @@ class Export $szMsg = $langs->trans('ExportDateFilter'); break; case 'Duree': - break; case 'Numeric': $szMsg = $langs->trans('ExportNumericFilter'); break; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 14eaad6fcab..3bc9a292652 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -631,7 +631,7 @@ class Reception extends CommonObject if ($qty == 0 || ($qty < 0 && !getDolGlobalInt('RECEPTION_ALLOW_NEGATIVE_QTY'))) { continue; } - dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); + dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid); //var_dump($this->lines[$i]); $mouvS = new MouvementStock($this->db); @@ -2038,11 +2038,7 @@ class Reception extends CommonObject $qty = $obj->qty; - - if ($qty <= 0) { - continue; - } - dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); + dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid); //var_dump($this->lines[$i]); $mouvS = new MouvementStock($this->db); diff --git a/htdocs/salaries/class/api_salaries.class.php b/htdocs/salaries/class/api_salaries.class.php index 4d1171ce34d..d4a047384e4 100644 --- a/htdocs/salaries/class/api_salaries.class.php +++ b/htdocs/salaries/class/api_salaries.class.php @@ -363,7 +363,7 @@ class Salaries extends DolibarrApi * @phpstan-param ?array $request_data * @return Object PaymentSalary object * - * @url POST {id}/payments + * @url PUT {id}/payments * * @throws RestException */