Merge pull request #23633 from Hystepik/develop#1

Fix : php 8.1 warnings and dolibarr log
This commit is contained in:
Laurent Destailleur 2023-01-23 02:24:01 +01:00 committed by GitHub
commit dd4a9a94c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 10 deletions

View File

@ -226,7 +226,7 @@ if ($action == 'builddoc') {
'code'=>$code,
'encoding'=>$encoding,
'is2d'=>$is2d,
'photo'=>$barcodeimage // Photo must be a file that exists with format supported by TCPDF
'photo'=>!empty($barcodeimage) ? $barcodeimage : '' // Photo must be a file that exists with format supported by TCPDF
);
}
} else {

View File

@ -2048,7 +2048,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
}
if (!empty($contact_id) && $contact_id > 0) {
if (!is_object($cachecontacts[$contact_id])) {
if (empty($cachecontacts[$contact_id]) || !is_object($cachecontacts[$contact_id])) {
$contact = new Contact($db);
$contact->fetch($contact_id);
$cachecontacts[$contact_id] = $contact;

View File

@ -675,7 +675,7 @@ if ($object->fetch($id) >= 0) {
// Date last update
print '<td class="center nowraponall">';
print dol_print_date($obj->tms, 'dayhour');
print dol_print_date(dol_stringtotime($obj->tms), 'dayhour');
print '</td>';
// Status of recipient sending email (Warning != status of emailing)

View File

@ -101,7 +101,7 @@ if (is_resource($handle)) {
$qualified = 1;
foreach ($mailmodule->require_module as $key) {
if (!$conf->$key->enabled || (!$user->admin && $mailmodule->require_admin)) {
if (empty($conf->$key->enabled) || (!$user->admin && $mailmodule->require_admin)) {
$qualified = 0;
//print "Les pr<70>requis d'activation du module mailing ne sont pas respect<63>s. Il ne sera pas actif";
break;
@ -176,7 +176,7 @@ if ($result) {
print '<tr class="oddeven">';
print '<td class="nowrap">'.$mailstatic->getNomUrl(1).'</td>';
print '<td>'.dol_trunc($obj->title, 38).'</td>';
print '<td>'.(!empty($obj->title) ? dol_trunc($obj->title, 38) : '').'</td>';
print '<td class="center">'.dol_print_date($db->jdate($obj->date_creat), 'day').'</td>';
print '<td class="center">'.($obj->nbemail ? $obj->nbemail : "0").'</td>';
print '<td class="right">'.$mailstatic->LibStatut($obj->statut, 5).'</td>';

View File

@ -120,7 +120,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
while ($i < $num) {
$objp = $this->db->fetch_object($resql);
while ($minimumdatecformated < $objp->datec) {
$dataseries[] = array('label' => dol_print_date($minimumdatecformated, 'day'), 'data' => 0);
$dataseries[] = array('label' => dol_print_date($minimumdatec, 'day'), 'data' => 0);
$minimumdatec = dol_time_plus_duree($minimumdatec, $intervaltoadd, 'd');
$minimumdatecformated = dol_print_date($minimumdatec, 'dayrfc');
}
@ -130,7 +130,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
$i++;
}
while (count($dataseries) < $days) {
$dataseries[] = array('label' => dol_print_date($minimumdatecformated, 'day'), 'data' => 0);
$dataseries[] = array('label' => dol_print_date($minimumdatec, 'day'), 'data' => 0);
$minimumdatec = dol_time_plus_duree($minimumdatec, $intervaltoadd, 'd');
$minimumdatecformated = dol_print_date($minimumdatec, 'dayrfc');
$i++;

View File

@ -395,10 +395,10 @@ class Position extends CommonObject
foreach ($filter as $key => $value) {
if ($key == 't.rowid') {
$sqlwhere[] = $key . '=' . $value;
} elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) {
$sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\'';
} elseif ($key == 'customsql') {
$sqlwhere[] = $value;
} elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) {
$sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\'';
} elseif (strpos($value, '%') === false) {
$sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')';
} else {

View File

@ -3739,7 +3739,7 @@ if ($module == 'initmodule') {
print '</td>';
print '<td>';
print dol_escape_htmltag($menu['leftmenu']);
print !empty($menu['leftmenu']) ? dol_escape_htmltag($menu['leftmenu']) : '';
print '</td>';
print '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($menu['url']).'">';