diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php index ebfbaf224f6..1fa2aa2f2e1 100644 --- a/htdocs/core/lib/resource.lib.php +++ b/htdocs/core/lib/resource.lib.php @@ -1,7 +1,8 @@ - * Copyright (C) 2016 Gilles Poirier + * Copyright (C) 2013 Jean-François Ferry + * Copyright (C) 2016 Gilles Poirier + * 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 @@ -26,7 +27,7 @@ /** * Prepare head for tabs * - * @param Object $object Object + * @param Dolresource $object Object * @return array Array of head entries */ function resource_prepare_head($object) @@ -114,7 +115,10 @@ function resource_prepare_head($object) function resource_admin_prepare_head() { - global $langs, $conf, $user; + global $conf, $db, $langs, $user; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('resource'); $h = 0; $head = array(); @@ -132,6 +136,10 @@ function resource_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/admin/resource_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['resource']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++;