From 2e6f4862f9bf42d279bbbfa8f0c14ee31dc8c7ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 May 2022 10:57:51 +0200 Subject: [PATCH] Fix creation of thirdparty when module supplier not enabled NEw can use the clicktoclipboard feature when clicking on value --- htdocs/core/js/lib_foot.js.php | 2 +- htdocs/societe/card.php | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index 997132ca132..9167e08e599 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -230,7 +230,7 @@ print ' } ); - jQuery(\'.clipboardCPButton, .clipboardCPValueToPrint\').click(function() { + jQuery(\'.clipboardCPValue, .clipboardCPButton, .clipboardCPValueToPrint\').click(function() { /* console.log(this.parentNode); */ console.log("We click on a clipboardCPButton or clipboardCPValueToPrint class and we want to copy content of clipboardCPValue class"); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 7d28edb1dc9..a620bd02d39 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -84,6 +84,7 @@ $error = 0; $errors = array(); $action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); @@ -135,16 +136,6 @@ $upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object-> // Security check $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0); -/* -if ($object->id > 0) { - if ($object->client == 0 && $object->fournisseur > 0) { - if (!empty($user->rights->fournisseur->lire)) { - accessforbidden(); - } - } -} -*/ - /* @@ -413,11 +404,11 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdPartyName")), null, 'errors'); $error++; } - if (GETPOST('client') < 0) { + if (GETPOST('client', 'int') && GETPOST('client', 'int') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProspectCustomer")), null, 'errors'); $error++; } - if (GETPOST('fournisseur') < 0) { + if (GETPOSTISSET('fournisseur') && GETPOST('fournisseur', 'int') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Supplier")), null, 'errors'); $error++; }