From 068bc748a8e6768bc122aca2e70ae893bfe79da3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 15 Dec 2009 10:39:22 +0000 Subject: [PATCH] Fix: add code mutualized --- htdocs/commonobject.class.php | 11 +++++++++++ htdocs/expedition/expedition.class.php | 13 ------------- htdocs/livraison/livraison.class.php | 14 +------------- 3 files changed, 12 insertions(+), 26 deletions(-) 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); - } - - /** + /** * * */