diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 30412f2b9ae..5620d56f60f 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -611,7 +611,7 @@ if ($user->rights->adherent->creer) { if ($user->rights->adherent->supprimer) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if ($user->rights->societe->creer) { +if (isModEnabled('category') && $user->rights->adherent->creer) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } if ($user->rights->adherent->creer && $user->rights->user->user->creer) { diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index dd877e903e4..b5ec104d02f 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -398,7 +398,7 @@ $arrayofmassactions = array( if ($user->rights->agenda->allactions->delete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if ($user->rights->agenda->myactions->create) { +if (isModEnabled('category') && $user->rights->agenda->myactions->create) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 362ca3d488f..5c1472bc6fb 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -303,7 +303,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if ($user->rights->banque->modifier) { +if (isModEnabled('category') && $user->rights->banque->modifier) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) { diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index d41b6829bb2..1a2dac09da3 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -691,7 +691,7 @@ $arrayofmassactions = array( if ($user->rights->societe->supprimer) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if ($user->rights->societe->creer) { +if (isModEnabled('category') && $user->rights->societe->creer) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) { diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 678bf219bef..656b5b263aa 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -40,7 +40,7 @@ if ($massaction == 'predelete') { print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeletion"), $langs->trans("ConfirmMassDeletionQuestion", count($toselect)), "delete", null, '', 0, 200, 500, 1); } -if ($massaction == 'preaffecttag') { +if ($massaction == 'preaffecttag' && isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categ = new Categorie($db); $categ_types = array(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 18ec0d67738..f9d9c47f103 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -427,7 +427,7 @@ if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if ($user->rights->knowledgemanagement->knowledgerecord->write) { +if (isModEnabled('category') && $user->rights->knowledgemanagement->knowledgerecord->write) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 1464456cd6d..642e22d8b02 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -738,6 +738,8 @@ if ($resql) { if ($user->rights->{$rightskey}->creer) { $arrayofmassactions['switchonsalestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnSaleStatus"); $arrayofmassactions['switchonpurchasestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnPurchaseStatus"); + } + if (isModEnabled('category') && $user->rights->{$rightskey}->creer) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } if (in_array($massaction, array('presend', 'predelete','preaffecttag', 'edit_extrafields'))) { diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 4271ac5d8c2..687577af52e 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -382,7 +382,7 @@ $arrayofmassactions = array( if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { $arrayofmassactions = array(); } -if ($user->rights->stock->creer) { +if (isModEnabled('category') && $user->rights->stock->creer) { $arrayofmassactions['preaffecttag'] = img_picto('', 'label', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index a729112353f..8fa6c0ec2e5 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -764,7 +764,7 @@ if ($user->rights->projet->creer) { if ($user->rights->projet->supprimer) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if ($user->rights->projet->creer) { +if (isModEnabled('category') && $user->rights->projet->creer) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } if (in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 18999ed9a1f..1222e9f7ffc 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -873,7 +873,7 @@ $arrayofmassactions = array( //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); //if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); -if ($user->rights->societe->creer) { +if (isModEnabled('category') && $user->rights->societe->creer) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } if ($user->rights->societe->creer) { diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 53eed056695..8642c569752 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -585,7 +585,7 @@ if ($permissiontoadd) { if ($permissiontoadd) { $arrayofmassactions['reactivate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Reactivate"); } -if ($permissiontoadd) { +if (isModEnabled('category') && $permissiontoadd) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } //if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");