Fix warning

This commit is contained in:
Laurent Destailleur 2023-01-14 11:54:05 +01:00
parent 79ecc945e9
commit b7c56f5680
2 changed files with 9 additions and 9 deletions

View File

@ -188,7 +188,8 @@ if ($action == 'create') {
// Visibility / Owner
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx');
print img_picto('', 'user', 'class="pictofixedwidth"');
print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx');
print '</td><td class="hideonsmartphone"></td></tr>';
// Position
@ -282,12 +283,13 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
// Visibility / owner
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
if ($action == 'edit' && $user->admin) {
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx');
print img_picto('', 'user', 'class="pictofixedwidth"');
print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx');
} else {
if ($object->fk_user > 0) {
$fuser = new User($db);
$fuser->fetch($object->fk_user);
print $fuser->getNomUrl(1);
print $fuser->getNomUrl(-1);
} else {
print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
}

View File

@ -212,8 +212,6 @@ print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $par
print_liste_field_titre('');
print "</tr>\n";
$cacheOfUsers = array();
$i = 0;
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);
@ -268,13 +266,13 @@ while ($i < min($num, $limit)) {
// Author
print '<td class="center">';
if ($obj->fk_user) {
if (empty($cacheOfUsers[$obj->fk_user])) {
if (empty($conf->cache['users'][$obj->fk_user])) {
$tmpuser = new User($db);
$tmpuser->fetch($obj->fk_user);
$cacheOfUsers[$obj->fk_user] = $tmpuser;
$conf->cache['users'][$obj->fk_user] = $tmpuser;
}
$tmpuser = $cacheOfUsers[$obj->fk_user];
print $tmpuser->getNomUrl(1);
$tmpuser = $conf->cache['users'][$obj->fk_user];
print $tmpuser->getNomUrl(-1);
} else {
print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
if (!$user->admin) {