Qual: uniformize code: property ->tel on objects is now ->phone

everywhere
This commit is contained in:
Laurent Destailleur 2013-09-25 19:58:22 +02:00
parent 60fbde02ac
commit 065c87d81c
17 changed files with 36 additions and 40 deletions

View File

@ -112,6 +112,8 @@ parameter. All methods addline in this case were modified to remove this paramet
4) Method ->classer_facturee() is deprecated. It must be replace with ->classifyBilled().
5) Property ->tel on objects is now ->phone
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
Fix: Display buying price on line edit when no supplier price is defined

View File

@ -564,7 +564,7 @@ class Adherent extends CommonObject
$lthirdparty->zip=$this->zip;
$lthirdparty->town=$this->town;
$lthirdparty->email=$this->email;
$lthirdparty->tel=$this->phone;
$lthirdparty->phone=$this->phone;
$lthirdparty->state_id=$this->state_id;
$lthirdparty->country_id=$this->country_id;
$lthirdparty->country_id=$this->country_id;

View File

@ -199,11 +199,11 @@ if (empty($reshook))
}
else
{
if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings');
}
else
else
{
setEventMessage($cat->error,'errors');
setEventMessage($cat->errors,'errors');
@ -305,7 +305,7 @@ if ($socid)
print '</td></tr>';
// Phone
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'</td></tr>';
// Assujeti a TVA ou pas

View File

@ -208,7 +208,7 @@ if ($act->id > 0)
{
if ($act->societe->fetch($act->societe->id))
{
print "<br>".dol_print_phone($act->societe->tel);
print "<br>".dol_print_phone($act->societe->phone);
}
}
print '</td>';

View File

@ -971,7 +971,7 @@ if ($id > 0)
{
if ($act->societe->fetch($act->societe->id))
{
print "<br>".dol_print_phone($act->societe->tel);
print "<br>".dol_print_phone($act->societe->phone);
}
}
print '</td>';

View File

@ -254,7 +254,7 @@ if ($id > 0)
print '<tr><td>'.$langs->trans("Web").'</td><td colspan="3">'.dol_print_url($object->url,'_blank').'</td></tr>';
// Phone
print '<tr><td>'.$langs->trans('Phone').'</td><td style="min-width: 25%;">'.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td style="min-width: 25%;">'.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').'</td>';
// Fax
print '<td>'.$langs->trans('Fax').'</td><td style="min-width: 25%;">'.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'</td></tr>';

View File

