diff --git a/core/dbobject.class.php b/core/dbobject.class.php index fd3f913dda..50bf656219 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -1378,7 +1378,7 @@ abstract class DBObject implements iDisplay if ($bClickable && (strlen($sUrl) > 0)) { if ($bInBasket) { - $sHLink = "$sIcon$sHtmlLabel"; + $sHLink = "$sIcon$sHtmlLabel"; } else { $sHLink = "$sIcon$sHtmlLabel"; } diff --git a/templates/base/components/datatable/layout.ready.js.twig b/templates/base/components/datatable/layout.ready.js.twig index 5381572189..a80b850021 100644 --- a/templates/base/components/datatable/layout.ready.js.twig +++ b/templates/base/components/datatable/layout.ready.js.twig @@ -113,13 +113,16 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({ {% else %} $('#{{ oUIBlock.GetId() }}_wrapper').find('.object-in-basket').on('click', - function () { - console.warn('ici'); - sUrl = $(this).attr('data-href'); + function (event) { + event.preventDefault(); + event.stopPropagation(); + sUrl = $(this).attr('href'); $('#basket{{ oUIBlock.GetId() }}').attr('action', sUrl); + if (event.ctrlKey) + { + $('#basket{{ oUIBlock.GetId() }}').attr('target', "_blank"); + } $('#basket{{ oUIBlock.GetId() }}').submit(); - - } ); {% endif %} @@ -149,13 +152,16 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({ {% else %} $('#{{ oUIBlock.GetId() }}_wrapper').find('.object-in-basket').on('click', - function () { - console.warn('ici'); - sUrl = $(this).attr('data-href'); + function (event) { + event.preventDefault(); + event.stopPropagation(); + sUrl = $(this).attr('href'); $('#basket{{ oUIBlock.GetId() }}').attr('action', sUrl); + if (event.ctrlKey) + { + $('#basket{{ oUIBlock.GetId() }}').attr('target', "_blank"); + } $('#basket{{ oUIBlock.GetId() }}').submit(); - - } );