From 5473dbd3f055ea10e218d60b3dd3928912172b6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 28 Nov 2021 20:55:17 +0100 Subject: [PATCH] add direct print for contracts --- htdocs/contrat/card.php | 2 ++ htdocs/core/class/html.formfile.class.php | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 31405545dbb..c52b57e305f 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -916,6 +916,8 @@ if (empty($reshook)) { } } + // Actions when printing a doc from card + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; // Actions to build doc $upload_dir = $conf->contrat->multidir_output[$object->entity]; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7f141d684b7..e30f35758d1 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -442,7 +442,8 @@ class FormFile } $printer = 0; - if (in_array($modulepart, array('facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'delivery', 'ticket'))) { // The direct print feature is implemented only for such elements + // The direct print feature is implemented only for such elements + if (in_array($modulepart, array('contract', 'facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'delivery', 'ticket'))) { $printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled)) ?true:false; } @@ -944,7 +945,7 @@ class FormFile $out .= '">'.img_picto($langs->trans("Delete"), 'delete').''; } if ($printer) { - $out .= ''.img_picto($langs->trans("PrintFile", $relativepath), 'printer.png').''; }