From c177497d8a6220174c4e99ecae4a0307207f9649 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Tue, 2 Jan 2024 12:47:10 +0100 Subject: [PATCH] #1637 [List] add: mass action archive --- core/tpl/digiquali_control_list.tpl.php | 7 +++++-- view/control/control_list.php | 3 +++ view/question/question_list.php | 17 +++++++++++++---- view/sheet/sheet_list.php | 9 ++++++++- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/core/tpl/digiquali_control_list.tpl.php b/core/tpl/digiquali_control_list.tpl.php index d9171267..2659a101 100644 --- a/core/tpl/digiquali_control_list.tpl.php +++ b/core/tpl/digiquali_control_list.tpl.php @@ -194,8 +194,7 @@ $param .= $hookmanager->resPrint; // List of mass actions available -$arrayofmassactions = array( -); +$arrayofmassactions = ['prearchive' => '' . $langs->trans('Archive')]; if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); @@ -218,6 +217,10 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); +if ($massaction == 'prearchive') { + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('ConfirmMassArchive'), $langs->trans('ConfirmMassArchivingQuestion', count($toselect)), 'archive', null, '', 0, 200, 500, 1); +} + // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendControlRef"; $modelmail = "control"; diff --git a/view/control/control_list.php b/view/control/control_list.php index 8400d756..fa2c6e37 100644 --- a/view/control/control_list.php +++ b/view/control/control_list.php @@ -303,6 +303,9 @@ } // include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; + + // Mass actions archive + require_once __DIR__ . '/../../../saturne/core/tpl/actions/list_massactions.tpl.php'; } /* diff --git a/view/question/question_list.php b/view/question/question_list.php index e9f3cfea..dabaf72d 100644 --- a/view/question/question_list.php +++ b/view/question/question_list.php @@ -253,6 +253,9 @@ $db->rollback(); } } + + // Mass actions archive + require_once __DIR__ . '/../../../saturne/core/tpl/actions/list_massactions.tpl.php'; } /* @@ -376,10 +379,8 @@ $param .= $hookmanager->resPrint; // List of mass actions available -$arrayofmassactions = array( - 'lock'=>$langs->trans("Lock"), -); - +$arrayofmassactions['prelock'] = '' . $langs->trans('Lock'); +$arrayofmassactions['prearchive'] = '' . $langs->trans('Archive'); if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = []; $massactionbutton = $form->selectMassAction('', $arrayofmassactions); @@ -397,6 +398,14 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); +if ($massaction == 'prelock') { + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('ConfirmMassLock'), $langs->trans('ConfirmMassLockingQuestion', count($toselect)), 'lock', null, '', 0, 200, 500, 1); +} + +if ($massaction == 'prearchive') { + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('ConfirmMassArchive'), $langs->trans('ConfirmMassArchivingQuestion', count($toselect)), 'archive', null, '', 0, 200, 500, 1); +} + include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($searchAll) { diff --git a/view/sheet/sheet_list.php b/view/sheet/sheet_list.php index ab164fb6..f800b16b 100644 --- a/view/sheet/sheet_list.php +++ b/view/sheet/sheet_list.php @@ -224,6 +224,9 @@ $db->rollback(); } } + + // Mass actions archive + require_once __DIR__ . '/../../../saturne/core/tpl/actions/list_massactions.tpl.php'; } /* @@ -344,7 +347,7 @@ $param .= $hookmanager->resPrint; // List of mass actions available -$arrayofmassactions = array(); +$arrayofmassactions = ['prearchive' => '' . $langs->trans('Archive')]; if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); @@ -362,6 +365,10 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); +if ($massaction == 'prearchive') { + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('ConfirmMassArchive'), $langs->trans('ConfirmMassArchivingQuestion', count($toselect)), 'archive', null, '', 0, 200, 500, 1); +} + // Add code for pre mass action (confirmation or email presend form) include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';