From 9cd6adb6c8df667dd63f1a1bed3ce1723aac31cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 18 Jan 2023 22:28:43 +0100 Subject: [PATCH] use oldcopy only to retrieve old values instaed undeclared properties --- htdocs/contact/card.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 3e7f5fdb1f1..66cdc1ed1aa 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -322,9 +322,6 @@ if (empty($reshook)) { $result = $object->fetch($id); $object->oldcopy = clone $object; - $object->old_lastname = (string) GETPOST("old_lastname", 'alpha'); - $object->old_firstname = (string) GETPOST("old_firstname", 'alpha'); - $result = $object->delete(); // TODO Add $user as first param if ($result > 0) { setEventMessages("RecordDeleted", null, 'mesgs'); @@ -408,9 +405,6 @@ if (empty($reshook)) { $object->oldcopy = clone $object; - $object->old_lastname = (string) GETPOST("old_lastname", 'alpha'); - $object->old_firstname = (string) GETPOST("old_firstname", 'alpha'); - $object->socid = GETPOST("socid", 'int'); $object->lastname = (string) GETPOST("lastname", 'alpha'); $object->firstname = (string) GETPOST("firstname", 'alpha'); @@ -972,7 +966,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { /* set country at end because it will trigger page refresh */ console.log("Set country id to '.dol_escape_js($objsoc->country_id).'"); $(\'select[name="country_id"]\').val("'.dol_escape_js($objsoc->country_id).'").trigger("change"); /* trigger required to update select2 components */ - }); + }); })'."\n"; print ''."\n"; } @@ -982,8 +976,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; print ''; - print ''; - print ''; if (!empty($backtopage)) { print ''; } @@ -1033,7 +1025,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; print ''; print '
'; - if ($conf->use_javascript_ajax) { + if (!empty($conf->use_javascript_ajax)) { print ''.$langs->trans('CopyAddressFromSoc').'
'; } print '
'; @@ -1636,7 +1628,7 @@ function showSocialNetwork() items.show(); lnk.text("'.dol_escape_js($langs->transnoentitiesnoconv("HideSocialNetwork")).'"); if(chgCookieState) {document.cookie = "DOLUSER_SOCIALNETWORKS_SHOW=true; SameSite=Strict";} - } + } } '; }