From 049029689f8c25be1d94b9f5a8ec5b97db45d211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Thu, 17 Nov 2022 14:40:30 +0100 Subject: [PATCH 1/4] Fix: Add Hook on Accountancy List Footer --- htdocs/accountancy/bookkeeping/balance.php | 4 ++++ htdocs/accountancy/bookkeeping/list.php | 6 +++++- htdocs/accountancy/bookkeeping/listbyaccount.php | 4 ++++ htdocs/accountancy/bookkeeping/listbysubaccount.php | 4 ++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 1d210e74d8a..9ca827b5262 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -493,6 +493,10 @@ if ($action != 'export_csv') { print "\n"; print ''; + $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); + $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print ""; print ''; } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 52ac288856b..7bb30c8515b 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1262,6 +1262,10 @@ while ($i < min($num, $limit)) { include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + print ""; print ''; @@ -1276,4 +1280,4 @@ print ''; // End of page llxFooter(); -$db->close(); + $db->close(); \ No newline at end of file diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 27f23d36a74..e5c130a0421 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -951,6 +951,10 @@ if ($num > 0 && $colspan > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + print ""; print ''; diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index 5e83c729fb1..123c4684a5a 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -962,6 +962,10 @@ if ($num > 0 && $colspan > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + print ""; print ''; From 40953db98814cdd9ab5c5c5dfd04173a324a6e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Thu, 17 Nov 2022 15:30:45 +0100 Subject: [PATCH 2/4] Fix: Add also --- htdocs/accountancy/bookkeeping/balance.php | 2 +- htdocs/accountancy/bookkeeping/list.php | 2 +- htdocs/accountancy/bookkeeping/listbyaccount.php | 2 +- htdocs/accountancy/bookkeeping/listbysubaccount.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 9ca827b5262..5f0cd6c74de 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -494,7 +494,7 @@ if ($action != 'export_csv') { print ''; $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print ""; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 7bb30c8515b..a93deb4e911 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1263,7 +1263,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print ""; diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index e5c130a0421..47137eef420 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -952,7 +952,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print ""; diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index 123c4684a5a..d54ff044d15 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -963,7 +963,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print ""; From b4f7dcafcf34813c27235f6797dfbf3f17100dce Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 17 Nov 2022 14:35:43 +0000 Subject: [PATCH 3/4] Fixing style errors. --- htdocs/accountancy/bookkeeping/balance.php | 4 ++-- htdocs/accountancy/bookkeeping/list.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 5f0cd6c74de..18ca6fc991a 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -493,10 +493,10 @@ if ($action != 'export_csv') { print "\n"; print ''; - $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); + $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + print ""; print ''; } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index a93deb4e911..bc9b7c7fa0e 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1280,4 +1280,4 @@ print ''; // End of page llxFooter(); - $db->close(); \ No newline at end of file + $db->close(); From da8d6d958ab1c2be6db845f6948a221114ab2261 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Nov 2022 21:56:46 +0100 Subject: [PATCH 4/4] Update list.php --- htdocs/accountancy/bookkeeping/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index bc9b7c7fa0e..f3710ef51d5 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1280,4 +1280,5 @@ print ''; // End of page llxFooter(); - $db->close(); + +$db->close();