Correction erreurs, sécurisation code, personnalisation présentation (Jordan)

This commit is contained in:
Jean-Christophe Engel 2026-07-02 13:38:15 +02:00
parent 717fc5320f
commit 4c71100366
19 changed files with 822 additions and 471 deletions

View file

@ -12,11 +12,13 @@ $id = (int) qg('id');
$f = $facture->get($id);
if (!$client)
if (!$f)
{
throw new UserException("Ce document n'existe pas.");
}
$csrf_key = 'delete_doc_' . $f->id;
$form->runIf(f('delete') && !$form->hasErrors(),
function () use ($facture, $f, $form)
{
@ -28,7 +30,8 @@ $form->runIf(f('delete') && !$form->hasErrors(),
{
$form->addError($e->getMessage());
}
});
}, $csrf_key);
$tpl->assign('doc', $f);
$tpl->assign(compact('csrf_key'));
$tpl->display(PLUGIN_ROOT . '/templates/facture_supprimer.tpl');