From 37276cae5f52c6d95c4d19977ec76fda7eb2a07c Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:27:50 +0200 Subject: [PATCH 1/2] FIX: payment card: misleading message when delete button disabled --- htdocs/compta/paiement/card.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 59cb153bb547c..004de2429526e 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -522,8 +522,14 @@ } } +$params = array(); + +if (! empty($title_button)) { + $params['attr'] = array('title' => $title_button); +} + if ($user->socid == 0 && $action == '') { - print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->paiement && !$disable_delete); + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->paiement && !$disable_delete, $params); } print ''; From d2a9fe70c61d658ac40b4f8fa874890d1cf7ae2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2023 00:36:53 +0200 Subject: [PATCH 2/2] Fix phpcs --- htdocs/compta/paiement/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 004de2429526e..91045ae337034 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -523,9 +523,8 @@ } $params = array(); - if (! empty($title_button)) { - $params['attr'] = array('title' => $title_button); + $params['attr'] = array('title' => $title_button); } if ($user->socid == 0 && $action == '') {