Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 16.0

This commit is contained in:
Laurent Destailleur 2022-09-23 17:31:07 +02:00
commit 2a315a58cd
12 changed files with 19 additions and 10 deletions

View File

@ -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) {

View File

@ -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'))) {

View File

@ -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'))) {

View File

@ -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'))) {

View File

@ -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();

View File

@ -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");
}

View File

@ -251,6 +251,13 @@ foreach ($search as $key => $val) {
$sql .= natural_search('moparent.ref', $search[$key], 0);
continue;
}
if ($key == 'status') {
$sql .= natural_search('t.status', $search[$key], 0);
continue;
}
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {

View File

@ -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'))) {

View File

@ -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);

View File

@ -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'))) {

View File

@ -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) {

View File

@ -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");