From becc240b92fc04b39db0f1a8f5b30c7857c0f727 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= <rdoursenaud@gpcsolutions.fr>
Date: Sat, 23 May 2015 23:32:12 +0200
Subject: [PATCH] Include Categories class whenever Categorie::TYPE is used

---
 htdocs/adherents/class/adherent.class.php | 1 +
 htdocs/adherents/list.php                 | 1 +
 htdocs/comm/prospect/list.php             | 1 +
 htdocs/compta/stats/cabyprodserv.php      | 1 +
 htdocs/compta/stats/casoc.php             | 1 +
 htdocs/contact/list.php                   | 1 +
 htdocs/core/lib/company.lib.php           | 1 +
 htdocs/core/lib/contact.lib.php           | 1 +
 htdocs/core/lib/member.lib.php            | 1 +
 htdocs/core/lib/product.lib.php           | 1 +
 htdocs/fourn/list.php                     | 1 +
 htdocs/product/composition/card.php       | 1 +
 12 files changed, 12 insertions(+)

diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 99d73dd9cf6..40029d45f84 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -32,6 +32,7 @@
 
 require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
 
 
 /**
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 1e128da7fa7..05035fa1f9f 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -209,6 +209,7 @@ if ($resql)
 	$moreforfilter='';
 	if (! empty($conf->categorie->enabled))
 	{
+		require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
 		$moreforfilter.=$langs->trans('Categories'). ': ';
 		$moreforfilter.=$formother->select_categories(Categorie::TYPE_MEMBER,$search_categ,'search_categ',1);
 		$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php
index 15cb4c32d5c..e807b3fcbc4 100644
--- a/htdocs/comm/prospect/list.php
+++ b/htdocs/comm/prospect/list.php
@@ -299,6 +299,7 @@ if ($resql)
  	$moreforfilter='';
 	if (! empty($conf->categorie->enabled))
 	{
+		require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
 	 	$moreforfilter.=$langs->trans('Categories'). ': ';
 		$moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER,$search_categ,'search_categ',1);
 	 	$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php
index 0ce8c8b0915..4b92ce7eebc 100644
--- a/htdocs/compta/stats/cabyprodserv.php
+++ b/htdocs/compta/stats/cabyprodserv.php
@@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
+require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
 
 $langs->load("products");
 $langs->load("categories");
diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php
index 32a4f8555cc..7b9cfdd7913 100644
--- a/htdocs/compta/stats/casoc.php
+++ b/htdocs/compta/stats/casoc.php
@@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
+require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
 
 $langs->load("companies");
 $langs->load("categories");
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 3d67d63c138..72eee453c9f 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -275,6 +275,7 @@ if ($result)
 
     if (! empty($conf->categorie->enabled))
     {
+		require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
     	$moreforfilter.=$langs->trans('Categories'). ': ';
     	$moreforfilter.=$formother->select_categories(Categorie::TYPE_CONTACT,$search_categ,'search_categ',1);
     	$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index c1c9d9e2311..4eb33852836 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -84,6 +84,7 @@ function societe_prepare_head(Societe $object)
     //show categorie tab
     if (! empty($conf->categorie->enabled)  && ! empty($user->rights->categorie->lire))
     {
+		require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
         $type = Categorie::TYPE_CUSTOMER;
         if ($object->fournisseur) $type = Categorie::TYPE_SUPPLIER;
         $head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$object->id."&type=".$type;
diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php
index 26b0b0c0e5f..3a50b79edd7 100644
--- a/htdocs/core/lib/contact.lib.php
+++ b/htdocs/core/lib/contact.lib.php
@@ -89,6 +89,7 @@ function contact_prepare_head(Contact $object)
 
     if (! empty($conf->categorie->enabled)  && ! empty($user->rights->categorie->lire))
     {
+		require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
     	$type = Categorie::TYPE_CONTACT;
     	$head[$tab][0] = DOL_URL_ROOT.'/categories/categorie.php?id='.$object->id."&type=".$type;
     	$head[$tab][1] = $langs->trans('Categories');
diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php
index e3bc5c236bc..0dbdcf64a86 100644
--- a/htdocs/core/lib/member.lib.php
+++ b/htdocs/core/lib/member.lib.php
@@ -71,6 +71,7 @@ function member_prepare_head(Adherent $object)
 	// Show category tab
 	if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
 	{
+		require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
 		$type = Categorie::TYPE_MEMBER;
 		$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
 		$head[$h][1] = $langs->trans('Categories');
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index f8c3ed12cf6..e6a84657d87 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -61,6 +61,7 @@ function product_prepare_head($object)
 	/* No more required. Replaced with new multiselect component
 	if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire)
 	{
+		require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
 		$type = Categorie::TYPE_PRODUCT;
 		$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
 		$head[$h][1] = $langs->trans('Categories');
diff --git a/htdocs/fourn/list.php b/htdocs/fourn/list.php
index 62985db80b2..8f77ea73115 100644
--- a/htdocs/fourn/list.php
+++ b/htdocs/fourn/list.php
@@ -168,6 +168,7 @@ if ($resql)
 	$moreforfilter='';
 	if (! empty($conf->categorie->enabled))
 	{
+		require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
 		$moreforfilter.=$langs->trans('Categories'). ': ';
 		$moreforfilter.=$htmlother->select_categories(Categorie::TYPE_SUPPLIER,$search_categ,'search_categ',1);
 		$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index 112d6d2d44b..6809e3d3a52 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -473,6 +473,7 @@ if ($id > 0 || ! empty($ref))
 			print '</td></tr>';
 			if (! empty($conf->categorie->enabled))
 			{
+				require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
 				print '<tr><td>'.$langs->trans("CategoryFilter").' &nbsp; </td>';
 				print '<td class="maxwidthonsmartphone">'.$form->select_all_categories(Categorie::TYPE_PRODUCT, $parent).'</td></tr>';
 			}
-- 
GitLab