Remove useless tab of categories

This commit is contained in:
Laurent Destailleur 2015-06-05 09:57:41 +02:00
parent bbd8a712cf
commit 14b1fb845f
2 changed files with 32 additions and 23 deletions

View File

@ -82,7 +82,7 @@ function societe_prepare_head(Societe $object)
$h++; $h++;
} }
//show categorie tab //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'; require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$type = Categorie::TYPE_CUSTOMER; $type = Categorie::TYPE_CUSTOMER;
@ -91,7 +91,7 @@ function societe_prepare_head(Societe $object)
$head[$h][1] = $langs->trans('Categories'); $head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category'; $head[$h][2] = 'category';
$h++; $h++;
} }*/
// Tab to link resources // Tab to link resources
if ($conf->resource->enabled && ! empty($conf->global->RESOURCE_ON_THIRDPARTIES)) if ($conf->resource->enabled && ! empty($conf->global->RESOURCE_ON_THIRDPARTIES))

View File

@ -1229,10 +1229,13 @@ else
} }
// Categories // Categories
print '<tr><td valign="top">'.$langs->trans("Categories").'</td><td colspan="3">'; if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
print '<tr><td class="toptd">'.$langs->trans("Categories").'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); $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 $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%");
print "</td></tr>"; print "</td></tr>";
}
// Other attributes // Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
@ -1736,16 +1739,19 @@ else
} }
// Categories // Categories
print '<tr><td><label for="custcats">' . $langs->trans( "Categories" ) . '</label></td>'; if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
print '<tr><td><label for="custcats">' . $langs->trans("Categories") . '</label></td>';
print '<td colspan="3">'; print '<td colspan="3">';
$cate_arbo = $form->select_all_categories( Categorie::TYPE_CUSTOMER, null, null, null, null, 1 ); $cate_arbo = $form->select_all_categories( Categorie::TYPE_CUSTOMER, null, null, null, null, 1);
$c = new Categorie( $db ); $c = new Categorie( $db );
$cats = $c->containing( $object->id, Categorie::TYPE_CUSTOMER ); $cats = $c->containing( $object->id, Categorie::TYPE_CUSTOMER );
foreach ($cats as $cat) { foreach ($cats as $cat) {
$arrayselected[] = $cat->id; $arrayselected[] = $cat->id;
} }
print $form->multiselectarray( 'custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '100%' ); print $form->multiselectarray( 'custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
print "</td></tr>"; print "</td></tr>";
}
// Other attributes // Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
@ -2174,10 +2180,13 @@ else
} }
// Categories // Categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
print '<tr><td>' . $langs->trans( "Categories" ) . '</td>'; print '<tr><td>' . $langs->trans( "Categories" ) . '</td>';
print '<td colspan="3">'; print '<td colspan="3">';
print $form->showCategories( $object->id, 'customer', 1 ); print $form->showCategories( $object->id, 'customer', 1 );
print "</td></tr>"; print "</td></tr>";
}
// Incoterms // Incoterms
if (!empty($conf->incoterm->enabled)) if (!empty($conf->incoterm->enabled))