fix extrafields linnktoObject Thirdpary option showAdress

This commit is contained in:
florian HENRY 2020-07-13 17:48:21 +02:00
parent eede2f9944
commit 045fbad616
2 changed files with 12 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;
}
}