From ee737191fac39b2542782399bb03f1ee8e716021 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 19 Mar 2023 12:27:54 +0100 Subject: [PATCH] Massaction delete for cash control list --- htdocs/compta/cashcontrol/cashcontrol_list.php | 18 ++++++------------ htdocs/compta/sociales/list.php | 10 +++++----- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 41aa42195dc..a050cf7ffec 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -178,8 +178,8 @@ if (empty($reshook)) { // Mass actions $objectclass = 'CashControl'; $objectlabel = 'CashControl'; - //$uploaddir = ''; - //include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + $uploaddir = $conf->bank->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -376,15 +376,9 @@ $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $param .= $hookmanager->resPrint; // List of mass actions available -$arrayofmassactions = array( -//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), -//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), -); -//if ($permissiontodelete) { -// $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); -//} -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { - $arrayofmassactions = array(); +$arrayofmassactions = array(); +if (!empty($permissiontodelete)) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); @@ -585,7 +579,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $object->cheque = $obj->cheque; - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == (min($num, $limit) - 1)) { print ''; print ''; diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index b97df2b24bf..ed92d834488 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -641,7 +641,7 @@ while ($i < $imaxinloop) { } // Output Kanban $chargesociale_static->fk_project = $projectstatic->getNomUrl(); - print $chargesociale_static->getKanbanView(''); + print $chargesociale_static->getKanbanView('', array('selected' => in_array($chargesociale_static->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print ''; print ''; @@ -655,10 +655,10 @@ while ($i < $imaxinloop) { print ''; if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { + if (in_array($chargesociale_static->id, $arrayofselected)) { $selected = 1; } - print ''; + print ''; } print ''; } @@ -807,10 +807,10 @@ while ($i < $imaxinloop) { print ''; if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { + if (in_array($chargesociale_static->id, $arrayofselected)) { $selected = 1; } - print ''; + print ''; } print ''; }