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') . ')';
}
}

View File

@@ -134,7 +134,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be inc
$userstat = new User($db);
$form = new Form($db);
$formticket = new FormTicketsup($db);
$formproject = new FormProjets($db);
if (! empty($conf->projet->enabled)) {
$formproject = new FormProjets($db);
}
if ($action == 'view' || $action == 'add_message' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen'
|| $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink')
@@ -631,15 +634,15 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
print '<div class="tagtd">';
print dol_print_phone($tab[$i]['phone'], '', '', '', AC_TEL).'<br>';
print dol_print_phone($tab[$i]['phone'], '', '', '', 'AC_TEL').'<br>';
if (! empty($tab[$i]['phone_perso'])) {
//print img_picto($langs->trans('PhonePerso'),'object_phoning.png','',0,0,0).' ';
print '<br>'.dol_print_phone($tab[$i]['phone_perso'], '', '', '', AC_TEL).'<br>';
print '<br>'.dol_print_phone($tab[$i]['phone_perso'], '', '', '', 'AC_TEL').'<br>';
}
if (! empty($tab[$i]['phone_mobile'])) {
//print img_picto($langs->trans('PhoneMobile'),'object_phoning.png','',0,0,0).' ';
print dol_print_phone($tab[$i]['phone_mobile'], '', '', '', AC_TEL).'<br>';
print dol_print_phone($tab[$i]['phone_mobile'], '', '', '', 'AC_TEL').'<br>';
}
print '</div>';

View File

@@ -1639,7 +1639,7 @@ class Ticketsup extends CommonObject
{
global $langs;
if (count($this->cache_logs_ticket)) {
if (is_array($this->cache_logs_ticket) && count($this->cache_logs_ticket)) {
return 0;
}
// Cache deja charge
@@ -1751,7 +1751,7 @@ class Ticketsup extends CommonObject
{
global $langs;
if (count($this->cache_msgs_ticket)) {
if (is_array($this->cache_msgs_ticket) && count($this->cache_msgs_ticket)) {
return 0;
}
// Cache deja charge