From 2ced3a33df571008a91cbdf5b77d5d7af14098c1 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Fri, 24 May 2024 18:13:00 +0200 Subject: [PATCH] New hook to print tags defined by module in receiptprinter.php (#29748) New hook to print tags defined by module in receipt printer configuration page Co-authored-by: Laurent Destailleur --- htdocs/admin/receiptprinter.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 593f511a41a..9958ff648de 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -4,6 +4,7 @@ * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2020 Andreu Bisquerra Gaya * Copyright (C) 2024 MDW + * Copyright (C) 2024 Abbes Bahfir * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,7 +53,7 @@ $templatename = GETPOST('templatename', 'alpha'); $templateid = GETPOSTINT('templateid'); $printer = new dolReceiptPrinter($db); - +$hookmanager->initHooks(array('receiptPrinter', 'globalcard')); if (!$mode) { $mode = 'config'; } @@ -530,6 +531,10 @@ if ($mode == 'template' && $user->admin) { print '{'.$key.'}'.$langs->trans($val).''; print ''; } + $reshook = $hookmanager->executeHooks('listReceiptPrinterTags', array(), $printer, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } print ''; print ''; }