New: [ task #696 ] Remove "new stdClass();" when possible

This commit is contained in:
Laurent Destailleur
2013-03-08 15:52:23 +01:00
parent e5f712fe14
commit 0fe91796ef
6 changed files with 11 additions and 13 deletions

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -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++;

View File

@@ -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;
}