diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php index c327ce0021c..f8c20758be8 100644 --- a/htdocs/commonobject.class.php +++ b/htdocs/commonobject.class.php @@ -401,6 +401,17 @@ class CommonObject $this->adresse = $adresse; return $result; } + + /** + * \brief Read linked document + */ + function fetch_object() + { + $object = $this->origin; + $class = ucfirst($object); + $this->$object = new $class($this->db); + $this->$object->fetch($this->origin_id); + } /** diff --git a/htdocs/expedition/expedition.class.php b/htdocs/expedition/expedition.class.php index adb0a173bba..b13865a456b 100644 --- a/htdocs/expedition/expedition.class.php +++ b/htdocs/expedition/expedition.class.php @@ -624,19 +624,6 @@ class Expedition extends CommonObject } } - - /** - * Lit le document associe - * - */ - function fetch_object() - { - $object = $this->origin; - $class = ucfirst($object); - $this->$object = new $class($this->db); - $this->$object->fetch($this->origin_id); - } - /** * * diff --git a/htdocs/livraison/livraison.class.php b/htdocs/livraison/livraison.class.php index 78b63d61c00..0b57fc47058 100644 --- a/htdocs/livraison/livraison.class.php +++ b/htdocs/livraison/livraison.class.php @@ -617,19 +617,7 @@ class Livraison extends CommonObject } } - - /** - * \brief Read linked document - */ - function fetch_object() - { - $object = $this->origin; - $class = ucfirst($this->origin); - $this->$object = new $class($this->db); - $this->$object->fetch($this->origin_id); - } - - /** + /** * * */