diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index bc831baeddf..4084967a7c6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3015,6 +3015,8 @@ class Form global $langs; $langs->load("categories"); + include_once DOL_DOCUMENT_ROOT.'/categories/class.categorie.class.php'; + $cat = new Categorie($this->db); $cate_arbo = $cat->get_full_arbo($type,$excludeafterid); @@ -4673,6 +4675,8 @@ class Form { global $db; + include_once DOL_DOCUMENT_ROOT.'/categories/class.categorie.class.php'; + $cat = new Categorie($db); $categories = $cat->containing($id, $type); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 5a1f38806bb..55993221d41 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -264,10 +264,13 @@ if ($object->id > 0) print ''; // Categories - print '' . $langs->trans("Categories") . ''; - print ''; - print $form->showCategories($object->id, 'supplier', 1); - print ""; + if (! empty($conf->categorie->enabled)) + { + print '' . $langs->trans("Categories") . ''; + print ''; + print $form->showCategories($object->id, 'supplier', 1); + print ""; + } // Other attributes $parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');