From 2031989a0a25458078ff3bd523dd045a95ce0a0b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 1 Jun 2011 05:48:52 +0000 Subject: [PATCH] Fix: missing globals --- htdocs/core/class/canvas.class.php | 13 ++++--------- htdocs/societe/canvas/default/tpl/card_view.tpl.php | 6 +++--- .../societe/canvas/individual/tpl/card_view.tpl.php | 6 +++--- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index 3607dd8dd73..88d13ec471a 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011 Laurent Destailleur +/* Copyright (C) 2010-2011 Regis Houssin + * Copyright (C) 2011 Laurent Destailleur * * 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 @@ -121,12 +121,6 @@ class Canvas $this->control->object = new $modelclassname($this->db); } - // Include specific library - /* Removed because specific libraries must be included by files that need them only, so by actions and/or dao files. - $libfile = dol_buildpath('/'.$dirmodule.'/lib/'.$dirmodule.'.lib.php'); - if (file_exists($libfile)) require_once($libfile); - */ - // Template dir $this->template_dir = dol_buildpath('/'.$dirmodule.'/canvas/'.$this->canvas.'/tpl/'); if (! is_dir($this->template_dir)) @@ -238,7 +232,8 @@ class Canvas */ function display_canvas($mode='view') { - global $conf, $langs, $user, $canvas; + global $db, $conf, $langs, $user, $canvas; + global $form, $formfile; //print $this->template_dir.$this->card.'_'.$mode.'.tpl.php';exit; include($this->template_dir.$this->card.'_'.$mode.'.tpl.php'); // Include native PHP template diff --git a/htdocs/societe/canvas/default/tpl/card_view.tpl.php b/htdocs/societe/canvas/default/tpl/card_view.tpl.php index 35d425b26d4..31688e7e61c 100644 --- a/htdocs/societe/canvas/default/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/default/tpl/card_view.tpl.php @@ -282,13 +282,13 @@ $somethingshown=$formfile->show_documents('company',$socid,$filedir,$urlsource,$ control->object); +$result=show_subsidiaries($conf,$langs,$db,$soc); // Contacts list -$result=show_contacts($conf,$langs,$db,$objcanvas->control->object); +$result=show_contacts($conf,$langs,$db,$soc); // Projects list -$result=show_projects($conf,$langs,$db,$objcanvas->control->object); +$result=show_projects($conf,$langs,$db,$soc); ?> \ No newline at end of file diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 4b11e1db9ed..fb20dfd4038 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -223,13 +223,13 @@ $somethingshown=$formfile->show_documents('company',$socid,$filedir,$urlsource,$ control->object); +$result=show_subsidiaries($conf,$langs,$db,$soc); // Contacts list -$result=show_contacts($conf,$langs,$db,$objcanvas->control->object); +$result=show_contacts($conf,$langs,$db,$soc); // Projects list -$result=show_projects($conf,$langs,$db,$objcanvas->control->object); +$result=show_projects($conf,$langs,$db,$soc); ?> \ No newline at end of file