mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 09:08:09 +01:00
fix: php warning in BOM admin and modulebuilder template (#34437)
This commit is contained in:
@@ -49,7 +49,7 @@ function bomAdminPrepareHead()
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/bom_extrafields.php";
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = is_countable($extrafields->attributes['bom_bom']['label']) ? count($extrafields->attributes['bom_bom']['label']) : 0;
|
||||
$nbExtrafields = (isset($extrafields->attributes['bom_bom']['label']) && is_countable($extrafields->attributes['bom_bom']['label'])) ? count($extrafields->attributes['bom_bom']['label']) : 0;
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
|
||||
}
|
||||
@@ -58,7 +58,7 @@ function bomAdminPrepareHead()
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/bomline_extrafields.php";
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||
$nbExtrafields = is_countable($extrafields->attributes['bom_bomline']['label']) ? count($extrafields->attributes['bom_bomline']['label']) : 0;
|
||||
$nbExtrafields = (isset($extrafields->attributes['bom_bomline']['label']) && is_countable($extrafields->attributes['bom_bomline']['label'])) ? count($extrafields->attributes['bom_bomline']['label']) : 0;
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ function mymoduleAdminPrepareHead()
|
||||
/*
|
||||
$head[$h][0] = dol_buildpath("/mymodule/admin/myobject_extrafields.php", 1);
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = is_countable($extrafields->attributes['myobject']['label']) ? count($extrafields->attributes['myobject']['label']) : 0;
|
||||
$nbExtrafields = (isset($extrafields->attributes['myobject']['label']) && is_countable($extrafields->attributes['myobject']['label'])) ? count($extrafields->attributes['myobject']['label']) : 0;
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
|
||||
}
|
||||
@@ -56,7 +56,7 @@ function mymoduleAdminPrepareHead()
|
||||
|
||||
$head[$h][0] = dol_buildpath("/mymodule/admin/myobjectline_extrafields.php", 1);
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||
$nbExtrafields = is_countable($extrafields->attributes['myobjectline']['label']) ? count($extrafields->attributes['myobject']['label']) : 0;
|
||||
$nbExtrafields = (isset($extrafields->attributes['myobjectline']['label']) && is_countable($extrafields->attributes['myobjectline']['label'])) ? count($extrafields->attributes['myobject']['label']) : 0;
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print img_picto('', 'resource');
|
||||
print $formresource->select_resource_list($resources, 'resources', '', 0, 0, 0, array(), (string) $object->entity, 1, 0, 'quatrevingtpercent widthcentpercentminusx', true);
|
||||
print $formresource->select_resource_list($resources, 'resources', '', 0, 0, 0, array(), (string) $object->entity, 0, 0, 'quatrevingtpercent widthcentpercentminusx', true);
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
|
||||
Reference in New Issue
Block a user