Fix: uniformize code

This commit is contained in:
Regis Houssin 2010-04-06 16:12:00 +00:00
parent 8a10f4801b
commit ecc51347b3
3 changed files with 33 additions and 21 deletions

View File

@ -70,7 +70,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
// Recupere emmetteur
$this->emetteur=$mysoc;
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'<EFBFBD>tait pas d<>fini
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini
}
@ -82,7 +82,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
function get_substitutionarray_mysoc($mysoc)
{
return array(
'mycompany_name'=>$mysoc->nom,
'mycompany_name'=>$mysoc->name,
'mycompany_email'=>$mysoc->email,
'mycompany_phone'=>$mysoc->phone,
'mycompany_fax'=>$mysoc->fax,
@ -110,7 +110,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
function get_substitutionarray_object($object)
{
return array(
'company_name'=>$object->nom,
'company_name'=>$object->name,
'company_email'=>$object->email,
'company_phone'=>$object->phone,
'company_fax'=>$object->fax,

View File

@ -337,11 +337,14 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC'))
$mysoc=new Societe($db);
$mysoc->id=0;
$mysoc->nom=$conf->global->MAIN_INFO_SOCIETE_NOM;
$mysoc->nom=$conf->global->MAIN_INFO_SOCIETE_NOM; // TODO obsolete
$mysoc->name=$conf->global->MAIN_INFO_SOCIETE_NOM;
$mysoc->adresse=$conf->global->MAIN_INFO_SOCIETE_ADRESSE; // TODO obsolete
$mysoc->address=$conf->global->MAIN_INFO_SOCIETE_ADRESSE;
$mysoc->cp=$conf->global->MAIN_INFO_SOCIETE_CP;
$mysoc->ville=$conf->global->MAIN_INFO_SOCIETE_VILLE;
$mysoc->cp=$conf->global->MAIN_INFO_SOCIETE_CP; // TODO obsolete
$mysoc->zip=$conf->global->MAIN_INFO_SOCIETE_CP;
$mysoc->ville=$conf->global->MAIN_INFO_SOCIETE_VILLE; // TODO obsolete
$mysoc->town=$conf->global->MAIN_INFO_SOCIETE_VILLE;
// Si dans MAIN_INFO_SOCIETE_PAYS on a un id de pays, on recupere code
if (is_numeric($conf->global->MAIN_INFO_SOCIETE_PAYS))
{
@ -363,7 +366,8 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC'))
{
$mysoc->pays_code=$conf->global->MAIN_INFO_SOCIETE_PAYS;
}
$mysoc->tel=$conf->global->MAIN_INFO_SOCIETE_TEL;
$mysoc->tel=$conf->global->MAIN_INFO_SOCIETE_TEL; // TODO obsolete
$mysoc->phone=$conf->global->MAIN_INFO_SOCIETE_TEL;
$mysoc->fax=$conf->global->MAIN_INFO_SOCIETE_FAX;
$mysoc->url=$conf->global->MAIN_INFO_SOCIETE_WEB;
// Anciens id prof

View File

@ -604,20 +604,24 @@ class Societe extends CommonObject
$this->datec = $this->db->jdate($obj->datec);
$this->date_update = $this->db->jdate($obj->date_update);
$this->nom = $obj->nom;
$this->address = $obj->address;
$this->adresse = $obj->address; // TODO obsolete
$this->cp = $obj->cp;
$this->ville = $obj->ville;
$this->nom = $obj->nom; // TODO obsolete
$this->name = $obj->nom;
$this->address = $obj->address;
$this->adresse = $obj->address; // TODO obsolete
$this->cp = $obj->cp; // TODO obsolete
$this->zip = $obj->cp;
$this->ville = $obj->ville;// TODO obsolete
$this->town = $obj->ville;
$this->adresse_full = $obj->address . "\n". $obj->cp . ' '. $obj->ville; // TODO obsolete
$this->full_address = $obj->address . "\n". $obj->cp . ' '. $obj->ville;
$this->pays_id = $obj->fk_pays;
$this->pays_code = $obj->fk_pays?$obj->pays_code:'';
$this->pays = $obj->fk_pays?($langs->trans('Country'.$obj->pays_code)!='Country'.$obj->pays_code?$langs->trans('Country'.$obj->pays_code):$obj->pays):'';
$this->pays_id = $obj->fk_pays;
$this->pays_code = $obj->fk_pays?$obj->pays_code:'';
$this->pays = $obj->fk_pays?($langs->trans('Country'.$obj->pays_code)!='Country'.$obj->pays_code?$langs->trans('Country'.$obj->pays_code):$obj->pays):''; // TODO obsolete
$this->country = $obj->fk_pays?($langs->trans('Country'.$obj->pays_code)!='Country'.$obj->pays_code?$langs->trans('Country'.$obj->pays_code):$obj->pays):'';
$this->departement_id = $obj->fk_departement;
$this->departement= $obj->fk_departement?$obj->departement:'';
$this->departement = $obj->fk_departement?$obj->departement:'';
$transcode=$langs->trans('StatusProspect'.$obj->fk_stcomm);
$libelle=($transcode!='StatusProspect'.$obj->fk_stcomm?$transcode:$obj->stcomm);
@ -626,15 +630,19 @@ class Societe extends CommonObject
$this->email = $obj->email;
$this->url = $obj->url;
$this->tel = $obj->tel;
$this->tel = $obj->tel; // TODO obsolete
$this->phone = $obj->tel;
$this->fax = $obj->fax;
$this->parent = $obj->parent;
$this->siren = $obj->siren;
$this->siret = $obj->siret;
$this->ape = $obj->ape;
$this->idprof4 = $obj->idprof4;
$this->siren = $obj->siren; // TODO obsolete
$this->idprof1 = $obj->siren;
$this->siret = $obj->siret; // TODO obsolete
$this->idprof2 = $obj->siret;
$this->ape = $obj->ape; // TODO obsolete
$this->idprof3 = $obj->ape;
$this->idprof4 = $obj->idprof4;
$this->capital = $obj->capital;