fix undeclared properties

This commit is contained in:
Frédéric FRANCE 2023-01-19 11:55:41 +01:00
parent a6936a0b6a
commit 9e353c3284
3 changed files with 77 additions and 38 deletions

View File

@ -122,7 +122,7 @@ class CompanyPaymentMode extends CommonObject
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>20),
'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>25),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>-2, 'position'=>105),
//'aaa' =>array('type'=>'date', 'label'=>'Ending date', 'enabled'=>0, 'visible'=>-2, 'position'=>185),
//'aaa' =>array('type'=>'date', 'label'=>'Ending date', 'enabled'=>0, 'visible'=>-2, 'position'=>185),
);
/**
@ -146,6 +146,18 @@ class CompanyPaymentMode extends CommonObject
public $number;
public $cle_rib;
public $bic;
/**
* @var string iban
* @deprecated
* @see iban_prefix
*/
public $iban;
/**
* iban_prefix
* @var string
*/
public $iban_prefix;
public $domiciliation;
public $proprio;
@ -255,8 +267,7 @@ class CompanyPaymentMode extends CommonObject
// Clear fields
$object->ref = "copy_of_".$object->ref;
$object->title = $langs->trans("CopyOf")." ".$object->title;
// ...
// $object->title = $langs->trans("CopyOf")." ".$object->title;
// Create clone
$object->context['createfromclone'] = 'createfromclone';

View File

