Fix : php 8.0 warnings

This commit is contained in:
hystepik 2023-02-21 16:14:14 +01:00
parent b0cf8cd72d
commit e75186f6bc
9 changed files with 29 additions and 13 deletions

View File

@ -149,7 +149,9 @@ $reshook = $hookmanager->executeHooks('completeFieldsToSearchAll', $parameters,
if ($reshook > 0) {
$fieldstosearchall = $hookmanager->resArray['fieldstosearchall'];
} elseif ($reshook == 0) {
$fieldstosearchall = array_merge($fieldstosearchall, $hookmanager->resArray['fieldstosearchall']);
if (!empty($hookmanager->resArray['fieldstosearchall'])) {
$fieldstosearchall = array_merge($fieldstosearchall, $hookmanager->resArray['fieldstosearchall']);
}
}
$arrayfields = array(

View File

@ -1121,8 +1121,11 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
if ($search_note_private != '') {
$param .= '&search_note_private='.urlencode($search_note_private);
}
if ($search_birthday != '') {
$param .= '&search_birthday='.urlencode($search_birthday);
if ($search_birthday_dtstart != '') {
$param .= '&search_birthday_dtstart='.urlencode($search_birthday_dtstart);
}
if ($search_birthday_dtend != '') {
$param .= '&search_birthday_dtend='.urlencode($search_birthday_dtend);
}
if ($optioncss != '') {
$param .= '&optioncss='.urlencode($optioncss);
@ -2233,10 +2236,10 @@ function addOtherFilterSQL(&$sql, $donetodo, $now, $filters)
} elseif ($donetodo == 'done') {
$sql .= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
}
if (is_array($filters) && $filters['search_agenda_label']) {
if (is_array($filters) && !empty($filters['search_agenda_label'])) {
$sql .= natural_search('a.label', $filters['search_agenda_label']);
}
if (is_array($filters) && $filters['search_rowid']) {
if (is_array($filters) && !empty($filters['search_rowid'])) {
$sql .= natural_search('a.id', $filters['search_rowid'], 1);
}

View File

@ -108,7 +108,7 @@ if ($action == 'presend') {
$fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+');
}
$file = $fileparams['fullname'];
$file = isset($fileparams['fullname'])?$fileparams['fullname']:null;
}
}

View File

@ -2740,7 +2740,7 @@ class FactureFournisseur extends CommonInvoice
$alreadypaid = $this->alreadypaid;
}
$$datas['picto'] .= ' '.$this->getLibStatut(5, $alreadypaid);
$datas['picto'] .= ' '.$this->getLibStatut(5, $alreadypaid);
}
if ($moretitle) {
$datas['picto'] .= ' - '.$moretitle;

View File

@ -706,9 +706,9 @@ class Entrepot extends CommonObject
if (isset($this->statut)) {
$datas['picto'] .= ' '.$this->getLibStatut(5);
}
$datas['ref'] .= '<br><b>'.$langs->trans('Ref').':</b> '.(empty($this->ref) ? $this->label : $this->ref);
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.(empty($this->ref) ? $this->label : $this->ref);
if (!empty($this->lieu)) {
$datas['locationsummary'] .= '<br><b>'.$langs->trans('LocationSummary').':</b> '.$this->lieu;
$datas['locationsummary'] = '<br><b>'.$langs->trans('LocationSummary').':</b> '.$this->lieu;
}
return $datas;

View File

@ -146,6 +146,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$includeproductswithoutdesiredqty = '';
$draftorder = '';
}
$draftchecked = "";
if ($draftorder == 'on') {
$draftchecked = "checked";
}

View File

@ -52,6 +52,7 @@ $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$confirm = GETPOST('confirm', 'aZ09');
$dol_openinpopup = 0;
if (!empty($backtopagejsfields)) {
$tmpbacktopagejsfields = explode(':', $backtopagejsfields);
$dol_openinpopup = $tmpbacktopagejsfields[0];

View File

@ -1408,7 +1408,7 @@ while ($i < $imaxinloop) {
$object->opp_percent = $obj->opp_percent;
$object->opp_status = $obj->fk_opp_status;
$object->opp_status_code = $obj->opp_status_code;
$object->opp_amount = $obj->opp_ammount;
$object->opp_amount = !empty($obj->opp_ammount) ? $obj->opp_ammount : "";
$object->opp_weighted_amount = $obj->opp_weighted_amount;
$object->budget_amount = $obj->budget_amount;
$object->usage_opportunity = $obj->usage_opportunity;
@ -1646,7 +1646,11 @@ while ($i < $imaxinloop) {
//if ($obj->opp_status_code)
if (strcmp($obj->opp_amount, '')) {
print '<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1, '').'</span>';
$totalarray['val']['p.opp_amount'] += $obj->opp_amount;
if (!isset($totalarray['val']['p.opp_amount'])) {
$totalarray['val']['p.opp_amount'] = $obj->opp_amount;
} else {
$totalarray['val']['p.opp_amount'] += $obj->opp_amount;
}
}
print '</td>';
if (!$i) {
@ -1690,7 +1694,11 @@ while ($i < $imaxinloop) {
print '<td class="right">';
if ($obj->budget_amount != '') {
print '<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).'</span>';
$totalarray['val']['p.budget_amount'] += $obj->budget_amount;
if (!isset($totalarray['val']['p.budget_amount'])) {
$totalarray['val']['p.budget_amount'] = $obj->budget_amount;
} else {
$totalarray['val']['p.budget_amount'] += $obj->budget_amount;
}
}
print '</td>';
if (!$i) {

View File

@ -770,7 +770,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
if (is_array($contactsofproject) && count($contactsofproject)) {
print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300');
} else {
if ($projectid > 0 || $object->id > 0) {
if ((isset($projectid) && $projectid > 0) || $object->id > 0) {
print '<span class="opacitymedium">'.$langs->trans("NoUserAssignedToTheProject").'</span>';
} else {
print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
@ -805,6 +805,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// WYSIWYG editor
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_SOCIETE) ? $conf->global->FCKEDITOR_ENABLE_SOCIETE : 0);
$nbrows = 0;
if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) {
$nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT;
}