From 787f4234488295d804283be05a9aa1349de30a73 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jun 2012 23:11:46 +0200 Subject: [PATCH] Fix: Removed warning. Fix compatibility. --- htdocs/core/class/commonobject.class.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 551b3612232..e5571e70464 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2283,6 +2283,9 @@ abstract class CommonObject if ($objecttype == 'member') { $classpath = 'adherents/class'; $module='adherent'; $subelement='adherent'; } + if ($objecttype == 'cabinetmed_cons') { + $classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons'; + } //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement; @@ -2294,13 +2297,15 @@ abstract class CommonObject $classfile = 'fournisseur.commande'; $classname='CommandeFournisseur'; } - if ($conf->$module->enabled) + if (! empty($conf->$module->enabled)) { - dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); - - $object = new $classname($this->db); - $ret=$object->fetch($objectid); - if ($ret > 0) return $object->getNomUrl($withpicto,$option); + $res=dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); + if ($res) + { + $object = new $classname($this->db); + $ret=$object->fetch($objectid); + if ($ret > 0) return $object->getNomUrl($withpicto,$option); + } } }