diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index baf6e3e1a91..cbd730e5d23 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -589,13 +589,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $(".collapse_bom").click(function() { console.log("We click on collapse"); var id_bom_line = $(this).attr('id').replace('collapse-', ''); - if($(this).text().indexOf('+') > 0) { + console.log($(this).html().indexOf('folder-open')); + if($(this).html().indexOf('folder-open') <= 0) { $('[parentid="'+ id_bom_line +'"]').show(); - $(this).html('(-) '); + $(this).html(''); } else { $('[parentid="'+ id_bom_line +'"]').hide(); - $(this).html('(+) '); + $(this).html(''); } return false; @@ -605,7 +606,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $("#show_all").click(function() { console.log("We click on show all"); $("[class^=sub_bom_lines]").show(); - $("[class^=collapse_bom]").html('(-) '); + $("[class^=collapse_bom]").html(''); return false; }); @@ -613,7 +614,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $("#hide_all").click(function() { console.log("We click on hide all"); $("[class^=sub_bom_lines]").hide(); - $("[class^=collapse_bom]").html('(+) '); + $("[class^=collapse_bom]").html(''); return false; }); diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 4360d521036..b72ed043581 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -83,10 +83,12 @@ $tmpproduct->fetch($line->fk_product); $tmpbom = new BOM($object->db); $res = $tmpbom->fetch($line->fk_bom_child); if ($tmpbom->id > 0) { - print '' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' '; print $tmpproduct->getNomUrl(1); - print ' '.$langs->trans('or').' '; + print ' '.$langs->trans("or").' '; print $tmpbom->getNomUrl(1); + print ' '; + print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open')); + print ''; } else { print $tmpproduct->getNomUrl(1); print ' - '.$tmpproduct->label;