From 65b85adcaf3d4b4e3780baa1f4f327754803e6ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 30 Nov 2022 18:26:26 +0100 Subject: [PATCH] Update expensereport.lib.php --- htdocs/core/lib/expensereport.lib.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 19e2e0ca00d..ae9ca936c47 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2022 Frédéric France * * 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 @@ -130,11 +131,14 @@ function payment_expensereport_prepare_head(PaymentExpenseReport $object) */ function expensereport_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; $h = 0; $head = array(); + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('expensereport'); + $h = 0; $head[$h][0] = DOL_URL_ROOT."/admin/expensereport.php"; @@ -162,6 +166,10 @@ function expensereport_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/admin/expensereport_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['expensereport']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++;