mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 17:48:25 +01:00
New: [ task #696 ] Remove "new stdClass();" when possible
This commit is contained in:
@@ -212,8 +212,7 @@ $head[$h][1] = $langs->trans("ByMonthYear");
|
|||||||
$head[$h][2] = 'byyear';
|
$head[$h][2] = 'byyear';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$object=new stdClass(); // TODO $object not defined ?
|
complete_head_from_modules($conf,$langs,null,$head,$h,'propal_stats');
|
||||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_stats');
|
|
||||||
|
|
||||||
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
||||||
|
|
||||||
|
|||||||
@@ -233,8 +233,7 @@ $h++;
|
|||||||
if ($mode == 'customer') $type='order_stats';
|
if ($mode == 'customer') $type='order_stats';
|
||||||
if ($mode == 'supplier') $type='supplier_order_stats';
|
if ($mode == 'supplier') $type='supplier_order_stats';
|
||||||
|
|
||||||
$object=new stdClass(); // TODO $object not defined ?
|
complete_head_from_modules($conf,$langs,null,$head,$h,$type);
|
||||||
complete_head_from_modules($conf,$langs,$object,$head,$h,$type);
|
|
||||||
|
|
||||||
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
||||||
|
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ $head[$h][1] = $langs->trans("ByMonthYear");
|
|||||||
$head[$h][2] = 'byyear';
|
$head[$h][2] = 'byyear';
|
||||||
$h++;
|
$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"));
|
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
||||||
|
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ $h++;
|
|||||||
if ($mode == 'customer') $type='invoice_stats';
|
if ($mode == 'customer') $type='invoice_stats';
|
||||||
if ($mode == 'supplier') $type='supplier_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"));
|
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
||||||
|
|
||||||
|
|||||||
@@ -4095,7 +4095,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
|||||||
if (verifCond($values[4]))
|
if (verifCond($values[4]))
|
||||||
{
|
{
|
||||||
if ($values[3]) $langs->load($values[3]);
|
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][1] = $langs->trans($values[2]);
|
||||||
$head[$h][2] = str_replace('+','',$values[1]);
|
$head[$h][2] = str_replace('+','',$values[1]);
|
||||||
$h++;
|
$h++;
|
||||||
@@ -4105,7 +4105,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
|||||||
{
|
{
|
||||||
if ($values[0] != $type) continue;
|
if ($values[0] != $type) continue;
|
||||||
if ($values[3]) $langs->load($values[3]);
|
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][1] = $langs->trans($values[2]);
|
||||||
$head[$h][2] = str_replace('+','',$values[1]);
|
$head[$h][2] = str_replace('+','',$values[1]);
|
||||||
$h++;
|
$h++;
|
||||||
@@ -4114,7 +4114,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
|||||||
{
|
{
|
||||||
if ($values[0] != $type) continue;
|
if ($values[0] != $type) continue;
|
||||||
if ($values[2]) $langs->load($values[2]);
|
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][1] = $langs->trans($values[1]);
|
||||||
$head[$h][2] = 'tab'.$values[1];
|
$head[$h][2] = 'tab'.$values[1];
|
||||||
$h++;
|
$h++;
|
||||||
|
|||||||
@@ -691,7 +691,7 @@ class Societe extends CommonObject
|
|||||||
$sql .= ', s.status';
|
$sql .= ', s.status';
|
||||||
$sql .= ', s.price_level';
|
$sql .= ', s.price_level';
|
||||||
$sql .= ', s.tms as date_update';
|
$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.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.capital, s.tva_intra';
|
||||||
$sql .= ', s.fk_typent as typent_id';
|
$sql .= ', s.fk_typent as typent_id';
|
||||||
@@ -730,7 +730,7 @@ class Societe extends CommonObject
|
|||||||
$num=$this->db->num_rows($resql);
|
$num=$this->db->num_rows($resql);
|
||||||
if ($num > 1)
|
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);
|
dol_syslog($this->error, LOG_ERR);
|
||||||
$result = -1;
|
$result = -1;
|
||||||
}
|
}
|
||||||
@@ -852,7 +852,7 @@ class Societe extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
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);
|
dol_syslog($this->error, LOG_ERR);
|
||||||
$result = -2;
|
$result = -2;
|
||||||
}
|
}
|
||||||
@@ -861,7 +861,7 @@ class Societe extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog('Erreur Societe::Fetch '.$this->db->error(), LOG_ERR);
|
dol_syslog($this->db->error(), LOG_ERR);
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->error();
|
||||||
$result = -3;
|
$result = -3;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user