diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 297dc3f7de5..b97df2b24bf 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -45,6 +45,7 @@ $langs->loadLangs(array('compta', 'banks', 'bills', 'hrm', 'projects')); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist'; $mode = GETPOST('mode', 'alpha'); @@ -126,6 +127,7 @@ if ($user->socid) { $socid = $user->socid; } $result = restrictedArea($user, 'tax', '', 'chargesociales', 'charges'); +$permissiontodelete = $user->rights->tax->charges->supprimer; /* @@ -170,7 +172,14 @@ if (empty($reshook)) { $search_type = ''; $search_account = ''; $search_array_options = array(); + $toselect = array(); } + + // Mass actions + $objectclass = 'ChargeSociales'; + $objectlabel = 'ChargeSociales'; + $uploaddir = $conf->tax->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } /* @@ -188,6 +197,8 @@ if (isModEnabled('project')) { llxHeader('', $langs->trans("SocialContributions")); +$arrayofselected = is_array($toselect) ? $toselect : array(); + $sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,"; $sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,"; if (isModEnabled('project')) { @@ -378,6 +389,15 @@ if ($user->rights->tax->charges->creer) { $newcardbutton .= dolGetButtonTitle($langs->trans('MenuNewSocialContribution'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/sociales/card.php?action=create'); } + +// List of mass actions available +$arrayofmassactions = array(); +if (!empty($permissiontodelete)) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); +$moreforfilter = ''; + print '