Qual: Remove usage of deprecated properties

This commit is contained in:
Laurent Destailleur 2011-02-20 12:06:11 +00:00
parent 33dc0374bc
commit 371c4a6090
12 changed files with 62 additions and 53 deletions

View File

@ -585,7 +585,7 @@ print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>";
print "<td>";
print '<select name="chq">';
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER?' selected="selected"':'').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->nom?$mysoc->nom:$langs->trans("NotDefined")).')</option>';
print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER?' selected="selected"':'').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name?$mysoc->name:$langs->trans("NotDefined")).')</option>';
$sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";

View File

@ -97,13 +97,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<?php print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&amp;file='.urlencode('/thumbs/'.$mysoc->logo_small).'">'; ?>
</div>
<div class="infos">
<p class="adresse"><?php echo $mysoc->nom; ?><br>
<?php echo $mysoc->adresse; ?><br>
<?php echo $mysoc->cp.' '.$mysoc->ville; ?></p>
<p class="adresse"><?php echo $mysoc->name; ?><br>
<?php echo $mysoc->address; ?><br>
<?php echo $mysoc->zip.' '.$mysoc->town; ?></p>
<?php
// Recuperation et affichage de la date et de l'heure
$now = mktime();
$now = dol_now();
print '<p class="date_heure">'.dol_print_date($now,'dayhourtext').'</p>';
?>
</div>

View File

@ -240,7 +240,7 @@ if ($id > 0 || ! empty($ref))
print '</td>';
print '<td colspan="1">';
print $mysoc->nom;
print $mysoc->name;
print '</td>';
print '<td colspan="1">';
@ -333,7 +333,7 @@ if ($id > 0 || ! empty($ref))
}
if ($tab[$i]['socid'] < 0)
{
print $mysoc->nom;
print $mysoc->name;
}
if (! $tab[$i]['socid'])
{

View File

@ -231,7 +231,7 @@ if ($id > 0)
print '</td>';
print '<td colspan="1">';
print $mysoc->nom;
print $mysoc->name;
print '</td>';
print '<td colspan="1">';
@ -323,7 +323,7 @@ if ($id > 0)
}
if ($tab[$i]['socid'] < 0)
{
print $mysoc->nom;
print $mysoc->name;
}
if (! $tab[$i]['socid'])
{

View File

@ -123,10 +123,10 @@ class html_cerfafr extends ModeleDon
$html = str_replace('__AMOUNT__',$don->amount,$html);
$html = str_replace('__CURRENCY__',$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie),$html);
$html = str_replace('__CURRENCYCODE__',$conf->monnaie,$html);
$html = str_replace('__MAIN_INFO_SOCIETE_NOM__',$mysoc->nom,$html);
$html = str_replace('__MAIN_INFO_SOCIETE_NOM__',$mysoc->name,$html);
$html = str_replace('__MAIN_INFO_SOCIETE_ADRESSE__',$mysoc->address,$html);
$html = str_replace('__MAIN_INFO_SOCIETE_CP__',$mysoc->cp,$html);
$html = str_replace('__MAIN_INFO_SOCIETE_VILLE__',$mysoc->ville,$html);
$html = str_replace('__MAIN_INFO_SOCIETE_CP__',$mysoc->zip,$html);
$html = str_replace('__MAIN_INFO_SOCIETE_VILLE__',$mysoc->town,$html);
$html = str_replace('__DONATOR_NAME__',$don->nom,$html);
$html = str_replace('__DONATOR_ADDRESS__',$don->adresse,$html);
$html = str_replace('__DONATOR_ZIP__',$don->cp,$html);

View File

@ -470,7 +470,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$larg_sign = ($this->page_largeur-$this->marge_gauche-$this->marge_droite)/3;
$pdf->Rect($this->marge_gauche, ($tab_top + $tab_height + 3), $larg_sign, 25 );
$pdf->SetXY ($this->marge_gauche + 2, $tab_top + $tab_height + 5);
$pdf->MultiCell($larg_sign,2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->nom).":",'','L');
$pdf->MultiCell($larg_sign,2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":",'','L');
$pdf->Rect(2*$larg_sign+$this->marge_gauche, ($tab_top + $tab_height + 3), $larg_sign, 25 );
$pdf->SetXY (2*$larg_sign+$this->marge_gauche + 2, $tab_top + $tab_height + 5);

