diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index b29ea95e91c..edefb3ea6d1 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -705,7 +705,7 @@ if (empty($reshook)) { $ret = $object->fetch($id); // Reload to get new records $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index fee7edd589d..16046938f71 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1169,7 +1169,7 @@ class Commande extends CommonOrder $this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object } } else { - dol_print_error($this->db, $resqlcontact); + dol_print_error($this->db); } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 60b8914df52..134ddec5a2c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -821,7 +821,7 @@ class Facture extends CommonInvoice $this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object } } else { - dol_print_error($this->db, $resqlcontact); + dol_print_error($this->db); } } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 2cb01a94a92..5d1c22c3b97 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1159,7 +1159,7 @@ class Contrat extends CommonObject $this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object } } else { - dol_print_error($this->db, $resqlcontact); + dol_print_error($this->db); } } } diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index 5f27c2a9091..8a79f3c61f9 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2014 Laurent Destailleur + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,7 +72,7 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel', } if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6a2fc47fccf..c356d8253fa 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4093,7 +4093,7 @@ class Form 'type' => $outtype, 'duration_value' => $outdurationvalue, 'duration_unit' => $outdurationunit, - 'disabled' => (empty($objp->idprodfournprice) ? true : false), + 'disabled' => empty($objp->idprodfournprice), 'description' => $objp->description ); if (isModEnabled('multicurrency')) { diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index b3eb32f5011..0d7bda4986d 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -6,6 +6,7 @@ * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Claudio Aschieri + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -165,7 +166,7 @@ if ($action == 'add' && $permissiontoadd) { $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 25fa25175ac..897e5deb745 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -506,7 +506,7 @@ if (empty($reshook)) { $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 3deba722d03..8b372e70b3a 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2012-2016 Marcos García * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Ion Agorria - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Joachim Kueter @@ -884,7 +884,7 @@ if (empty($reshook)) { $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } @@ -975,7 +975,7 @@ if (empty($reshook)) { $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { $error++; - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } } else { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index afe418a6c60..d7142013586 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -260,7 +260,7 @@ if (empty($reshook)) { $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } } @@ -1833,7 +1833,7 @@ if (empty($reshook)) { $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } @@ -1933,7 +1933,7 @@ if (empty($reshook)) { $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } @@ -1978,7 +1978,7 @@ if (empty($reshook)) { $object->fetch_thirdparty(); $result = $object->update_price(0, (($calculationrule == 'totalofround') ? '0' : '1'), 0, $object->thirdparty); if ($result <= 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); exit; } } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 1dc7214db42..0d2ee13eacc 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -462,7 +462,7 @@ if (empty($reshook)) { $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } } @@ -509,7 +509,7 @@ if (empty($reshook)) { $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 6b6c9498115..1111c5c0706 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -10,7 +10,7 @@ * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2024 Alexandre Spangaro @@ -483,7 +483,7 @@ if (empty($reshook)) { $ret = $object->fetch($id); // Reload to get new records $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } @@ -893,7 +893,7 @@ if (empty($reshook)) { $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index d45f3beaf9c..73437dd34af 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -102,7 +102,7 @@ parameters: - '#( |::)((multi)?selectarray)\(\) expects array#' - '# (reWriteAllMenus|check_authentication) expects array#' - '#::(_validateMyObject|select_company)\(\) expects array