'.$langs->trans('Date').' ';
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 7de64135245..7cc889a67e9 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -130,12 +130,6 @@ abstract class CommonObject
* @see fetch_thirdparty()
*/
public $thirdparty;
- /**
- * @deprecated
- * @var Societe A related customer
- * @see thirdparty
- */
- public $client;
/**
* @var User A related user
@@ -1016,12 +1010,10 @@ abstract class CommonObject
if ($idtofetch) {
$thirdparty = new Societe($this->db);
$result = $thirdparty->fetch($idtofetch);
- $this->client = $thirdparty; // deprecated
$this->thirdparty = $thirdparty;
// Use first price level if level not defined for third party
if (!empty($conf->global->PRODUIT_MULTIPRICES) && empty($this->thirdparty->price_level)) {
- $this->client->price_level = 1; // deprecated
$this->thirdparty->price_level = 1;
}
diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php
index 90bf948e215..2499176b58b 100644
--- a/htdocs/core/class/dolreceiptprinter.class.php
+++ b/htdocs/core/class/dolreceiptprinter.class.php
@@ -300,17 +300,17 @@ class dolReceiptPrinter extends Escpos
function selectTypePrinter($selected='', $htmlname='printertypeid')
{
global $langs;
- $error = 0;
- $html = '';
- $html.= ''.$langs->trans('CONNECTOR_DUMMY').' ';
- $html.= ''.$langs->trans('CONNECTOR_FILE_PRINT').' ';
- $html.= ''.$langs->trans('CONNECTOR_NETWORK_PRINT').' ';
- $html.= ''.$langs->trans('CONNECTOR_WINDOWS_PRINT').' ';
- //$html.= ''.$langs->trans('CONNECTOR_JAVA').' ';
- $html.= ' ';
-
- $this->resprint = $html;
- return $error;
+
+ $options = array(
+ 1 => $langs->trans('CONNECTOR_DUMMY'),
+ 2 => $langs->trans('CONNECTOR_FILE_PRINT'),
+ 3 => $langs->trans('CONNECTOR_NETWORK_PRINT'),
+ 4 => $langs->trans('CONNECTOR_WINDOWS_PRINT')
+ );
+
+ $this->resprint = Form::selectarray($htmlname, $options, $selected);
+
+ return 0;
}
@@ -324,17 +324,17 @@ class dolReceiptPrinter extends Escpos
function selectProfilePrinter($selected='', $htmlname='printerprofileid')
{
global $langs;
- $error = 0;
- $html = '';
- $html.= ''.$langs->trans('PROFILE_DEFAULT').' ';
- $html.= ''.$langs->trans('PROFILE_SIMPLE').' ';
- $html.= ''.$langs->trans('PROFILE_EPOSTEP').' ';
- $html.= ''.$langs->trans('PROFILE_P822D').' ';
- $html.= ''.$langs->trans('PROFILE_STAR').' ';
- $html.= ' ';
-
- $this->profileresprint = $html;
- return $error;
+
+ $options = array(
+ 0 => $langs->trans('PROFILE_DEFAULT'),
+ 1 => $langs->trans('PROFILE_SIMPLE'),
+ 2 => $langs->trans('PROFILE_EPOSTEP'),
+ 3 => $langs->trans('PROFILE_P822D'),
+ 4 => $langs->trans('PROFILE_STAR')
+ );
+
+ $this->profileresprint = Form::selectarray($htmlname, $options, $selected);
+ return 0;
}
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index 9091b4aead0..d51765e2a16 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -146,9 +146,6 @@ class FormCompany
print '';
print '';
- print '';
- if ($empty) print ' ';
-
dol_syslog(get_class($this).'::form_prospect_level',LOG_DEBUG);
$sql = "SELECT code, label";
$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
@@ -157,25 +154,25 @@ class FormCompany
$resql = $this->db->query($sql);
if ($resql)
{
- $num = $this->db->num_rows($resql);
- $i = 0;
- while ($i < $num)
- {
- $obj = $this->db->fetch_object($resql);
+ $options = array();
- print 'code) print ' selected';
- print '>';
- $level=$langs->trans($obj->code);
- if ($level == $obj->code) $level=$langs->trans($obj->label);
- print $level;
- print ' ';
-
- $i++;
+ if ($empty) {
+ $options[''] = '';
}
+
+ while ($obj = $this->db->fetch_object($resql)) {
+ $level = $langs->trans($obj->code);
+
+ if ($level == $obj->code) {
+ $level = $langs->trans($obj->label);
+ }
+
+ $options[$obj->code] = $level;
+ }
+
+ print Form::selectarray($htmlname, $options, $selected);
}
else dol_print_error($this->db);
- print ' ';
print ' ';
print ' ';
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 46b485d8a3c..23b0fc5d6e2 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -920,6 +920,7 @@ class FormMail extends Form
*/
function setSubstitFromObject($object)
{
+ global $user;
$this->substit['__REF__'] = $object->ref;
$this->substit['__SIGNATURE__'] = $user->signature;
$this->substit['__REFCLIENT__'] = $object->ref_client;
diff --git a/htdocs/core/class/html.formmailing.class.php b/htdocs/core/class/html.formmailing.class.php
index 3c47aceee8a..0c63049f9d8 100644
--- a/htdocs/core/class/html.formmailing.class.php
+++ b/htdocs/core/class/html.formmailing.class.php
@@ -27,22 +27,8 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php';
*/
class FormMailing extends Form
{
- public $db;
- public $error;
public $errors=array();
-
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- */
- function __construct($db)
- {
- $this->db = $db;
- return 1;
- }
-
/**
* Output a select with destinaries status
*
@@ -59,26 +45,14 @@ class FormMailing extends Form
require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php';
$mailing = new Mailing($this->db);
-
- $array = $mailing->statut_dest;
- //Cannot use form->selectarray because empty value is defaulted to -1 in this method and we use here status -1...
-
- $out = '';
+ $options = array();
if ($show_empty) {
- $out .= ' ';
+ $options[''] = '';
}
- foreach($mailing->statut_dest as $id=>$status) {
- if ($selectedid==$id) {
- $selected=" selected ";
- }else {
- $selected="";
- }
- $out .= ''.$langs->trans($status).' ';
- }
+ $options = array_merge($options, $mailing->statut_dest);
- $out .= ' ';
- return $out;
+ return Form::selectarray($htmlname, $options, $selectedid, 0, 0, 0, '', 1);
}
}
diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php
index 4ecbef60b58..68fa96e03ee 100644
--- a/htdocs/core/class/html.formorder.class.php
+++ b/htdocs/core/class/html.formorder.class.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2016 Marcos García
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,29 +22,14 @@
* \brief File of predefined functions for HTML forms for order module
*/
+require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php';
/**
* Class to manage HTML output components for orders
* Before adding component here, check they are not into common part Form.class.php
*/
-class FormOrder
+class FormOrder extends Form
{
- var $db;
- var $error;
-
-
-
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- */
- function __construct($db)
- {
- $this->db = $db;
- return 1;
- }
-
/**
* Return combo list of differents status of a orders
@@ -53,51 +39,32 @@ class FormOrder
* @param string $hmlname Name of HTML select element
* @return void
*/
- function selectSupplierOrderStatus($selected='', $short=0, $hmlname='order_status')
+ public function selectSupplierOrderStatus($selected='', $short=0, $hmlname='order_status')
{
- $tmpsupplierorder=new CommandeFournisseur($db);
-
- print '';
- print ' ';
- $statustohow=array('0'=>'0','1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6,7','9'=>'9'); // 7 is same label than 6. 8 does not exists (billed is another field)
+ $options = array();
- foreach($statustohow as $key => $value)
- {
- print '';
- $tmpsupplierorder->statut=$key;
- print $tmpsupplierorder->getLibStatut($short);
- print ' ';
- }
- print ' ';
+ // 7 is same label than 6. 8 does not exists (billed is another field)
+ $statustohow = array(
+ '0' => '0',
+ '1' => '1',
+ '2' => '2',
+ '3' => '3',
+ '4' => '4',
+ '5' => '5',
+ '6' => '6,7',
+ '9' => '9'
+ );
+
+ $tmpsupplierorder = new CommandeFournisseur($this->db);
+
+ foreach ($statustohow as $key => $value) {
+ $tmpsupplierorder->statut = $key;
+ $options[$value] = $tmpsupplierorder->getLibStatut($short);
+ }
+
+ print Form::selectarray($hmlname, $options, $selected, 1);
}
- /**
- * Return list of way to order
- *
- * @param string $selected Id of preselected order origin
- * @param string $htmlname Name of HTML select list
- * @param int $addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
- * @return array Tableau des sources de commandes
- */
- function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0)
- {
- global $conf,$langs;
- print '';
- if ($addempty) print ' ';
-
- // TODO Use the table called llx_c_input_reason
- print ''.$langs->trans('OrderSource0').' ';
- print ''.$langs->trans('OrderSource1').' ';
- print ''.$langs->trans('OrderSource2').' ';
- print ''.$langs->trans('OrderSource3').' ';
- print ''.$langs->trans('OrderSource4').' ';
- print ''.$langs->trans('OrderSource5').' ';
- print ''.$langs->trans('OrderSource6').' ';
-
- print ' ';
- }
-
-
/**
* Return list of input method (mode used to receive order, like order received by email, fax, online)
* List found into table c_input_method.
@@ -107,11 +74,9 @@ class FormOrder
* @param int $addempty 0=list with no empty value, 1=list with empty value
* @return array Tableau des sources de commandes
*/
- function selectInputMethod($selected='',$htmlname='source_id',$addempty=0)
+ public function selectInputMethod($selected='',$htmlname='source_id',$addempty=0)
{
- global $conf,$langs,$form;
-
- if (! is_object($form)) $form=new Form($this->db);
+ global $langs;
$listofmethods=array();
@@ -121,24 +86,18 @@ class FormOrder
dol_syslog(get_class($this)."::selectInputMethod", LOG_DEBUG);
$resql=$this->db->query($sql);
- if ($resql)
- {
- $i = 0;
- $num = $this->db->num_rows($resql);
- while ($i < $num)
- {
- $obj = $this->db->fetch_object($resql);
- $listofmethods[$obj->rowid] = $langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):$obj->label;
- $i++;
- }
- }
- else
- {
+
+ if (!$resql) {
dol_print_error($this->db);
return -1;
}
- print $form->selectarray($htmlname,$listofmethods,$selected,$addempty);
+ while ($obj = $this->db->fetch_object($resql)) {
+ $listofmethods[$obj->rowid] = $langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : $obj->label;
+ }
+
+ print Form::selectarray($htmlname,$listofmethods,$selected,$addempty);
+
return 1;
}
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index e2d63d6d151..8631c576576 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -57,17 +57,17 @@ function societe_prepare_head(Societe $object)
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client==1 || $object->client==3)) $head[$h][1] .= $langs->trans("Customer");
$head[$h][2] = 'customer';
$h++;
- }
- if (($object->client==1 || $object->client==2 || $object->client==3) && (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)))
- {
- $langs->load("products");
- // price
- $head[$h][0] = DOL_URL_ROOT.'/societe/price.php?socid='.$object->id;
- $head[$h][1] = $langs->trans("CustomerPrices");
- $head[$h][2] = 'price';
- $h++;
- }
+ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
+ {
+ $langs->load("products");
+ // price
+ $head[$h][0] = DOL_URL_ROOT.'/societe/price.php?socid='.$object->id;
+ $head[$h][1] = $langs->trans("CustomerPrices");
+ $head[$h][2] = 'price';
+ $h++;
+ }
+ }
if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire))
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/card.php?socid='.$object->id;
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 7d8ac5f1750..9be021b975e 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1358,7 +1358,7 @@ function dol_meta_create($object)
if (is_dir($dir))
{
$nblignes = count($object->lines);
- $client = $object->client->name . " " . $object->client->address . " " . $object->client->zip . " " . $object->client->town;
+ $client = $object->thirdparty->name . " " . $object->thirdparty->address . " " . $object->thirdparty->zip . " " . $object->thirdparty->town;
$meta = "REFERENCE=\"" . $object->ref . "\"
DATE=\"" . dol_print_date($object->date,'') . "\"
NB_ITEMS=\"" . $nblignes . "\"
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 6b69427eacd..befcf4ef4ff 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3929,13 +3929,10 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller)
* @return float Taux de tva a appliquer, -1 si ne peut etre determine
* @see get_default_npr, get_default_localtax
*/
-function get_default_tva($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
+function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
{
global $conf;
- if (!is_object($thirdparty_seller)) return -1;
- if (!is_object($thirdparty_buyer)) return -1;
-
// Note: possible values for tva_assuj are 0/1 or franchise/reel
$seller_use_vat=((is_numeric($thirdparty_seller->tva_assuj) && ! $thirdparty_seller->tva_assuj) || (! is_numeric($thirdparty_seller->tva_assuj) && $thirdparty_seller->tva_assuj=='franchise'))?0:1;
@@ -4012,7 +4009,7 @@ function get_default_tva($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idpr
* @return float 0 or 1
* @see get_default_tva, get_default_localtax
*/
-function get_default_npr($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
+function get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
{
global $db;
diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index 84dec7b817e..9e26b31b0ce 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -289,11 +289,11 @@ class doc_generic_order_odt extends ModelePDFCommandes
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
- else $socobject = $object->client;
+ else $socobject = $object->thirdparty;
}
else
{
- $socobject=$object->client;
+ $socobject=$object->thirdparty;
}
// Make substitution
diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
index 25ae8c7f015..f8097249a5b 100644
--- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php
+++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
@@ -556,12 +556,12 @@ class pdf_strato extends ModelePDFContract
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_creation,"day",false,$outputlangs,true), '', 'R');
- if ($object->client->code_client)
+ if ($object->thirdparty->code_client)
{
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
- $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
+ $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
}
if ($showaddress)
@@ -576,7 +576,7 @@ class pdf_strato extends ModelePDFContract
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n";
}
- $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client);
+ $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
// Show sender
$posy=42;
@@ -614,19 +614,19 @@ class pdf_strato extends ModelePDFContract
$result=$object->fetch_contact($arrayidcontact[0]);
}
- $this->recipient = $object->client;
+ $this->recipient = $object->thirdparty;
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
- $thirdparty = $object->client;
+ $thirdparty = $object->thirdparty;
}
$this->recipient->name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
- $carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target', $object);
+ $carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact)?$object->contact:''), $usecontact, 'target', $object);
// Show recipient
$widthrecbox=100;
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index c2fcf108c10..2693a4f013a 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -289,11 +289,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
- else $socobject = $object->client;
+ else $socobject = $object->thirdparty;
}
else
{
- $socobject=$object->client;
+ $socobject=$object->thirdparty;
}
// Make substitution
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 2cd392a0bd6..a8baaab2282 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -291,14 +291,14 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
- $socobject = $object->client;
+ $socobject = $object->thirdparty;
// if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
}
else
{
- $socobject=$object->client;
+ $socobject=$object->thirdparty;
}
// Fetch info for linked propal
diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
index ae96756b9f0..ddbea30e833 100644
--- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
@@ -1061,7 +1061,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
if ($showaddress)
{
// Sender properties
- $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client);
+ $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
// Show sender
$posy=42;
diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
index 2d30037878d..225ff02e629 100644
--- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
@@ -1113,7 +1113,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if ($showaddress)
{
// Sender properties
- $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client);
+ $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
// Show sender
$posy=42;
@@ -1158,12 +1158,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
- $thirdparty = $object->client;
+ $thirdparty = $object->thirdparty;
}
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
- $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target',$object);
+ $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->thirdparty,($usecontact?$object->contact:''),$usecontact,'target',$object);
// Show recipient
$widthrecbox=100;
diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
index d1386d646a5..212685ba519 100644
--- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
@@ -320,11 +320,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
- else $socobject = $object->client;
+ else $socobject = $object->thirdparty;
}
else
{
- $socobject=$object->client;
+ $socobject=$object->thirdparty;
}
// Make substitution
diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
index 0a5d4a81ed6..5c85309ed8c 100644
--- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
+++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
@@ -803,7 +803,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->fk_element = $object->id;
$actioncomm->elementtype = $object->element;
- $ret=$actioncomm->add($user); // User creating action
+ $ret=$actioncomm->create($user); // User creating action
unset($object->actionmsg); unset($object->actionmsg2); unset($object->actiontypecode); // When several action are called on same object, we must be sure to not reuse value of first action.
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index cd8a2e174f8..fab2560f816 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -264,7 +264,7 @@ if ($action == 'builddoc')
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 8f461a2a0c0..4547a94566a 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -501,7 +501,7 @@ if (empty($reshook))
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id','alpha');
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$shipment->client->default_lang;
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$shipment->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
@@ -1562,7 +1562,7 @@ else if ($id || $ref)
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id','alpha');
- if (empty($newlang)) $newlang=$object->client->default_lang;
+ if (empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
@@ -1850,7 +1850,7 @@ else if ($id || $ref)
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang))
- $newlang = $object->client->default_lang;
+ $newlang = $object->thirdparty->default_lang;
if (!empty($newlang))
{
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 2677d06ec7b..5de764922e1 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -530,7 +530,7 @@ if ($id > 0 || ! empty($ref))
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
- if (empty($newlang)) $newlang=$commande->client->default_lang;
+ if (empty($newlang)) $newlang=$commande->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index 7ed8d96634c..c374a1d9fb0 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -123,7 +123,7 @@ if (empty($reshook))
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
@@ -152,7 +152,7 @@ if (empty($reshook))
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
@@ -410,7 +410,7 @@ if (empty($reshook))
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
@@ -515,7 +515,7 @@ if (empty($reshook))
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
@@ -612,7 +612,7 @@ if (empty($reshook))
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
@@ -647,7 +647,7 @@ if (empty($reshook))
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
@@ -668,7 +668,7 @@ if (empty($reshook))
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
@@ -688,7 +688,7 @@ if (empty($reshook))
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
@@ -750,12 +750,12 @@ if (empty($reshook))
// Recipient was provided from combo list
if (GETPOST('receiver','alpha') == 'thirdparty') // Id of third party
{
- $sendto = $object->client->email;
+ $sendto = $object->thirdparty->email;
$sendtoid = 0;
}
else // Id du contact
{
- $sendto = $object->client->contact_get_property(GETPOST('receiver'),'email');
+ $sendto = $object->thirdparty->contact_get_property(GETPOST('receiver'),'email');
$sendtoid = GETPOST('receiver','alpha');
}
}
@@ -1261,12 +1261,6 @@ else if ($id > 0 || ! empty($ref))
// Print form confirm
print $formconfirm;
- print '';
-
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$blocname = 'contacts';
@@ -1824,7 +1816,7 @@ else if ($id > 0 || ! empty($ref))
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang))
- $newlang = $object->client->default_lang;
+ $newlang = $object->thirdparty->default_lang;
if (!empty($newlang))
{
diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php
index b92c1442d14..b64a16f91ba 100644
--- a/htdocs/fichinter/contact.php
+++ b/htdocs/fichinter/contact.php
@@ -133,11 +133,11 @@ if ($id > 0 || ! empty($ref))
print " ";
// Customer
- if ( is_null($object->client) )
+ if ( is_null($object->thirdparty) )
$object->fetch_thirdparty();
print "".$langs->trans("Company")." ";
- print ''.$object->client->getNomUrl(1).' ';
+ print ''.$object->thirdparty->getNomUrl(1).' ';
print "
";
print '';
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index 38176068d72..aca31d4e7c2 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -111,7 +111,7 @@ if ($object->id)
print ' ';
// Societe
- print "