Massaction delete for cash control list

This commit is contained in:
Faustin 2023-03-19 12:27:54 +01:00
parent d67caba300
commit ee737191fa
2 changed files with 11 additions and 17 deletions

View File

@ -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 '</div>';
print '</td></tr>';

View File

@ -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 '</div>';
print '</td></tr>';
@ -655,10 +655,10 @@ while ($i < $imaxinloop) {
print '<td class="center">';
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 '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
print '<input id="cb'.$chargesociale_static->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$chargesociale_static->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
}
@ -807,10 +807,10 @@ while ($i < $imaxinloop) {
print '<td class="center">';
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 '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
print '<input id="cb'.$chargesociale_static->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$chargesociale_static->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
}