diff --git a/ChangeLog b/ChangeLog index d5a0533b2de..b10bbf34439 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 2dae974d9c1..255eb1533d9 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -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; diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 0eba0baa68c..4fef3184c20 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -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 ''; // Phone - print ''.$langs->trans('Phone').''.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').''; + print ''.$langs->trans('Phone').''.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').''; print ''.$langs->trans('Fax').''.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').''; // Assujeti a TVA ou pas diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index b42a66dd212..3b655f726f7 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -208,7 +208,7 @@ if ($act->id > 0) { if ($act->societe->fetch($act->societe->id)) { - print "
".dol_print_phone($act->societe->tel); + print "
".dol_print_phone($act->societe->phone); } } print ''; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index a1915d29540..16d37e9c453 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -971,7 +971,7 @@ if ($id > 0) { if ($act->societe->fetch($act->societe->id)) { - print "
".dol_print_phone($act->societe->tel); + print "
".dol_print_phone($act->societe->phone); } } print ''; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 9021ad0acaf..1189b77ec57 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -254,7 +254,7 @@ if ($id > 0) print ''.$langs->trans("Web").''.dol_print_url($object->url,'_blank').''; // Phone - print ''.$langs->trans('Phone').''.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').''; + print ''.$langs->trans('Phone').''.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').''; // Fax print ''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').''; diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index e044676a3bf..d00d789475e 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -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 ''.$langs->trans("PhonePro").'phone_pro).'">'; print ''.$langs->trans("PhonePerso").'phone_perso).'">'; @@ -735,7 +735,7 @@ else print ''; - + // Statut print ''.$langs->trans("Status").''; print ''; @@ -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 ''; @@ -945,7 +945,7 @@ else print ''; - + // Statut print ''; print ''; // Phone - print ''; + print ''; // Fax print ''; diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index 85cae53fa2c..81c362633ed 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -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 ''."\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 ''."\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 ''."\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 ''."\n"; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 6c1387bc35b..ec258dda9d8 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -142,7 +142,7 @@ if ($socid) print ''; // Phone / Fax - print ''; + print ''; print ''; print '
'.$langs->trans("Note").''; print nl2br($object->note); print '
'.$langs->trans("Status").''; diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 48189eb60f6..76d73133e0f 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -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'); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 5d0facb4bdb..cffa4ff6a6d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -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'; diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 2dfe52cf5df..27beceeb979 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -155,7 +155,7 @@ if ($object->fetch($id)) print '
'.$langs->trans("Web").''.dol_print_url($object->url).'
'.$langs->trans("Phone").''.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').'
'.$langs->trans("Phone").''.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').''.$langs->trans("Fax").''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
'.$langs->trans('Phone').''.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').'
'.$langs->trans('Phone').''.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').''.$langs->trans('Fax').''.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'
'; diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index c1d9609a6c4..f58d2522079 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -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"]; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 861ad5c9ef8..c77deb37421 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -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; diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index d638db9d191..4e970dffc17 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -151,7 +151,7 @@ if ($_GET["socid"]) print ''.$langs->trans('Country').''.$soc->country.''; - print ''.$langs->trans('Phone').''.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').''; + print ''.$langs->trans('Phone').''.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').''; print ''.$langs->trans('Fax').''.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').''; print ''.$langs->trans('Web').''; diff --git a/htdocs/societe/localtaxes.php b/htdocs/societe/localtaxes.php index 80378bf65a6..68a2957eeb8 100644 --- a/htdocs/societe/localtaxes.php +++ b/htdocs/societe/localtaxes.php @@ -137,7 +137,7 @@ if ($socid) print ''; // Phone / Fax - print ''.$langs->trans('Phone').''.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').''; + print ''.$langs->trans('Phone').''.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').''; print ''.$langs->trans('Fax').''.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').''; diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 31e3f58ffce..152a28053fa 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -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,