From b728ad871cde3c17ebe945b14b20362b562bea6d Mon Sep 17 00:00:00 2001 From: GregM Date: Tue, 22 Feb 2022 10:06:05 +0100 Subject: [PATCH 01/11] WIP dolGetButtonAction --- htdocs/societe/card.php | 48 +++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b6c483fc026..d99f080ed24 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2444,10 +2444,29 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $formconfirm = ''; // Confirm delete third party - if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("DeleteACompany"), $langs->trans("ConfirmDeleteCompany"), "confirm_delete", '', 0, "action-delete"); +// if ($action == 'delete' ) { +// var_dump("dlzk,dmz,kdml,zdzd"); +// +// +// $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("DeleteACompany"), $langs->trans("ConfirmDeleteCompany"), "confirm_delete", '', 0, "action-delete"); +// print $formconfirm; +// } + + + if ($action == 'delete') { + $formquestion = array( + array( + 'label' => $langs->trans('M456465645y'), + 'value' => 'yes', + ) + ); + + $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteThirdParty'), $langs->trans('ConfirmDeleteCompany'), 'confirm_delete', '', 0, 2); } + + + if ($action == 'merge') { $formquestion = array( array( @@ -2910,15 +2929,25 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (empty($user->socid)) { if (!empty($object->email) || $at_least_one_email_contact) { $langs->load("mails"); + //TODO replace to dolGetButtonAction + $params = array( + 'attr' => array( + 'title' => '' + ) + ); print ''.$langs->trans('SendMail').''."\n"; + print dolGetButtonAction($langs->trans('SendMaiAl'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '',true,$params); } else { $langs->load("mails"); + //TODO replace to dolGetButtonAction print ''.$langs->trans('SendMail').''."\n"; + print dolGetButtonAction($langs->trans('SendMaiAl'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle'.newToken(), '',false); } } if ($user->rights->societe->creer) { - print ''.$langs->trans("Modify").''."\n"; + //TODO MODIFIER OK + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); } if (!empty($conf->adherent->enabled)) { @@ -2930,16 +2959,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if ($user->rights->societe->supprimer) { - print ''.$langs->trans('Merge').''."\n"; - } + //TODO FUSIONNER OK + print dolGetButtonAction($langs->trans('MergeThirdparties'), '', 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontoadd); + - if ($user->rights->societe->supprimer) { - if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile - print ''.$langs->trans('Delete').''."\n"; - } else { - print ''.$langs->trans('Delete').''."\n"; - } } + //TODO SUPPRIMER OK + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), '', $user->rights->societe->supprimer); } print ''."\n"; From b05a5d63b210f3b341bf3017ce0edc3a56d3575d Mon Sep 17 00:00:00 2001 From: GregM Date: Tue, 22 Feb 2022 11:28:33 +0100 Subject: [PATCH 02/11] WIP dolGetButtonAction --- htdocs/societe/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index d99f080ed24..9b097bfab99 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2929,14 +2929,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (empty($user->socid)) { if (!empty($object->email) || $at_least_one_email_contact) { $langs->load("mails"); - //TODO replace to dolGetButtonAction + //TODO ENVOYER EMAIL $params = array( 'attr' => array( 'title' => '' ) ); - print ''.$langs->trans('SendMail').''."\n"; - print dolGetButtonAction($langs->trans('SendMaiAl'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '',true,$params); + //print ''.$langs->trans('SendMail').''."\n"; + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '',true,$params); } else { $langs->load("mails"); //TODO replace to dolGetButtonAction @@ -2947,7 +2947,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($user->rights->societe->creer) { //TODO MODIFIER OK - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd,$params); } if (!empty($conf->adherent->enabled)) { @@ -2965,7 +2965,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } //TODO SUPPRIMER OK - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), '', $user->rights->societe->supprimer); + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), '', $user->rights->societe->supprimer,$params); } print ''."\n"; From 69bb3aaad19884c7c54bae6f9238329899ec692e Mon Sep 17 00:00:00 2001 From: GregM Date: Tue, 22 Feb 2022 11:35:55 +0100 Subject: [PATCH 03/11] WIP dolGetButtonAction --- htdocs/societe/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 9b097bfab99..ece24428a2e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2940,8 +2940,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } else { $langs->load("mails"); //TODO replace to dolGetButtonAction - print ''.$langs->trans('SendMail').''."\n"; - print dolGetButtonAction($langs->trans('SendMaiAl'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle'.newToken(), '',false); + //print ''.$langs->trans('SendMail').''."\n"; + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle'.newToken(), '',false); } } @@ -2960,7 +2960,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($user->rights->societe->supprimer) { //TODO FUSIONNER OK - print dolGetButtonAction($langs->trans('MergeThirdparties'), '', 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction($langs->trans('MergeThirdparties'), '', 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontoadd, $params); } From b0473c475a2d62518605bf79ce2866cd59a85128 Mon Sep 17 00:00:00 2001 From: GregM Date: Tue, 22 Feb 2022 11:48:35 +0100 Subject: [PATCH 04/11] wip dolGetButtonAction --- htdocs/societe/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ece24428a2e..7123bd1d18c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2941,7 +2941,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $langs->load("mails"); //TODO replace to dolGetButtonAction //print ''.$langs->trans('SendMail').''."\n"; - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle'.newToken(), '',false); + $params['attr']['title'] = $langs->trans('NoEMail'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle'.newToken(), '',false,$params); } } From 059548105c83d0b1d06aa7c85e68c99f4fec01b5 Mon Sep 17 00:00:00 2001 From: GregM Date: Tue, 22 Feb 2022 12:14:18 +0100 Subject: [PATCH 05/11] WIP dolGetButtonAction --- htdocs/societe/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 7123bd1d18c..4a3a33af83f 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2948,7 +2948,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($user->rights->societe->creer) { //TODO MODIFIER OK - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd,$params); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); } if (!empty($conf->adherent->enabled)) { @@ -2961,12 +2961,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($user->rights->societe->supprimer) { //TODO FUSIONNER OK - print dolGetButtonAction($langs->trans('MergeThirdparties'), '', 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontoadd, $params); + print dolGetButtonAction($langs->trans('MergeThirdparties'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontoadd); } //TODO SUPPRIMER OK - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), '', $user->rights->societe->supprimer,$params); + print dolGetButtonAction('', $langs->trans('Delete'),'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), '', $user->rights->societe->supprimer); } print ''."\n"; From e21a9bdd7d832f6ef859af6e0c716f7170c68b78 Mon Sep 17 00:00:00 2001 From: GregM Date: Wed, 23 Feb 2022 09:25:43 +0100 Subject: [PATCH 06/11] WIP dolGetButtonAction lib --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7be3f5e3351..9a866303eb3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9965,6 +9965,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = if (empty($html)) { $html = $label; + $attr['title'] = ''; // if html not set, leave label on title is redundant } else { $attr['aria-label'] = $label; } From 5dcb4c85ee0ced5776dcf6aec36e4d48d5113297 Mon Sep 17 00:00:00 2001 From: GregM Date: Wed, 23 Feb 2022 10:03:48 +0100 Subject: [PATCH 07/11] fix dolGetButtonAction societe card --- htdocs/societe/card.php | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 4a3a33af83f..8c1c0102e30 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2444,15 +2444,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $formconfirm = ''; // Confirm delete third party -// if ($action == 'delete' ) { -// var_dump("dlzk,dmz,kdml,zdzd"); -// -// -// $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("DeleteACompany"), $langs->trans("ConfirmDeleteCompany"), "confirm_delete", '', 0, "action-delete"); -// print $formconfirm; -// } - - if ($action == 'delete') { $formquestion = array( array( @@ -2929,25 +2920,20 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (empty($user->socid)) { if (!empty($object->email) || $at_least_one_email_contact) { $langs->load("mails"); - //TODO ENVOYER EMAIL $params = array( 'attr' => array( 'title' => '' ) ); - //print ''.$langs->trans('SendMail').''."\n"; - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '',true,$params); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '', true, $params); } else { $langs->load("mails"); - //TODO replace to dolGetButtonAction - //print ''.$langs->trans('SendMail').''."\n"; $params['attr']['title'] = $langs->trans('NoEMail'); - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle'.newToken(), '',false,$params); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle'.newToken(), '', false, $params); } } if ($user->rights->societe->creer) { - //TODO MODIFIER OK print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); } @@ -2960,13 +2946,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if ($user->rights->societe->supprimer) { - //TODO FUSIONNER OK print dolGetButtonAction($langs->trans('MergeThirdparties'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontoadd); - - } - //TODO SUPPRIMER OK - print dolGetButtonAction('', $langs->trans('Delete'),'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), '', $user->rights->societe->supprimer); + print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), '', $user->rights->societe->supprimer); } print ''."\n"; From f866f9641e1898c6178cd3004894955891709532 Mon Sep 17 00:00:00 2001 From: GregM Date: Wed, 23 Feb 2022 10:12:43 +0100 Subject: [PATCH 08/11] update change on another PR --- htdocs/core/lib/functions.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9a866303eb3..7be3f5e3351 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9965,7 +9965,6 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = if (empty($html)) { $html = $label; - $attr['title'] = ''; // if html not set, leave label on title is redundant } else { $attr['aria-label'] = $label; } From b95460844396600d4f49b1cf5206233e24a0ce41 Mon Sep 17 00:00:00 2001 From: GregM Date: Wed, 23 Feb 2022 12:09:15 +0100 Subject: [PATCH 09/11] Update card --- htdocs/societe/card.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 8c1c0102e30..995e731cdca 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2447,12 +2447,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($action == 'delete') { $formquestion = array( array( - 'label' => $langs->trans('M456465645y'), 'value' => 'yes', ) ); - $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteThirdParty'), $langs->trans('ConfirmDeleteCompany'), 'confirm_delete', '', 0, 2); + $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteACompany'), $langs->trans('ConfirmDeleteCompany'), 'confirm_delete', '', 0, 2); } @@ -2933,9 +2932,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } } - if ($user->rights->societe->creer) { - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); - } + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); if (!empty($conf->adherent->enabled)) { $adh = new Adherent($db); @@ -2945,10 +2942,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } } + print dolGetButtonAction($langs->trans('MergeThirdparties'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontodelete); + if ($user->rights->societe->supprimer) { - print dolGetButtonAction($langs->trans('MergeThirdparties'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontoadd); + if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile + print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), 'action-delete', $permissiontodelete); + } else { + print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); + } } - print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), '', $user->rights->societe->supprimer); } print ''."\n"; From 74bfdb0842f9e45b8e5a9e1b653ff7f00bcedc10 Mon Sep 17 00:00:00 2001 From: GregM Date: Wed, 23 Feb 2022 15:34:17 +0100 Subject: [PATCH 10/11] fix retour --- htdocs/societe/card.php | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 995e731cdca..3a9fcaff07b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2917,19 +2917,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (empty($user->socid)) { - if (!empty($object->email) || $at_least_one_email_contact) { - $langs->load("mails"); - $params = array( - 'attr' => array( - 'title' => '' - ) - ); - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '', true, $params); - } else { - $langs->load("mails"); - $params['attr']['title'] = $langs->trans('NoEMail'); - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle'.newToken(), '', false, $params); - } + $langs->load("mails"); + $title = ''; + if (empty($object->email) && !$at_least_one_email_contact) { $title = $langs->trans('NoEMail'); } + print dolGetButtonAction($title, $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', 'btn-send-mail', !empty($object->email) || $at_least_one_email_contact); } print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); @@ -2945,11 +2936,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print dolGetButtonAction($langs->trans('MergeThirdparties'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontodelete); if ($user->rights->societe->supprimer) { + $deleteUrl = $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(); + $buttonId = 'action-delete-no-ajax'; if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile - print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), 'action-delete', $permissiontodelete); - } else { - print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); + $deleteUrl = ''; + $buttonId = 'action-delete'; } + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $deleteUrl, $buttonId, $permissiontodelete); } } From 114827934eac8374cfa02f627f282f9139ba9305 Mon Sep 17 00:00:00 2001 From: GregM Date: Wed, 23 Feb 2022 15:51:44 +0100 Subject: [PATCH 11/11] Fix merge conflict --- htdocs/societe/card.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index d598e310aaf..25b48936341 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2455,19 +2455,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $formconfirm = ''; // Confirm delete third party - if ($action == 'delete') { - $formquestion = array( - array( - 'value' => 'yes', - ) - ); - - $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteACompany'), $langs->trans('ConfirmDeleteCompany'), 'confirm_delete', '', 0, 2); + if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("DeleteACompany"), $langs->trans("ConfirmDeleteCompany"), "confirm_delete", '', 0, "action-delete"); } - - - if ($action == 'merge') { $formquestion = array( array(