View File

@ -425,7 +425,7 @@ class pdf_standard {
$pdf->SetSubject($outputlangs->transnoentities("MembersCards"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->transnoentities('MembersCards')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->nom));
$pdf->SetKeyWords($outputlangs->transnoentities('MembersCards')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->name));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins(0,0);

View File

@ -404,7 +404,7 @@ class pdf_standardlabel {
$pdf->SetSubject($outputlangs->transnoentities("MembersLabels"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->transnoentities('MembersLabels')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->nom));
$pdf->SetKeyWords($outputlangs->transnoentities('MembersLabels')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->name));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins(0,0);

View File

@ -797,7 +797,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
// Nom emetteur
$carac_emetteur_name=$outputlangs->convToOutputCharset($mysoc->nom);
$carac_emetteur_name=$outputlangs->convToOutputCharset($mysoc->name);
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('','B', $default_font_size);
$pdf->SetXY($this->marge_gauche+2,$posy+3);

View File

@ -720,7 +720,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
// Nom emetteur
$carac_emetteur_name=$outputlangs->convToOutputCharset($mysoc->nom);
$carac_emetteur_name=$outputlangs->convToOutputCharset($mysoc->name);
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('','B', $default_font_size);
$pdf->SetXY($this->marge_gauche+2,$posy+3);

View File

@ -243,14 +243,10 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC'))
$mysoc->id=0;
$mysoc->nom=$conf->global->MAIN_INFO_SOCIETE_NOM; // TODO deprecated
$mysoc->name=$conf->global->MAIN_INFO_SOCIETE_NOM;
$mysoc->adresse=$conf->global->MAIN_INFO_SOCIETE_ADRESSE; // TODO deprecated
$mysoc->address=$conf->global->MAIN_INFO_SOCIETE_ADRESSE;
$mysoc->cp=$conf->global->MAIN_INFO_SOCIETE_CP; // TODO deprecated
$mysoc->zip=$conf->global->MAIN_INFO_SOCIETE_CP;
$mysoc->ville=$conf->global->MAIN_INFO_SOCIETE_VILLE; // TODO deprecated
$mysoc->town=$conf->global->MAIN_INFO_SOCIETE_VILLE;
$mysoc->state_id=$conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT;
$mysoc->departement_id=$conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT; // TODO deprecated
$mysoc->note=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE;
// We define pays_id, pays_code and pays_label

View File

