浏览代码

Fix php 8 warning on user page

Francis Appels 3 年之前
父节点
当前提交
0e2c57fe65

+ 2 - 2
htdocs/core/lib/usergroups.lib.php

@@ -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">';

+ 1 - 2
htdocs/user/bank.php

@@ -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) {

+ 5 - 2
htdocs/user/card.php

@@ -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";

+ 3 - 1
htdocs/user/clicktodial.php

@@ -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;
 			}

+ 1 - 1
htdocs/user/notify/card.php

@@ -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().'">';

+ 6 - 4
htdocs/user/param_ihm.php

@@ -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>';

+ 1 - 1
htdocs/user/perms.php

@@ -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">';