Standardize code for action buttons Delete

This commit is contained in:
Laurent Destailleur
2022-10-10 11:39:50 +02:00
parent 221b2dc288
commit ae4f8b23d5
35 changed files with 88 additions and 135 deletions

View File

@@ -492,11 +492,8 @@ if ($action == 'create') {
}
}
if ($user->rights->deplacement->supprimer) {
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$id.'">'.$langs->trans('Delete').'</a>';
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Delete').'</a>';
}
$permissiontodelete = $user->rights->deplacement->supprimer;
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
print '</div>';
}