@ -161,18 +161,19 @@ class Societe extends CommonObject
/**
* \brief Create third party in database
* \param user Object of user that ask creation
* \return int >= 0 if OK, < 0 if KO
* Create third party in database
* @param user Object of user that ask creation
* @return int >= 0 if OK, < 0 if KO
*/
function create($user='')
{
global $langs,$conf;
// Clean parameters
$this->name=trim($this->name);
$this->nom=trim($this->nom);
dol_syslog("Societe::create ".$this->nom);
dol_syslog("Societe::create ".$this->name);
// Check parameters
if (! empty($conf->global->SOCIETE_MAIL_REQUIRED) && ! isValidEMail($this->email))
@ -273,14 +274,15 @@ class Societe extends CommonObject
}
/**
* \brief Check properties of third party are ok (like name, third party codes, ...)
* \return int 0 if OK, <0 if KO
* Check properties of third party are ok (like name, third party codes, ...)
* @return int 0 if OK, <0 if KO
*/
function verify()
{
$this->errors=array();
$result = 0;
$this->name=trim($this->name);
$this->nom=trim($this->nom);
if (! $this->nom)
@ -347,13 +349,13 @@ class Societe extends CommonObject
}
/**
* \brief Update parameters of third party
* \param id id societe
* \param user Utilisateur qui demande la mise a jour
* \param call_trigger 0=non, 1=oui
* \param allowmodcodeclient Inclut modif code client et code compta
* \param allowmodcodefournisseur Inclut modif code fournisseur et code compta fournisseur
* \return int <0 si ko, >=0 si ok
* Update parameters of third party
* @param id id societe
* @param user Utilisateur qui demande la mise a jour
* @param call_trigger 0=non, 1=oui
* @param allowmodcodeclient Inclut modif code client et code compta
* @param allowmodcodefournisseur Inclut modif code fournisseur et code compta fournisseur
* @return int <0 si ko, >=0 si ok
*/
function update($id, $user='', $call_trigger=1, $allowmodcodeclient=0, $allowmodcodefournisseur=0)
{
@ -365,7 +367,8 @@ class Societe extends CommonObject
// Clean parameters
$this->id=$id;
$this->nom=trim($this->nom);
$this->nom=trim($this->nom); // TODO obsolete
$this->name=trim($this->name);
$this->adresse=trim($this->adresse); // TODO obsolete
$this->address=trim($this->address);
$this->cp=trim($this->cp);
@ -555,7 +558,7 @@ class Societe extends CommonObject
if (empty($rowid) && empty($ref) && empty($ref_ext)) return -1;
$sql = 'SELECT s.rowid, s.nom, s.entity, s.ref_ext, s.address, s.datec as dc, s.prefix_comm';
$sql = 'SELECT s.rowid, s.nom as name, s.entity, s.ref_ext, s.address, s.datec as dc, s.prefix_comm';
$sql .= ', s.price_level';
$sql .= ', s.tms as date_update';
$sql .= ', s.tel, s.fax, s.email, s.url, s.cp as zip, s.ville as town, s.note, s.client, s.fournisseur';
@ -608,8 +611,8 @@ class Societe extends CommonObject
$this->entity = $obj->entity;
$this->ref = $obj->rowid;
$this->nom = $obj->nom; // TODO obsolete
$this->name = $obj->nom;
$this->nom = $obj->name; // TODO obsolete
$this->name = $obj->name;
$this->ref_ext = $obj->ref_ext;
$this->datec = $this->db->jdate($obj->datec);
@ -629,7 +632,8 @@ class Societe extends CommonObject
$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_id = $obj->fk_departement; // TODO obsolete
$this->state_id = $obj->fk_departement;
$this->departement = $obj->fk_departement?$obj->departement:'';
$transcode=$langs->trans('StatusProspect'.$obj->fk_stcomm);
@ -1380,9 +1384,11 @@ class Societe extends CommonObject
$lien.=(!empty($this->canvas)?'&amp;canvas='.$this->canvas:'').'">';
$lienfin='</a>';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$this->nom,'company').$lienfin);
if (empty($this->name)) $this->name=$this->nom;
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$this->name,'company').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.($maxlen?dol_trunc($this->nom,$maxlen):$this->nom).$lienfin;
$result.=$lien.($maxlen?dol_trunc($this->name,$maxlen):$this->name).$lienfin;
return $result;
}
@ -1412,8 +1418,9 @@ class Societe extends CommonObject
$contact_email = $this->contact_email_array();
if ($this->email)
{
// TODO: Tester si email non deja present dans tableau contact
$contact_email[-1]=$langs->trans("ThirdParty").': '.dol_trunc($this->nom,16)." &lt;".$this->email."&gt;";
if (empty($this->name)) $this->name=$this->nom;
// TODO: Tester si email non deja present dans tableau contact
$contact_email[-1]=$langs->trans("ThirdParty").': '.dol_trunc($this->nom,16)." &lt;".$this->email."&gt;";
}
return $contact_email;
}
@ -2169,19 +2176,25 @@ class Societe extends CommonObject
if (empty($name)) $name=trim($member->nom.' '.$member->prenom);
// Positionne parametres
$this->email = $member->email;
$this->nom = $name;
$this->client = 1; // A member is a customer by default
$this->code_client = -1;
$this->code_fournisseur = -1;
$this->nom=$name; // TODO obsolete
$this->name=$name;
$this->adresse=$member->adresse; // TODO obsolete
$this->address=$member->adresse;
$this->cp=$member->cp;
$this->ville=$member->ville;
$this->pays_code=$member->pays_code;
$this->pays_id=$member->pays_id;
$this->cp=$member->cp; // TODO obsolete
$this->zip=$member->cp;
$this->ville=$member->ville; // TODO obsolete
$this->town=$member->ville;
$this->pays_code=$member->pays_code; // TODO obsolete
$this->country_code=$member->pays_code;
$this->pays_id=$member->pays_id; // TODO obsolete
$this->country_id=$member->pays_id;
$this->tel=$member->phone; // Prof phone
$this->email=$member->email;
$this->client = 1; // A member is a customer by default
$this->code_client = -1;
$this->code_fournisseur = -1;
$this->db->begin();
// Cree et positionne $this->id