From cff0c2c339bc10edf65a8dc0625a8392ac01be79 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 24 Dec 2010 11:19:24 +0000 Subject: [PATCH] Fix: try to use $GLOBALS in template --- htdocs/commande/tpl/linkedobjectblock.tpl.php | 8 ++++++++ htdocs/core/class/commonobject.class.php | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 0c7f61b1082..1bd4440bf6a 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -22,9 +22,17 @@ linkedObjectBlock; +$objectid = $GLOBALS['object']->objectid; +$num = count($objectid); + $langs->load("orders"); if ($somethingshown) { echo '
'; } print_titre($langs->trans('RelatedOrders')); + ?> diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5240a60eb42..a035b0aa1f6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -34,6 +34,9 @@ class CommonObject { var $db; + + var $linkedObjectBlock; + var $objectid; // Instantiate hook classe of thirdparty module var $hooks=array(); @@ -1355,8 +1358,10 @@ class CommonObject global $langs,$bc; //print 'objecttype='.$objecttype.'
'; + + $this->objectid = $objectid; - $num = sizeof($objectid); + $num = sizeof($this->objectid); if ($num) { $classpath = $objecttype.'/class'; @@ -1374,7 +1379,7 @@ class CommonObject { dol_include_once("/".$classpath."/".$classfile.".class.php"); } - $linkedObjectBlock = new $classname($this->db); + $this->linkedObjectBlock = new $classname($this->db); dol_include_once('/'.$tplpath.'/tpl/linkedobjectblock.tpl.php'); return $num;