From f35fee00813c91c0110297f59aec62637fea6483 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Jan 2022 18:55:49 +0100 Subject: [PATCH 1/4] Prepare 16 dev --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index cc9e50ca52f..e14322a62e9 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '15.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '16.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 7ccb1c94a15ec94d1cae77b78c9929dcba6ec725 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Jan 2022 19:07:05 +0100 Subject: [PATCH 2/4] Fix var not defined --- htdocs/api/class/api_setup.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index d169c8220ec..15a29c0e18b 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1734,6 +1734,8 @@ class Setup extends DolibarrApi { $list = array(); + $limit = 0; + $sql = "SELECT e.rowid, e.rowid as ref, e.label, e.address, e.zip, e.town, e.status"; $sql .= " FROM ".MAIN_DB_PREFIX."establishment as e"; $sql .= " WHERE e.entity IN (".getEntity('establishment').')'; From b6dc7a3f19b91be60a069d485874cd6290666ece Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Jan 2022 19:09:34 +0100 Subject: [PATCH 3/4] Doc --- htdocs/accountancy/class/accountingaccount.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index a42439b1597..eea1814a708 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + /** * Class to manage accounting accounts */ @@ -566,7 +567,7 @@ class AccountingAccount extends CommonObject /** * Information on record * - * @param int $id of record + * @param int $id ID of record * @return void */ public function info($id) From dbc2631d6a262250d39b67bd87f44720d56b76dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Jan 2022 19:19:36 +0100 Subject: [PATCH 4/4] Fix scrutinizer warnings --- htdocs/asset/class/asset_type.class.php | 6 +----- htdocs/compta/facture/class/facture.class.php | 21 +++++++++++-------- .../mailmanspip/class/mailmanspip.class.php | 4 ++-- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index 75b3030eac9..be8643e3f20 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -359,11 +359,7 @@ class AssetType extends CommonObject if (!array_key_exists($obj->rowid, $ret)) { if ($mode < 2) { $assetstatic = new Asset($this->db); - if ($mode == 1) { - $assetstatic->fetch($obj->rowid, '', '', '', false, false); - } else { - $assetstatic->fetch($obj->rowid); - } + $assetstatic->fetch($obj->rowid); $ret[$obj->rowid] = $assetstatic; } else { $ret[$obj->rowid] = $obj->rowid; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ea3b7fb6d01..74d08ddef2a 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5689,22 +5689,25 @@ class FactureLigne extends CommonInvoiceLine } /** - * Delete line in database - * TODO Add param User $user and notrigger (see skeleton) + * Delete line in database * - * @return int <0 if KO, >0 if OK + * @param User $tmpuser User that deletes + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK */ - public function delete() + public function delete($tmpuser = null, $notrigger = false) { global $user; $this->db->begin(); // Call trigger - $result = $this->call_trigger('LINEBILL_DELETE', $user); - if ($result < 0) { - $this->db->rollback(); - return -1; + if (empty($notrigger)) { + $result = $this->call_trigger('LINEBILL_DELETE', $user); + if ($result < 0) { + $this->db->rollback(); + return -1; + } } // End call triggers @@ -5716,7 +5719,7 @@ class FactureLigne extends CommonInvoiceLine } $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".((int) $this->rowid); - dol_syslog(get_class($this)."::delete", LOG_DEBUG); + if ($this->db->query($sql)) { $this->db->commit(); return 1; diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index c5ce2292f6a..1f7e8ea6214 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -278,11 +278,11 @@ class MailmanSpip if ($result) { if ($mydb->num_rows($result)) { // nous avons au moins une reponse - $mydb->close($result); + $mydb->close(); return 1; } else { // nous n'avons pas de reponse => n'existe pas - $mydb->close($result); + $mydb->close(); return 0; } } else {