Merge pull request #6463 from laudeco/fix/expense_report_validation

use access right to validate expense report created for someone else
This commit is contained in:
Laurent Destailleur 2017-02-24 15:25:02 +01:00 committed by GitHub
commit 69eb64a975

View File

@ -2092,7 +2092,7 @@ if ($action != 'create' && $action != 'edit')
*/
if ($user->rights->expensereport->creer && $object->fk_statut==0)
{
if (in_array($object->fk_user_author, $user->getAllChildIds(1)))
if (in_array($object->fk_user_author, $user->getAllChildIds(1)) || !empty($user->rights->expensereport->writeall_advance))
{
// Modify
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$object->id.'">'.$langs->trans('Modify').'</a></div>';