Fix some core php8 warnings.

Fixing php 8 warnings seems also to solve some situations like a paiment condition removed from dictionary can not be selected.
This commit is contained in:
Francis Appels 2021-06-29 16:37:07 +02:00
parent e4f61d430f
commit 051bb3f3ef
5 changed files with 10 additions and 5 deletions

View File

@ -5085,7 +5085,12 @@ class Form
} else {
if ($selected) {
$this->load_cache_conditions_paiements();
print $this->cache_conditions_paiements[$selected]['label'];
if (isset($this->cache_conditions_paiements[$selected])) {
print $this->cache_conditions_paiements[$selected]['label'];
} else {
$langs->load('errors');
print $langs->trans('ErrorNotInDictionaryPaymentConditions');
}
} else {
print " ";
}

View File

@ -79,7 +79,6 @@ $(document).ready(function(){
function() {
console.log("tableDND end of ajax call");
if (reloadpage == 1) {
//console.log('<?php echo $urltorefreshaftermove.' - '.$_SERVER['PHP_SELF'].' - '.dol_escape_js($_SERVER['QUERY_STRING']); ?>');
<?php
$redirectURL = empty($urltorefreshaftermove) ? ($_SERVER['PHP_SELF'].'?'.dol_escape_js($_SERVER['QUERY_STRING'])) : $urltorefreshaftermove;
// remove action parameter from URL

View File

@ -105,7 +105,7 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) {
print '<td class="linecoldiscount right">'.$langs->trans('ReductionShort').'</td>';
// Fields for situation invoice
if ($this->situation_cycle_ref) {
if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) {
print '<td class="linecolcycleref right">'.$langs->trans('Progress').'</td>';
print '<td class="linecolcycleref2 right">'.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).'</td>';
}

View File

@ -132,7 +132,7 @@ if (($line->info_bits & 2) == 2) {
}
}
} else {
$format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE ? 'dayhour' : 'day';
$format = (isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) && $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 'dayhour' : 'day';
if ($line->fk_product > 0) {
print $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
@ -288,7 +288,7 @@ if (!empty($line->remise_percent) && $line->special_code != 3) {
}
// Fields for situation invoices
if ($this->situation_cycle_ref) {
if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
$coldisplay++;
print '<td class="linecolcycleref nowrap right">'.$line->situation_percent.'%</td>';

View File

@ -301,3 +301,4 @@ ErrorActionCommPropertyUserowneridNotDefined=User's owner is required
ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary
CheckVersionFail=Version check fail
ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it
ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify.