NEW : Add the possibility to merge PDF from the product list (#33723)

This commit is contained in:
atm-adrien 2025-04-04 18:14:26 +02:00 committed by GitHub
parent 275a994110
commit 36b90df84c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,6 +49,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (isModEnabled('workstation')) {
require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php';
@ -173,6 +175,8 @@ $extrafields = new ExtraFields($db);
$form = new Form($db);
$formcompany = new FormCompany($db);
$formproduct = new FormProduct($db);
$formfile = new FormFile($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@ -891,7 +895,7 @@ $param .= $hookmanager->resPrint;
$arrayofmassactions = array(
'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
'edit_extrafields' => img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("ModifyValueExtrafields"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
);
if ($user->hasRight($rightskey, 'creer')) {
@ -2388,6 +2392,24 @@ print '</div>'."\n";
print '</form>'."\n";
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
}
// Show list of available documents
$urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource .= str_replace('&amp;', '&', $param);
$filedir = $diroutputmassaction;
$genallowed = $user->hasRight('product', 'lire');
$delallowed = $user->hasRight('product', 'creer');
$formfile = new FormFile($db);
print $formfile->showdocuments('massfilesarea_product', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
// End of page
llxFooter();
$db->close();