From 18c5c586abb9a5213a55055c9775ce7b665f1153 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 1 May 2019 09:38:27 +0200 Subject: [PATCH] Cleanup set_draft in syslog --- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 23 +++++++++---------- .../fourn/class/fournisseur.facture.class.php | 6 ++--- htdocs/reception/class/reception.class.php | 4 +--- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 35cb8335232..38a38d45b12 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -499,7 +499,7 @@ class Commande extends CommonOrder return -1; } - dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); + dol_syslog(__METHOD__, LOG_DEBUG); $this->db->begin(); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index c2dc89c903e..7483d527f4d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2532,7 +2532,6 @@ class Facture extends CommonInvoice return true; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Set draft status * @@ -2540,7 +2539,7 @@ class Facture extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - public function setDraft($user, $idwarehouse = -1) + public function setDraft($user, $idwarehouse = -1) { // phpcs:enable global $conf,$langs; @@ -2549,11 +2548,11 @@ class Facture extends CommonInvoice if ($this->statut == self::STATUS_DRAFT) { - dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING); + dol_syslog(__METHOD__." already draft status", LOG_WARNING); return 0; } - dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); + dol_syslog(__METHOD__, LOG_DEBUG); $this->db->begin(); @@ -2564,10 +2563,10 @@ class Facture extends CommonInvoice $result=$this->db->query($sql); if ($result) { - if (! $error) - { - $this->oldcopy= clone $this; - } + if (! $error) + { + $this->oldcopy= clone $this; + } // Si on decremente le produit principal et ses composants a la validation de facture, on réincrement if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) @@ -2595,15 +2594,15 @@ class Facture extends CommonInvoice $this->brouillon = 1; $this->statut = self::STATUS_DRAFT; - // Call trigger - $result=$this->call_trigger('BILL_UNVALIDATE', $user); - if ($result < 0) + // Call trigger + $result=$this->call_trigger('BILL_UNVALIDATE', $user); + if ($result < 0) { $error++; $this->statut=$old_statut; $this->brouillon=0; } - // End call triggers + // End call triggers } else { $this->db->rollback(); return -1; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index bf517f85c64..d9c6781e74d 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1474,8 +1474,6 @@ class FactureFournisseur extends CommonInvoice } } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Set draft status * @@ -1492,11 +1490,11 @@ class FactureFournisseur extends CommonInvoice if ($this->statut == self::STATUS_DRAFT) { - dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING); + dol_syslog(__METHOD__." already draft status", LOG_WARNING); return 0; } - dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); + dol_syslog(__METHOD__, LOG_DEBUG); $this->db->begin(); diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 0b416512ffa..bd45bf45390 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1763,8 +1763,6 @@ class Reception extends CommonObject } } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Set draft status * @@ -1797,7 +1795,7 @@ class Reception extends CommonObject $sql.= " SET fk_statut = ".self::STATUS_DRAFT; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); + dol_syslog(__METHOD__, LOG_DEBUG); if ($this->db->query($sql)) { // If stock increment is done on closing