From 89c5af14f4e08d5032100bf6e79151ace35ba3a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 5 Feb 2023 21:14:09 +0100 Subject: [PATCH] add extrafields count in salary(ies) admin --- htdocs/core/lib/salaries.lib.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/salaries.lib.php b/htdocs/core/lib/salaries.lib.php index 51ec880e31e..7909773260f 100644 --- a/htdocs/core/lib/salaries.lib.php +++ b/htdocs/core/lib/salaries.lib.php @@ -3,6 +3,7 @@ * Copyright (C) 2015 Charlie BENKE * Copyright (C) 2019 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2023 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 @@ -76,7 +77,10 @@ function salaries_prepare_head($object) */ function salaries_admin_prepare_head() { - global $langs, $conf, $user; + global $conf, $db, $langs, $user; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('salary'); $h = 0; $head = array(); @@ -94,6 +98,10 @@ function salaries_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/salaries/admin/salaries_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsSalaries"); + $nbExtrafields = $extrafields->attributes['salary']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++;