diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index ed4bf7bdb8b..ac9260d091e 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -401,7 +401,7 @@ $arrayofmassactions = array( if ($user->rights->adherent->creer) $arrayofmassactions['close'] = $langs->trans("Resiliate"); if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); if ($user->rights->societe->creer) $arrayofmassactions['preaffecttag'] = ''.$langs->trans("AffectTag"); -if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $newcardbutton = ''; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index ee0a041aed8..4d863a655b4 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -297,7 +297,7 @@ if ($user->rights->agenda->allactions->delete) { $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) $arrayofmassactions = array(); if ($user->rights->agenda->myactions->create) $arrayofmassactions['preaffecttag'] = ''.$langs->trans("AffectTag"); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index b2d499c5f34..db6c950af4a 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1011,38 +1011,8 @@ class Account extends CommonObject */ public function setCategories($categories) { - // Handle single category - if (!is_array($categories)) { - $categories = array($categories); - } - - // Get current categories require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $c = new Categorie($this->db); - $existing = $c->containing($this->id, Categorie::TYPE_ACCOUNT, 'id'); - - // Diff - if (is_array($existing)) { - $to_del = array_diff($existing, $categories); - $to_add = array_diff($categories, $existing); - } else { - $to_del = array(); // Nothing to delete - $to_add = $categories; - } - - // Process - foreach ($to_del as $del) { - if ($c->fetch($del) > 0) { - $c->del_type($this, Categorie::TYPE_ACCOUNT); - } - } - foreach ($to_add as $add) { - if ($c->fetch($add) > 0) { - $c->add_type($this, Categorie::TYPE_ACCOUNT); - } - } - - return; + return parent::setCategoriesCommon($categories, Categorie::TYPE_ACCOUNT); } /** diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index f3efea15235..1184da6d7ac 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -123,18 +123,26 @@ $parameters = array('socid'=>$socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; -// Purge search criteria -if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers -{ - $search_ref = ''; - $search_label = ''; - $search_number = ''; - $search_status = ''; + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers + { + $search_ref = ''; + $search_label = ''; + $search_number = ''; + $search_status = ''; + } + + // Mass actions + $objectclass = 'Account'; + $objectlabel = 'FinancialAccount'; + $permissiontoadd = $user->rights->banque->modifier; + $uploaddir = $conf->banque->dir_output; + include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; } - /* * View */ @@ -235,7 +243,8 @@ $arrayofmassactions = array( // 'builddoc'=>$langs->trans("PDFMerge"), ); if ($user->rights->banque->supprimer) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); -if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +if ($user->rights->banque->modifier) $arrayofmassactions['preaffecttag'] = ''.$langs->trans("AffectTag"); +if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $newcardbutton = dolGetButtonTitle($langs->trans('NewFinancialAccount'), '', 'fa fa-plus-circle', 'card.php?action=create', '', $user->rights->banque->configurer); @@ -251,7 +260,7 @@ print ''; print ''; print ''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit, 1); $topicmail = "Information"; //$modelmail="subscription"; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 7ca0e431c5a..8d6b11e19f0 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -527,7 +527,7 @@ $arrayofmassactions = array( //if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); if ($user->rights->societe->supprimer) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); if ($user->rights->societe->creer) $arrayofmassactions['preaffecttag'] = ''.$langs->trans("AffectTag"); -if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $newcardbutton = dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create', '', $user->rights->societe->contact->creer); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 3830f0bdafb..b0507a83c19 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -536,7 +536,7 @@ if ($resql) ); 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(); + if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $newcardbutton = ''; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 0ff7cf029c7..1470bdc2aa0 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -346,7 +346,7 @@ $arrayofmassactions = array( //'builddoc'=>$langs->trans("PDFMerge"), ); //if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) $arrayofmassactions = array(); if ($user->rights->stock->creer) $arrayofmassactions['preaffecttag'] = ''.$langs->trans("AffectTag"); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);