FIX #8984 button create expense report
This commit is contained in:
parent
e427496ddf
commit
c33aaa076d
@ -310,8 +310,7 @@ if ($search_status != '' && $search_status >= 0) $sql.=" AND d.fk_statut IN (".$
|
|||||||
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
|
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
|
||||||
&& (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)))
|
&& (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)))
|
||||||
{
|
{
|
||||||
$childids = $user->getAllChildIds();
|
$childids = $user->getAllChildIds(1);
|
||||||
$childids[]=$user->id;
|
|
||||||
$sql.= " AND d.fk_user_author IN (".join(',',$childids).")\n";
|
$sql.= " AND d.fk_user_author IN (".join(',',$childids).")\n";
|
||||||
}
|
}
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
@ -442,12 +441,15 @@ if ($resql)
|
|||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$user_id.'" class="butAction">'.$langs->trans("Modify").'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$user_id.'" class="butAction">'.$langs->trans("Modify").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$canedit=(($user->id == $user_id && $user->rights->expensereport->creer) || ($user->id != $user_id));
|
$childids = $user->getAllChildIds(1);
|
||||||
|
|
||||||
|
$canedit=((in_array($user_id, $childids) && $user->rights->expensereport->creer)
|
||||||
|
|| ($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->expensereport->writeall_advance));
|
||||||
|
|
||||||
// Boutons d'actions
|
// Boutons d'actions
|
||||||
if ($canedit)
|
if ($canedit)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/expensereport/card.php?action=request&id='.$user_id.'" class="butAction">'.$langs->trans("AddTrip").'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/expensereport/card.php?action=create&fk_user_author='.$fuser->id.'" class="butAction">'.$langs->trans("AddTrip").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user