@ -15,7 +15,7 @@
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2019-2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2022 ButterflyOfFire <butterflyoffire+dolibarr@protonmail.com>
*
@ -128,6 +128,22 @@ class Societe extends CommonObject
*/
public $restrictiononfksoc = 1;
/**
* @var Societe To store a cloned copy of object before to edit it and keep track of old properties
*/
public $oldcopy;
/**
* array of supplier categories
* @var array
*/
public $SupplierCategories = array();
/**
* prefixCustomerIsRequired
* @var int
*/
public $prefixCustomerIsRequired;
/**
* 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
@ -351,12 +367,19 @@ class Societe extends CommonObject
* @var string
*/
public $fax;
/**
* Email
* @var string
*/
public $email;
/**
* No Email
* @var int
*/
public $no_email;
/**
* @var array array of socialnetworks
*/
@ -462,6 +485,12 @@ class Societe extends CommonObject
*/
public $idprof6;
/**
* Object of company
* @var string
*/
public $object;
/**
* @var string Prefix comm
*/
@ -4257,14 +4286,14 @@ class Societe extends CommonObject
global $langs;
$this->id = 0;
$this->name = empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? '' : $conf->global->MAIN_INFO_SOCIETE_NOM;
$this->address = empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS) ? '' : $conf->global->MAIN_INFO_SOCIETE_ADDRESS;
$this->zip = empty($conf->global->MAIN_INFO_SOCIETE_ZIP) ? '' : $conf->global->MAIN_INFO_SOCIETE_ZIP;
$this->town = empty($conf->global->MAIN_INFO_SOCIETE_TOWN) ? '' : $conf->global->MAIN_INFO_SOCIETE_TOWN;
$this->region_code = empty($conf->global->MAIN_INFO_SOCIETE_REGION) ? '' : $conf->global->MAIN_INFO_SOCIETE_REGION;
$this->object = empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? '' : $conf->global->MAIN_INFO_SOCIETE_OBJECT;
$this->name = getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
$this->address = getDolGlobalString('MAIN_INFO_SOCIETE_ADDRESS');
$this->zip = getDolGlobalString('MAIN_INFO_SOCIETE_ZIP');
$this->town = getDolGlobalString('MAIN_INFO_SOCIETE_TOWN');
$this->region_code = getDolGlobalString('MAIN_INFO_SOCIETE_REGION');
$this->object = getDolGlobalString('MAIN_INFO_SOCIETE_OBJECT');
$this->note_private = empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? '' : $conf->global->MAIN_INFO_SOCIETE_NOTE;
$this->note_private = getDolGlobalString('MAIN_INFO_SOCIETE_NOTE');
$this->nom = $this->name; // deprecated
@ -4276,8 +4305,8 @@ class Societe extends CommonObject
if (!empty($tmp[1])) { // If $conf->global->MAIN_INFO_SOCIETE_COUNTRY is "id:code:label"
$country_code = $tmp[1];
$country_label = $tmp[2];
} else // For backward compatibility
{
} else {
// For backward compatibility
dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_WARNING);
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
$country_code = getCountry($country_id, 2, $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
@ -4314,40 +4343,40 @@ class Societe extends CommonObject
$this->state = ($langs->trans('State'.$state_code) != 'State'.$state_code) ? $langs->trans('State'.$state_code) : $state_label;
}
$this->phone = empty($conf->global->MAIN_INFO_SOCIETE_TEL) ? '' : $conf->global->MAIN_INFO_SOCIETE_TEL;
$this->fax = empty($conf->global->MAIN_INFO_SOCIETE_FAX) ? '' : $conf->global->MAIN_INFO_SOCIETE_FAX;
$this->url = empty($conf->global->MAIN_INFO_SOCIETE_WEB) ? '' : $conf->global->MAIN_INFO_SOCIETE_WEB;
$this->phone = getDolGlobalString('MAIN_INFO_SOCIETE_TEL');
$this->fax = getDolGlobalString('MAIN_INFO_SOCIETE_FAX');
$this->url = getDolGlobalString('MAIN_INFO_SOCIETE_WEB');
// Social networks
$this->facebook_url = empty($conf->global->MAIN_INFO_SOCIETE_FACEBOOK_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_FACEBOOK_URL;
$this->twitter_url = empty($conf->global->MAIN_INFO_SOCIETE_TWITTER_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_TWITTER_URL;
$this->linkedin_url = empty($conf->global->MAIN_INFO_SOCIETE_LINKEDIN_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_LINKEDIN_URL;
$this->instagram_url = empty($conf->global->MAIN_INFO_SOCIETE_INSTAGRAM_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_INSTAGRAM_URL;
$this->youtube_url = empty($conf->global->MAIN_INFO_SOCIETE_YOUTUBE_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_YOUTUBE_URL;
$this->github_url = empty($conf->global->MAIN_INFO_SOCIETE_GITHUB_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_GITHUB_URL;
$facebook_url = getDolGlobalString('MAIN_INFO_SOCIETE_FACEBOOK_URL');
$twitter_url = getDolGlobalString('MAIN_INFO_SOCIETE_TWITTER_URL');
$linkedin_url = getDolGlobalString('MAIN_INFO_SOCIETE_LINKEDIN_URL');
$instagram_url = getDolGlobalString('MAIN_INFO_SOCIETE_INSTAGRAM_URL');
$youtube_url = getDolGlobalString('MAIN_INFO_SOCIETE_YOUTUBE_URL');
$github_url = getDolGlobalString('MAIN_INFO_SOCIETE_GITHUB_URL');
$this->socialnetworks = array();
if (!empty($this->facebook_url)) {
$this->socialnetworks['facebook'] = $this->facebook_url;
if (!empty($facebook_url)) {
$this->socialnetworks['facebook'] = $facebook_url;
}
if (!empty($this->twitter_url)) {
$this->socialnetworks['twitter'] = $this->twitter_url;
if (!empty($twitter_url)) {
$this->socialnetworks['twitter'] = $twitter_url;
}
if (!empty($this->linkedin_url)) {
$this->socialnetworks['linkedin'] = $this->linkedin_url;
if (!empty($linkedin_url)) {
$this->socialnetworks['linkedin'] = $linkedin_url;
}
if (!empty($this->instagram_url)) {
$this->socialnetworks['instagram'] = $this->instagram_url;
if (!empty($instagram_url)) {
$this->socialnetworks['instagram'] = $instagram_url;
}
if (!empty($this->youtube_url)) {
$this->socialnetworks['youtube'] = $this->youtube_url;
if (!empty($youtube_url)) {
$this->socialnetworks['youtube'] = $youtube_url;
}
if (!empty($this->github_url)) {
$this->socialnetworks['github'] = $this->github_url;
if (!empty($github_url)) {
$this->socialnetworks['github'] = $github_url;
}
// Id prof generiques
$this->idprof1 = empty($conf->global->MAIN_INFO_SIREN) ? '' : $conf->global->MAIN_INFO_SIREN;
$this->idprof2 = empty($conf->global->MAIN_INFO_SIRET) ? '' : $conf->global->MAIN_INFO_SIRET;
$this->idprof1 = getDolGlobalString('MAIN_INFO_SIREN');
$this->idprof2 = getDolGlobalString('MAIN_INFO_SIRET');
$this->idprof3 = empty($conf->global->MAIN_INFO_APE) ? '' : $conf->global->MAIN_INFO_APE;
$this->idprof4 = empty($conf->global->MAIN_INFO_RCS) ? '' : $conf->global->MAIN_INFO_RCS;
$this->idprof5 = empty($conf->global->MAIN_INFO_PROFID5) ? '' : $conf->global->MAIN_INFO_PROFID5;

View File

@ -216,8 +216,7 @@ class SocieteAccount extends CommonObject
// Clear fields
$object->ref = "copy_of_".$object->ref;
$object->title = $langs->trans("CopyOf")." ".$object->title;
// ...
// $object->title = $langs->trans("CopyOf")." ".$object->title;
// Create clone
$object->context['createfromclone'] = 'createfromclone';