Fix php 8 warning on user page

This commit is contained in:
Francis Appels 2021-07-07 14:50:10 +02:00
parent 3bc896be57
commit 0e2c57fe65
7 changed files with 19 additions and 13 deletions

View File

@ -906,7 +906,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
}
// Use MAIN_OPTIMIZEFORTEXTBROWSER
if ($foruserprofile) {
if ($foruserprofile && !empty($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) {
//$default=yn($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER);
$default = $langs->trans('No');
print '<tr class="oddeven">';
@ -953,7 +953,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
// Use MAIN_OPTIMIZEFORTEXTBROWSER
if ($foruserprofile) {
if ($foruserprofile && !empty($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND)) {
//$default=yn($conf->global->MAIN_OPTIMIZEFORCOLORBLIND);
$default = $langs->trans('No');
print '<tr class="oddeven">';

View File

@ -506,7 +506,6 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
$exp->id = $objp->rowid;
$exp->ref = $objp->ref;
$exp->fk_type = $objp->fk_type;
$exp->status = $objp->status;
print '<tr class="oddeven">';
@ -557,7 +556,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
print_liste_field_titre("RIB");
print_liste_field_titre("IBAN");
print_liste_field_titre("BIC");
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', '', '', 'maxwidthsearch ');
print "</tr>\n";
if ($account->id > 0) {

View File

@ -1451,8 +1451,11 @@ if ($action == 'create' || $action == 'adduserldap') {
print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
} else {
$huser = new User($db);
$huser->fetch($object->fk_user);
print $huser->getNomUrl(1);
if ($huser->fetch($object->fk_user) > 0) {
print $huser->getNomUrl(1);
} else {
print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
}
}
print '</td>';
print "</tr>\n";

View File

@ -150,7 +150,9 @@ if ($id > 0) {
if (!empty($user->admin)) {
print '<tr><td class="titlefield">ClickToDial URL</td>';
print '<td class="valeur">';
$url = $conf->global->CLICKTODIAL_URL;
if (!empty($conf->global->CLICKTODIAL_URL)) {
$url = $conf->global->CLICKTODIAL_URL;
}
if (!empty($object->clicktodial_url)) {
$url = $object->clicktodial_url;
}

View File

@ -437,7 +437,7 @@ if ($result > 0) {
}
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
if ($optioncss != '') {
if (!empty($optioncss)) {
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
}
print '<input type="hidden" name="token" value="'.newToken().'">';

View File

@ -370,10 +370,12 @@ if ($action == 'edit') {
print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
print '> '.$langs->trans("UsePersonalValue").'</td>';
print '<td>';
if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE])) {
print $langs->trans($tmparray[$object->conf->MAIN_LANDING_PAGE]);
} else {
print $object->conf->MAIN_LANDING_PAGE;
if (!empty($object->conf->MAIN_LANDING_PAGE)) {
if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE])) {
print $langs->trans($tmparray[$object->conf->MAIN_LANDING_PAGE]);
} else {
print $object->conf->MAIN_LANDING_PAGE;
}
}
//print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (! empty($object->conf->MAIN_LANDING_PAGE)?$object->conf->MAIN_LANDING_PAGE:''), 0, 0, 0, '', 1);
print '</td></tr>';

View File

@ -407,7 +407,7 @@ if ($result) {
print '<td class="center nowrap">';
print img_picto($langs->trans("Active"), 'tick');
print '</td>';
} elseif (is_array($permsgroupbyentity[$entity])) {
} elseif (isset($permsgroupbyentity[$entity]) && is_array($permsgroupbyentity[$entity])) {
if (in_array($obj->id, $permsgroupbyentity[$entity])) { // Permission granted by group
if ($caneditperms) {
print '<td class="center">';