Merge pull request #17572 from frederic34/patch-9

fix php8 warning
This commit is contained in:
Laurent Destailleur 2021-05-11 17:59:14 +02:00 committed by GitHub
commit 8eae14fb01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,7 +91,7 @@ if ($user->socid > 0 && ($object->fk_soc != $user->socid)) {
accessforbidden();
}
// or for unauthorized internals users
if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
accessforbidden();
}
@ -146,7 +146,7 @@ if ($socid > 0) {
print dol_get_fiche_end();
}
if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
$object->next_prev_filter = "te.fk_user_assign = '".$user->id."'";
} elseif ($user->socid > 0) {
$object->next_prev_filter = "te.fk_soc = '".$user->socid."'";