add badges

This commit is contained in:
Frédéric France
2022-09-15 20:23:37 +02:00
parent 16d2f06684
commit 567c646989
2 changed files with 17 additions and 4 deletions

View File

@@ -314,7 +314,7 @@ function show_array_last_actions_done($max = 5)
print '<tr class="oddeven">';
$staticaction->type_code = $obj->code;
$staticaction->libelle = $obj->label;
$staticaction->label = $obj->label;
$staticaction->id = $obj->id;
print '<td>'.$staticaction->getNomUrl(1, 34).'</td>';

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2018-2022 OpenDSI <support@open-dsi.fr>
* Copyright (C) 2022 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 assetAdminPrepareHead()
{
global $langs, $conf;
global $langs, $conf, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('asset');
$extrafields->fetch_name_optionals_label('assetmodel');
$langs->load("assets");
@@ -52,11 +57,19 @@ function assetAdminPrepareHead()
$head[$h][0] = DOL_URL_ROOT.'/asset/admin/asset_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = is_countable($extrafields->attributes['asset']['label']) ? count($extrafields->attributes['asset']['label']) : 0;
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'asset_extrafields';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/asset/admin/assetmodel_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsAssetModel");
$nbExtrafields = is_countable($extrafields->attributes['assetmodel']['label']) ? count($extrafields->attributes['assetmodel']['label']) : 0;
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'assetmodel_extrafields';
$h++;