diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index f2d6bce161a..a76b21a0371 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -212,8 +212,7 @@ $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; -$object=new stdClass(); // TODO $object not defined ? -complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_stats'); +complete_head_from_modules($conf,$langs,null,$head,$h,'propal_stats'); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 3857031febe..1c8a52e201a 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -233,8 +233,7 @@ $h++; if ($mode == 'customer') $type='order_stats'; if ($mode == 'supplier') $type='supplier_order_stats'; -$object=new stdClass(); // TODO $object not defined ? -complete_head_from_modules($conf,$langs,$object,$head,$h,$type); +complete_head_from_modules($conf,$langs,null,$head,$h,$type); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 457b1e1be2d..2c8bf25fd5c 100755 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -200,7 +200,7 @@ $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; -complete_head_from_modules($conf,$langs,$object,$head,$h,'trip_stats'); +complete_head_from_modules($conf,$langs,null,$head,$h,'trip_stats'); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 0167ba67123..968be79feb7 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -210,7 +210,7 @@ $h++; if ($mode == 'customer') $type='invoice_stats'; if ($mode == 'supplier') $type='supplier_invoice_stats'; -complete_head_from_modules($conf,$langs,$object,$head,$h,$type); +complete_head_from_modules($conf,$langs,null,$head,$h,$type); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e9ee09ae4b3..f69d7e25e47 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4095,7 +4095,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= if (verifCond($values[4])) { if ($values[3]) $langs->load($values[3]); - $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[5]), 1); + $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[5]), 1); $head[$h][1] = $langs->trans($values[2]); $head[$h][2] = str_replace('+','',$values[1]); $h++; @@ -4105,7 +4105,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= { if ($values[0] != $type) continue; if ($values[3]) $langs->load($values[3]); - $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[4]), 1); + $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[4]), 1); $head[$h][1] = $langs->trans($values[2]); $head[$h][2] = str_replace('+','',$values[1]); $h++; @@ -4114,7 +4114,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= { if ($values[0] != $type) continue; if ($values[2]) $langs->load($values[2]); - $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[3]), 1); + $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[3]), 1); $head[$h][1] = $langs->trans($values[1]); $head[$h][2] = 'tab'.$values[1]; $h++; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 16db3e5b0f5..7010c71b591 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -691,7 +691,7 @@ class Societe extends CommonObject $sql .= ', s.status'; $sql .= ', s.price_level'; $sql .= ', s.tms as date_update'; - $sql .= ', s.tel as phone, s.fax, s.email, s.url, s.zip, s.town, s.note, s.client, s.fournisseur'; + $sql .= ', s.phone, s.fax, s.email, s.url, s.zip, s.town, s.note, s.client, s.fournisseur'; $sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6'; $sql .= ', s.capital, s.tva_intra'; $sql .= ', s.fk_typent as typent_id'; @@ -730,7 +730,7 @@ class Societe extends CommonObject $num=$this->db->num_rows($resql); if ($num > 1) { - $this->error='Societe::Fetch several records found for ref='.$ref; + $this->error='Fetch several records found for ref='.$ref; dol_syslog($this->error, LOG_ERR); $result = -1; } @@ -852,7 +852,7 @@ class Societe extends CommonObject } else { - $this->error='Societe::Fetch no third party found for id='.$rowid; + $this->error='Fetch no third party found for id='.$rowid; dol_syslog($this->error, LOG_ERR); $result = -2; } @@ -861,7 +861,7 @@ class Societe extends CommonObject } else { - dol_syslog('Erreur Societe::Fetch '.$this->db->error(), LOG_ERR); + dol_syslog($this->db->error(), LOG_ERR); $this->error=$this->db->error(); $result = -3; }