From 045fbad616b40110f174c64999005f427d875898 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 13 Jul 2020 17:48:21 +0200 Subject: [PATCH] fix extrafields linnktoObject Thirdpary option showAdress --- htdocs/core/class/html.form.class.php | 6 +++--- htdocs/societe/class/societe.class.php | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9c4e2526249..cebe79da30a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6122,7 +6122,7 @@ class Form $prefixforautocompletemode = $objecttmp->element; if ($prefixforautocompletemode == 'societe') $prefixforautocompletemode = 'company'; $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT - + $options=array(); if (!empty($objecttmp->fields)) // For object that declare it, it is better to use declared fields (like societe, contact, ...) { $tmpfieldstoshow = ''; @@ -6222,8 +6222,8 @@ class Form $obj = $this->db->fetch_object($resql); $label = ''; $tmparray = explode(',', $fieldstoshow); - foreach ($tmparray as $key => $val) - { + + foreach ($tmparray as $key => $val) { $val = preg_replace('/t\./', '', $val); $label .= (($label && $obj->$val) ? ' - ' : '').$obj->$val; } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 730e66eaab8..e3d6409ddd6 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -725,6 +725,8 @@ class Societe extends CommonObject */ public function __construct($db) { + global $conf; + $this->db = $db; $this->client = 0; @@ -735,6 +737,13 @@ class Societe extends CommonObject $this->forme_juridique_code = 0; $this->tva_assuj = 1; $this->status = 1; + + if ($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST) { + $this->fields['address']['showoncombobox'] = $conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST; + $this->fields['zip']['showoncombobox'] = $conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST; + $this->fields['town']['showoncombobox'] = $conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST; + //$this->fields['fk_pays']['showoncombobox'] = $conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST; + } }