@ -130,7 +130,7 @@ if (empty($reshook))
$error=$object->error; $errors=$object->errors;
}
}
/*
* Confirmation desactivation
@ -152,7 +152,7 @@ if (empty($reshook))
$object->setstatus(1);
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
exit;
}
// Add contact
if ($action == 'add' && $user->rights->societe->contact->creer)
@ -344,7 +344,7 @@ else
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
}
}
@ -499,7 +499,7 @@ else
}
// Phone / Fax
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->tel; // Predefined with third party
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->phone; // Predefined with third party
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input name="phone_pro" id="phone_pro" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_pro"])?$_POST["phone_pro"]:$object->phone_pro).'"></td>';
print '<td>'.$langs->trans("PhonePerso").'</td><td><input name="phone_perso" id="phone_perso" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
@ -735,7 +735,7 @@ else
print '<textarea name="note" cols="70" rows="'.ROWS_3.'">';
print isset($_POST["note"])?$_POST["note"]:$object->note;
print '</textarea></td></tr>';
// Statut
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
print '<td>';
@ -840,7 +840,7 @@ else
else $text.=$langs->trans("UserWillBeInternalUser");
}
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes');
}
print '<table class="border" width="100%">';
@ -945,7 +945,7 @@ else
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
print nl2br($object->note);
print '</td></tr>';
// Statut
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
print '<td>';

View File

@ -70,7 +70,7 @@ $v->setTitle($contact->poste);
if ($company->id)
{
$v->setURL($company->url, "WORK");
if (! $contact->phone_pro) $v->setPhoneNumber($company->tel, "WORK;VOICE");
if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE");
if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX");
if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL");
if ($company->email != $contact->email) $v->setEmail($company->email,'internet');

View File

@ -312,7 +312,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS))
{
// Tel
if ($sourcecompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->tel);
if ($sourcecompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->phone);
// Fax
if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax);
// EMail
@ -345,7 +345,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
{
// Tel
if ($targetcontact->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->tel);
if ($targetcontact->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->phone);
// Fax
if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
// EMail
@ -363,7 +363,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
{
// Tel
if ($targetcompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->tel);
if ($targetcompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->phone);
// Fax
if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
// EMail
@ -459,7 +459,7 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
elseif ($unit=='in') $k=72;
$savx=$pdf->getX(); $savy=$pdf->getY();
$watermark_angle=atan($h/$w)/2;
$watermark_x_pos=0;
$watermark_y_pos=$h/3;
@ -1031,7 +1031,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
$libelleproduitservice=$prefix_prodserv.$ref_prodserv.$libelleproduitservice;
}
}
// Add an additional description for the category products
if (! empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && ! empty($conf->categorie->enabled))
{
@ -1047,7 +1047,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
$libelleproduitservice.='__N__'.$desccateg;
}
}
if (! empty($object->lines[$i]->date_start) || ! empty($object->lines[$i]->date_end))
{
$format='day';

View File

@ -155,7 +155,7 @@ if ($object->fetch($id))
print '<tr><td>'.$langs->trans("Web").'</td><td colspan="3">'.dol_print_url($object->url).'</td></tr>';
// Phone
print '<tr><td>'.$langs->trans("Phone").'</td><td style="min-width: 25%;">'.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans("Phone").'</td><td style="min-width: 25%;">'.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').'</td>';
// Fax
print '<td>'.$langs->trans("Fax").'</td><td style="min-width: 25%;">'.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'</td></tr>';

View File

@ -476,7 +476,7 @@ if (GETPOST("source") == 'order' && $valid)
$shipToCountryCode=$order->thirdparty->country_code;
$shipToZip=$order->thirdparty->zip;
$shipToStreet2='';
$phoneNum=$order->thirdparty->tel;
$phoneNum=$order->thirdparty->phone;
if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip)
{
print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n";
@ -583,7 +583,7 @@ if (GETPOST("source") == 'invoice' && $valid)
$shipToCountryCode=$invoice->thirdparty->country_code;
$shipToZip=$invoice->thirdparty->zip;
$shipToStreet2='';
$phoneNum=$invoice->thirdparty->tel;
$phoneNum=$invoice->thirdparty->phone;
if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip)
{
print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n";
@ -778,7 +778,7 @@ if (GETPOST("source") == 'contractline' && $valid)
$shipToCountryCode=$contract->thirdparty->country_code;
$shipToZip=$contract->thirdparty->zip;
$shipToStreet2='';
$phoneNum=$contract->thirdparty->tel;
$phoneNum=$contract->thirdparty->phone;
if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip)
{
print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n";
@ -908,7 +908,7 @@ if (GETPOST("source") == 'membersubscription' && $valid)
$shipToCountryCode=$member->country_code;
$shipToZip=$member->zip;
$shipToStreet2='';
$phoneNum=$member->tel;
$phoneNum=$member->phone;
if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip)
{
print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n";

View File

@ -142,7 +142,7 @@ if ($socid)
print '</td></tr>';
// Phone / Fax
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'</td></tr>';
print '</table>';

View File

@ -134,7 +134,7 @@ abstract class ActionsCardCommon
$this->object->town = $_POST["town"];
$this->object->country_id = $_POST["country_id"];
$this->object->state_id = $_POST["state_id"];
$this->object->tel = $_POST["tel"];
$this->object->phone = $_POST["tel"];
$this->object->fax = $_POST["fax"];
$this->object->email = trim($_POST["email"]);
$this->object->url = $_POST["url"];
@ -555,7 +555,7 @@ abstract class ActionsCardCommon
if ($this->object->isInEEC()) $this->tpl['country'] = $form->textwithpicto(($img?$img.' ':'').$this->object->country,$langs->trans("CountryIsInEEC"),1,0);
$this->tpl['country'] = ($img?$img.' ':'').$this->object->country;
$this->tpl['phone'] = dol_print_phone($this->object->tel,$this->object->country_code,0,$this->object->id,'AC_TEL');
$this->tpl['phone'] = dol_print_phone($this->object->phone,$this->object->country_code,0,$this->object->id,'AC_TEL');
$this->tpl['fax'] = dol_print_phone($this->object->fax,$this->object->country_code,0,$this->object->id,'AC_FAX');
$this->tpl['email'] = dol_print_email($this->object->email,0,$this->object->id,'AC_EMAIL');
$this->tpl['url'] = dol_print_url($this->object->url);
@ -671,7 +671,7 @@ abstract class ActionsCardCommon
$this->object->town = $_POST["town"];
$this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
$this->object->state_id = $_POST["state_id"];
$this->object->tel = $_POST["tel"];
$this->object->phone = $_POST["tel"];
$this->object->fax = $_POST["fax"];
$this->object->email = $_POST["email"];
$this->object->url = $_POST["url"];

View File

@ -403,10 +403,9 @@ class Societe extends CommonObject
$this->town = $this->town?trim($this->town):trim($this->town);
$this->state_id = trim($this->state_id);
$this->country_id = ($this->country_id > 0)?$this->country_id:$this->country_id;
$this->phone = trim($this->phone?$this->phone:$this->tel);
$this->phone = trim($this->phone);
$this->phone = preg_replace("/\s/","",$this->phone);
$this->phone = preg_replace("/\./","",$this->phone);
$this->tel = $this->phone; // TODO obsolete
$this->fax = trim($this->fax);
$this->fax = preg_replace("/\s/","",$this->fax);
$this->fax = preg_replace("/\./","",$this->fax);
@ -779,7 +778,6 @@ class Societe extends CommonObject
$this->email = $obj->email;
$this->url = $obj->url;
$this->tel = $obj->phone; // TODO obsolete
$this->phone = $obj->phone;
$this->fax = $obj->fax;
@ -1567,8 +1565,6 @@ class Societe extends CommonObject
{
global $langs;
if (empty($this->phone) && ! empty($this->tel)) $this->phone=$this->tel;
$contact_phone = $this->contact_property_array('mobile');
if ($this->phone)
{
@ -2409,7 +2405,6 @@ class Societe extends CommonObject
$this->town=$member->town;
$this->country_code=$member->country_code;
$this->country_id=$member->country_id;
$this->tel=$member->phone; // deprecated
$this->phone=$member->phone; // Prof phone
$this->email=$member->email;
@ -2497,7 +2492,6 @@ class Societe extends CommonObject
$this->country=$country_label;
if (is_object($langs)) $this->country=($langs->trans('Country'.$country_code)!='Country'.$country_code)?$langs->trans('Country'.$country_code):$country_label;
$this->tel=empty($conf->global->MAIN_INFO_SOCIETE_TEL)?'':$conf->global->MAIN_INFO_SOCIETE_TEL; // TODO deprecated
$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;

View File

@ -151,7 +151,7 @@ if ($_GET["socid"])
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->country.'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'</td></tr>';
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';

View File

@ -137,7 +137,7 @@ if ($socid)
print '</td></tr>';
// Phone / Fax
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'</td></tr>';

View File

@ -312,7 +312,7 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='')
'country_id' => $thirdparty->country_id,
'country_code' => $thirdparty->country_code,
'country' => $thirdparty->country,
'phone' => $thirdparty->tel,
'phone' => $thirdparty->phone,
'fax' => $thirdparty->fax,
'email' => $thirdparty->email,
'url' => $thirdparty->url,