From 79e0d59978b765bf18a4b77b28cd821e0fc9dd62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Jul 2022 11:48:17 +0200 Subject: [PATCH] Fix regression --- htdocs/contact/card.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 649fcc00fb4..0ef31fe36a4 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -567,19 +567,22 @@ $form = new Form($db); $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); +$objsoc = new Societe($db); +if ($socid > 0) { + $objsoc->fetch($socid); +} + $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->lastname) { $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +$title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")); + +llxHeader('', $title, $help_url); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -$objsoc = new Societe($db); -if ($socid > 0) { - $objsoc->fetch($socid); -} - if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // ----------------------------------------- // When used with CANVAS @@ -621,8 +624,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Show tabs $head = contact_prepare_head($object); - - llxHeader('', $title, $help_url); } if ($user->rights->societe->contact->creer) { @@ -643,9 +644,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } $linkback = ''; - $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")); - - llxHeader('', $title, $help_url); print load_fiche_titre($title, $linkback, 'address');