diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 64c6b6817bd..beb2e015fc4 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -2539,6 +2539,9 @@ print $formconfirm;
* Action bar
*/
if ($action != 'create' && $action != 'edit') {
+ $cloneProductUrl = $_SERVER["PHP_SELF"].'?action=clone&token='.newToken();
+ $cloneButtonId = 'action-clone-no-ajax';
+
print "\n".'
'."\n";
$parameters = array();
@@ -2546,15 +2549,15 @@ if ($action != 'create' && $action != 'edit') {
if (empty($reshook)) {
if ($usercancreate) {
if (!isset($object->no_button_edit) || $object->no_button_edit <> 1) {
- print '
id.'">'.$langs->trans("Modify").'';
+ print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, '', $usercancreate);
}
if (!isset($object->no_button_copy) || $object->no_button_copy <> 1) {
if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) {
- print '
'.$langs->trans('ToClone').''."\n";
- } else {
- print '
id.'">'.$langs->trans("ToClone").'';
+ $cloneProductUrl = '';
+ $cloneButtonId = 'action-clone';
}
+ print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $cloneProductUrl, $cloneButtonId, $usercancreate);
}
}
$object_is_used = $object->isObjectUsed($object->id);
@@ -2562,15 +2565,15 @@ if ($action != 'create' && $action != 'edit') {
if ($usercandelete) {
if (empty($object_is_used) && (!isset($object->no_button_delete) || $object->no_button_delete <> 1)) {
if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) {
- print '
'.$langs->trans('Delete').''."\n";
+ print dolGetButtonAction($langs->trans('Delete'), '', 'delete', '#', 'action-delete', true);
} else {
- print '
id.'">'.$langs->trans("Delete").'';
+ print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
}
} else {
- print '
'.$langs->trans("Delete").'';
+ print dolGetButtonAction($langs->trans("ProductIsUsed"), $langs->trans('Delete'), 'delete', '#', '', false);
}
} else {
- print '
'.$langs->trans("Delete").'';
+ print dolGetButtonAction($langs->trans("NotEnoughPermissions"), $langs->trans('Delete'), 'delete', '#', '', false);
}
}