2
0
forked from Wavyzz/dolibarr

Fix: some bugs and warnings

This commit is contained in:
Regis Houssin
2018-04-18 10:13:20 +02:00
parent d6680b982a
commit ff76e60c49
4 changed files with 26 additions and 20 deletions

View File

@@ -3923,23 +3923,26 @@ abstract class CommonObject
$var = true;
$i = 0;
foreach ($this->lines as $line)
if (! empty($this->lines))
{
if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
foreach ($this->lines as $line)
{
if (empty($line->fk_parent_line))
if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
{
$parameters=array('line'=>$line,'var'=>$var,'i'=>$i);
$action='';
$hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($line->fk_parent_line))
{
$parameters=array('line'=>$line,'var'=>$var,'i'=>$i);
$action='';
$hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
}
}
else
{
$this->printOriginLine($line, $var, $restrictlist);
}
}
else
{
$this->printOriginLine($line, $var, $restrictlist);
}
$i++;
$i++;
}
}
}

View File

@@ -858,7 +858,7 @@ class FormTicketsup
// Destinataires
print '<tr class="email_line"><td>' . $langs->trans('MailRecipients') . '</td><td colspan="2">';
$ticketstat = new Ticketsup($this->db);
$res = $ticketstat->fetch('', $this->track_id);
$res = $ticketstat->fetch('', '', $this->track_id);
if ($res) {
// Retrieve email of all contacts (internal and external)
$contacts = $ticketstat->getInfosTicketInternalContact();
@@ -881,7 +881,7 @@ class FormTicketsup
$ticketstat->socid = $ticketstat->fk_soc;
$ticketstat->fetch_thirdparty();
if (!in_array($ticketstat->thirdparty->email, $sendto)) {
if (is_array($ticketstat->thirdparty->email) && !in_array($ticketstat->thirdparty->email, $sendto)) {
$sendto[] = $ticketstat->thirdparty->email . '(' . $langs->trans('Customer') . ')';
}
}