diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index ecde0faf245..7ca0e431c5a 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -267,7 +267,7 @@ if (empty($reshook)) $search_categ_thirdparty = ''; $search_categ_supplier = ''; $search_import_key = ''; - $toselect = ''; + $toselect = array(); $search_array_options = array(); $search_roles = array(); } diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 7331a9f40a5..abc244ba255 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1308,7 +1308,6 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd $to_affecttag_type_array=array(); $categ_type_array=$categ->getMapList(); foreach($categ_type_array as $categdef) { - if (in_array($categdef['code'], $affecttag_type_array)) { $to_affecttag_type_array[] = $categdef['code']; } @@ -1319,10 +1318,10 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd if (!empty($to_affecttag_type_array)) { foreach ($to_affecttag_type_array as $categ_type) { $contcats = GETPOST('contcats_' . $categ_type, 'array'); -var_dump($toselect);exit; + //var_dump($toselect);exit; foreach ($toselect as $toselectid) { $result = $object->fetch($toselectid); - var_dump($contcats);exit; + //var_dump($contcats);exit; if ($result > 0) { $result = $object->setCategoriesCommon($contcats, $categ_type, false); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 86b8b62fc81..a6b164772ba 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -301,6 +301,7 @@ if (empty($reshook)) $permissiontoread = $user->rights->produit->lire; $permissiontodelete = $user->rights->produit->supprimer; + $permissiontoadd = $user->rights->{$rightskey}->creer; $uploaddir = $conf->product->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -533,6 +534,7 @@ if ($resql) $rightskey = 'produit'; if ($type == Product::TYPE_SERVICE) $rightskey = 'service'; if ($user->rights->{$rightskey}->supprimer) $arrayofmassactions['predelete'] = "".$langs->trans("Delete"); + if ($user->rights->{$rightskey}->creer) $arrayofmassactions['preaffecttag'] = ''.$langs->trans("AffectTag"); if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 3e486fb0c70..6c43f7e7c6e 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -648,7 +648,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); -$arrayofselected = array(); +$arrayofselected = is_array($toselect) ? $toselect : array(); while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql);