diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 1a2718e7d9a..6c7c247c4b9 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015-2021 Alexandre Spangaro + * Copyright (C) 2015-2022 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018 Frédéric France * @@ -138,7 +138,7 @@ $candelete = 0; if (!empty($user->rights->expensereport->supprimer)) { $candelete = 1; } -if ($object->statut == ExpenseReport::STATUS_DRAFT && $user->rights->expensereport->write && in_array($object->fk_user_author, $childids)) { +if ($object->statut == ExpenseReport::STATUS_DRAFT && !empty($user->rights->expensereport->write) && in_array($object->fk_user_author, $childids)) { $candelete = 1; } @@ -1467,6 +1467,8 @@ if ($action == 'create') { } // Public note + $note_public = GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : ''; + print ''; print ''.$langs->trans('NotePublic').''; print ''; @@ -1476,6 +1478,8 @@ if ($action == 'create') { print ''; // Private note + $note_private = GETPOSTISSET('note_private') ? GETPOST('note_private', 'restricthtml') : ''; + if (empty($user->socid)) { print ''; print ''.$langs->trans('NotePrivate').'';