From 061f4623b3cc8ce593c97a8ae6c4fe2333514e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Apr 2020 23:53:00 +0200 Subject: [PATCH] remove deprecated libelle --- htdocs/product/stock/class/entrepot.class.php | 21 +++++++++++-------- htdocs/product/stock/movement_card.php | 1 - htdocs/product/stock/movement_list.php | 1 - htdocs/product/stock/product.php | 1 - 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 3dd22c9e5c3..c09c8932401 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2008 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2016 Francis Appels - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2020 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 @@ -48,7 +48,11 @@ class Entrepot extends CommonObject * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ public $picto = 'stock'; - public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + /** + * @var int 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + */ + public $ismultientitymanaged = 1; /** * @var string Label @@ -184,11 +188,10 @@ class Entrepot extends CommonObject $error = 0; - $this->libelle = trim($this->libelle); + $this->label = !empty($this->label) ? trim($this->label) : trim($this->libelle); - // Si libelle non defini, erreur - if ($this->libelle == '') - { + // Error if label not defined + if ($this->label == '') { $this->error = "ErrorFieldRequired"; return 0; } @@ -198,7 +201,7 @@ class Entrepot extends CommonObject $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent)"; - $sql .= " VALUES ('".$this->db->escape($this->libelle)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")"; + $sql .= " VALUES ('".$this->db->escape($this->label)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); $result = $this->db->query($sql); @@ -285,7 +288,7 @@ class Entrepot extends CommonObject } } - $this->libelle = trim($this->libelle); + $this->label = !empty($this->label) ? trim($this->label) : trim($this->libelle); $this->description = trim($this->description); $this->lieu = trim($this->lieu); @@ -296,7 +299,7 @@ class Entrepot extends CommonObject $this->country_id = ($this->country_id > 0 ? $this->country_id : 0); $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; - $sql .= " SET ref = '".$this->db->escape($this->libelle)."'"; + $sql .= " SET ref = '".$this->db->escape($this->label)."'"; $sql .= ", fk_parent = ".(($this->fk_parent > 0) ? $this->fk_parent : "NULL"); $sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", statut = ".$this->statut; diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 2714740eb45..7e7aa53cd08 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -975,7 +975,6 @@ if ($resql) $productlot->sellby = $objp->sellby; $warehousestatic->id = $objp->entrepot_id; - $warehousestatic->libelle = $objp->warehouse_ref; // deprecated $warehousestatic->label = $objp->warehouse_ref; $warehousestatic->lieu = $objp->lieu; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 944462ccdfc..de12c018f20 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1012,7 +1012,6 @@ if ($resql) $warehousestatic->id = $objp->entrepot_id; $warehousestatic->ref = $objp->warehouse_ref; - $warehousestatic->libelle = $objp->warehouse_ref; // deprecated $warehousestatic->label = $objp->warehouse_ref; $warehousestatic->lieu = $objp->lieu; $warehousestatic->fk_parent = $objp->fk_parent; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 0164f6338e6..e188ab368f7 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -866,7 +866,6 @@ if (!$variants) { $entrepotstatic->id = $obj->rowid; $entrepotstatic->ref = $obj->ref; - $entrepotstatic->libelle = $obj->ref; $entrepotstatic->label = $obj->ref; $entrepotstatic->lieu = $obj->lieu; $entrepotstatic->fk_parent = $obj->fk_parent;