Skip to content

Commit

Permalink
Merge pull request #1646 from nicolas-eoxia/add_mass_action_archive
Browse files Browse the repository at this point in the history
#1637 [List] add: mass action archive
  • Loading branch information
nicolas-eoxia authored Jan 3, 2024
2 parents 14d1a03 + c177497 commit 66d70f9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
7 changes: 5 additions & 2 deletions core/tpl/digiquali_control_list.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@
$param .= $hookmanager->resPrint;

// List of mass actions available
$arrayofmassactions = array(
);
$arrayofmassactions = ['prearchive' => '<span class="fas fa-archive paddingrightonly"></span>' . $langs->trans('Archive')];
if ($permissiontodelete) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
Expand All @@ -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";
Expand Down
3 changes: 3 additions & 0 deletions view/control/control_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

/*
Expand Down
17 changes: 13 additions & 4 deletions view/question/question_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@
$db->rollback();
}
}

// Mass actions archive
require_once __DIR__ . '/../../../saturne/core/tpl/actions/list_massactions.tpl.php';
}

/*
Expand Down Expand Up @@ -385,10 +388,8 @@
$param .= $hookmanager->resPrint;

// List of mass actions available
$arrayofmassactions = array(
'lock'=>$langs->trans("Lock"),
);

$arrayofmassactions['prelock'] = '<span class="fas fa-lock paddingrightonly"></span>' . $langs->trans('Lock');
$arrayofmassactions['prearchive'] = '<span class="fas fa-archive paddingrightonly"></span>' . $langs->trans('Archive');
if ($permissiontodelete) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = [];
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
Expand All @@ -406,6 +407,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) {
Expand Down
9 changes: 8 additions & 1 deletion view/sheet/sheet_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@
$db->rollback();
}
}

// Mass actions archive
require_once __DIR__ . '/../../../saturne/core/tpl/actions/list_massactions.tpl.php';
}

/*
Expand Down Expand Up @@ -353,7 +356,7 @@
$param .= $hookmanager->resPrint;

// List of mass actions available
$arrayofmassactions = array();
$arrayofmassactions = ['prearchive' => '<span class="fas fa-archive paddingrightonly"></span>' . $langs->trans('Archive')];
if ($permissiontodelete) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
Expand All @@ -371,6 +374,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';

Expand Down

0 comments on commit 66d70f9

Please sign in to comment.