Fix: instantiate object

This commit is contained in:
Regis Houssin 2011-06-20 10:40:25 +00:00
parent 9bbc27f846
commit dbf28f42ff
2 changed files with 7 additions and 6 deletions

View File

@ -420,8 +420,9 @@ class ActionComm extends CommonObject
for($i=0;$i<$num;$i++)
{
$obj = $this->db->fetch_object($resql);
$this->fetch($obj->id);
$this->actions[$i] = $this;
$actioncommstatic = new ActionComm($this->db);
$actioncommstatic->fetch($obj->id);
$this->actions[$i] = $actioncommstatic;
}
}
$this->db->free($resql);
@ -620,15 +621,15 @@ class ActionComm extends CommonObject
$libelle=$langs->trans("Action".$this->type_code);
$libelleshort='';
}
else if (empty($this->label))
else if (empty($this->libelle))
{
$libelle=$langs->trans("Action".$this->type_code);
$libelleshort=$langs->trans("Action".$this->type_code,'','','','',$maxlength);
}
else
{
$libelle=$this->label;
$libelleshort=dol_trunc($this->label,$maxlength);
$libelle=$this->libelle;
$libelleshort=dol_trunc($this->libelle,$maxlength);
}
if ($withpicto)

View File

@ -126,7 +126,7 @@ class FormActions
print '<table class="border" width="100%">';
print '<tr '.$bc[$var].'><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans('Date').'</td><td>'.$langs->trans('Action').'</td><td>'.$langs->trans('By').'</td></tr>';
print "\n";
foreach($actioncomm->actions as $action)
{
$var=!$var;