Fix: try to use $GLOBALS in template

This commit is contained in:
Regis Houssin 2010-12-24 11:19:24 +00:00
parent 9637d10597
commit cff0c2c339
2 changed files with 15 additions and 2 deletions

View File

@ -22,9 +22,17 @@
<!-- BEGIN PHP TEMPLATE --> <!-- BEGIN PHP TEMPLATE -->
<?php <?php
$langs = $GLOBALS['langs'];
$somethingshown = $GLOBALS['somethingshown'];
$linkedObjectBlock = $GLOBALS['object']->linkedObjectBlock;
$objectid = $GLOBALS['object']->objectid;
$num = count($objectid);
$langs->load("orders"); $langs->load("orders");
if ($somethingshown) { echo '<br>'; } if ($somethingshown) { echo '<br>'; }
print_titre($langs->trans('RelatedOrders')); print_titre($langs->trans('RelatedOrders'));
?> ?>
<table class="noborder" width="100%"> <table class="noborder" width="100%">
<tr class="liste_titre"> <tr class="liste_titre">

View File

@ -34,6 +34,9 @@
class CommonObject class CommonObject
{ {
var $db; var $db;
var $linkedObjectBlock;
var $objectid;
// Instantiate hook classe of thirdparty module // Instantiate hook classe of thirdparty module
var $hooks=array(); var $hooks=array();
@ -1355,8 +1358,10 @@ class CommonObject
global $langs,$bc; global $langs,$bc;
//print 'objecttype='.$objecttype.'<br>'; //print 'objecttype='.$objecttype.'<br>';
$this->objectid = $objectid;
$num = sizeof($objectid); $num = sizeof($this->objectid);
if ($num) if ($num)
{ {
$classpath = $objecttype.'/class'; $classpath = $objecttype.'/class';
@ -1374,7 +1379,7 @@ class CommonObject
{ {
dol_include_once("/".$classpath."/".$classfile.".class.php"); 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'); dol_include_once('/'.$tplpath.'/tpl/linkedobjectblock.tpl.php');
return $num; return $num;