From 4e98f573855c645cc68b36320aff9ef69a151c02 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 17 May 2016 09:02:22 +0200 Subject: [PATCH] FIX : php strict warning --- .../commande/doc/pdf_proforma.modules.php | 4 ++-- htdocs/core/modules/modExpedition.class.php | 18 ++++++++++++------ .../societe/class/companybankaccount.class.php | 6 +++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index 1434399d225..5c77b9b7b32 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -49,7 +49,7 @@ class pdf_proforma extends pdf_einstein function __construct($db) { global $conf,$langs,$mysoc; - + parent::__construct($db); $this->name = "proforma"; @@ -66,7 +66,7 @@ class pdf_proforma extends pdf_einstein * @param Translate $outputlangs Object lang for output * @return void */ - function _pagehead(&$pdf, $object, $showaddress, $outputlangs) + function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="InvoiceProForma") { global $conf,$langs,$hookmanager; diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index ea44daee18e..4f7baff0c64 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -83,7 +83,7 @@ class modExpedition extends DolibarrModules // Constants $this->const = array(); $r=0; - + $this->const[$r][0] = "EXPEDITION_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "rouget"; @@ -125,14 +125,14 @@ class modExpedition extends DolibarrModules $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "MAIN_SUBMODULE_EXPEDITION"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "1"; $this->const[$r][3] = "Enable shipments"; $this->const[$r][4] = 0; $r++; - + // Boxes $this->boxes = array(); @@ -224,8 +224,14 @@ class modExpedition extends DolibarrModules include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $shipment=new Commande($this->db); - $idcontacts=join(',',array_keys($shipment->liste_type_contact('external','',0,0,''))); - + $contact_arrays=$shipment->liste_type_contact('external','',0,0,''); + if (is_array($contact_arrays) && count($contact_arrays)>0){ + $idcontacts=join(',',array_keys($shipment->liste_type_contact('external','',0,0,''))); + } else { + $idcontacts=0; + } + + $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]='Shipments'; // Translation key (used only if key ExportDataset_xxx_z not found) @@ -237,7 +243,7 @@ class modExpedition extends DolibarrModules $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','d.nom'=>'company','co.label'=>'company','co.code'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','c.rowid'=>"shipment",'c.ref'=>"shipment",'c.ref_customer'=>"shipment",'c.fk_soc'=>"shipment",'c.date_creation'=>"shipment",'c.date_delivery'=>"shipment",'c.tracking_number'=>'shipment','c.height'=>"shipment",'c.width'=>"shipment",'c.size'=>'shipment','c.size_units'=>'shipment','c.weight'=>"shipment",'c.weight_units'=>'shipment','c.fk_statut'=>"shipment",'c.note_public'=>"shipment",'ed.rowid'=>'shipment_line','cd.description'=>'shipment_line','ed.qty'=>"shipment_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product','p.weight'=>'product','p.weight_units'=>'product','p.volume'=>'product','p.volume_units'=>'product'); if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT)) $this->export_entities_array[$r]+=array('sp.rowid'=>'contact','sp.lastname'=>'contact','sp.firstname'=>'contact','sp.note_public'=>'contact'); $this->export_dependencies_array[$r]=array('shipment_line'=>'ed.rowid','product'=>'ed.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them - if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT)) + if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT)) { $keyforselect='socpeople'; $keyforelement='contact'; $keyforaliasextra='extra3'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index fe34f57fd6d..9fa62dea587 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -64,7 +64,7 @@ class CompanyBankAccount extends Account * @param User $user User * @return int <0 if KO, >= 0 if OK */ - function create($user='') + function create(User $user = null) { $now=dol_now(); @@ -102,7 +102,7 @@ class CompanyBankAccount extends Account * @param User $user Object user * @return int <=0 if KO, >0 if OK */ - function update($user='') + function update(User $user = null) { global $conf; @@ -205,7 +205,7 @@ class CompanyBankAccount extends Account * @param User $user User deleting * @return int <0 if KO, >0 if OK */ - function delete($user='') + function delete(User $user = null) { global $conf;