diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index efee824c092..9c93fa8fe89 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -82,7 +82,7 @@ function societe_prepare_head(Societe $object)
$h++;
}
//show categorie tab
- if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
+ /*if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$type = Categorie::TYPE_CUSTOMER;
@@ -91,7 +91,7 @@ function societe_prepare_head(Societe $object)
$head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category';
$h++;
- }
+ }*/
// Tab to link resources
if ($conf->resource->enabled && ! empty($conf->global->RESOURCE_ON_THIRDPARTIES))
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index 2e73fdf22dd..810055da1f1 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -1229,11 +1229,14 @@ else
}
// Categories
- print '
| '.$langs->trans("Categories").' | ';
- $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1);
- print $form->multiselectarray('custcats', $cate_arbo, GETPOST( 'custcats', 'array' ), null, null, null, null, 250);
- print " |
";
-
+ if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
+ {
+ print '| '.$langs->trans("Categories").' | ';
+ $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1);
+ print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%");
+ print " |
";
+ }
+
// Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
@@ -1736,17 +1739,20 @@ else
}
// Categories
- print ' | ';
- print '';
- $cate_arbo = $form->select_all_categories( Categorie::TYPE_CUSTOMER, null, null, null, null, 1 );
- $c = new Categorie( $db );
- $cats = $c->containing( $object->id, Categorie::TYPE_CUSTOMER );
- foreach ($cats as $cat) {
- $arrayselected[] = $cat->id;
- }
- print $form->multiselectarray( 'custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '100%' );
- print " |
";
-
+ if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
+ {
+ print ' | ';
+ print '';
+ $cate_arbo = $form->select_all_categories( Categorie::TYPE_CUSTOMER, null, null, null, null, 1);
+ $c = new Categorie( $db );
+ $cats = $c->containing( $object->id, Categorie::TYPE_CUSTOMER );
+ foreach ($cats as $cat) {
+ $arrayselected[] = $cat->id;
+ }
+ print $form->multiselectarray( 'custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
+ print " |
";
+ }
+
// Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
@@ -2174,11 +2180,14 @@ else
}
// Categories
- print '| ' . $langs->trans( "Categories" ) . ' | ';
- print '';
- print $form->showCategories( $object->id, 'customer', 1 );
- print " |
";
-
+ if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
+ {
+ print '| ' . $langs->trans( "Categories" ) . ' | ';
+ print '';
+ print $form->showCategories( $object->id, 'customer', 1 );
+ print " |
";
+ }
+
// Incoterms
if (!empty($conf->incoterm->enabled))
{