add extrafields count in admin eventorganization

This commit is contained in:
Frédéric FRANCE 2023-02-09 23:55:42 +01:00 committed by GitHub
parent 356b3af6e6
commit afa344393c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2021 Florian Henry <florian.henry@scopen.fr>
* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@ -28,7 +29,11 @@
*/
function eventorganizationAdminPrepareHead()
{
global $langs, $conf;
global $langs, $conf, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('actioncomm');
$extrafields->fetch_name_optionals_label('eventorganization_conferenceorboothattendee');
$langs->load("eventorganization");
@ -43,11 +48,19 @@ function eventorganizationAdminPrepareHead()
$head[$h][0] = DOL_URL_ROOT.'/admin/eventorganization_confbooth_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("EventOrganizationConfOrBooth").")";
$nbExtrafields = $extrafields->attributes['actioncomm']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'eventorganization_extrafields';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/eventorganization_confboothattendee_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Attendees").")";
$nbExtrafields = $extrafields->attributes['eventorganization_conferenceorboothattendee']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'conferenceorboothattendee_extrafields';
$h++;