Correction erreurs, sécurisation code, personnalisation présentation (Jordan)
This commit is contained in:
parent
717fc5320f
commit
fffbfcac93
19 changed files with 822 additions and 471 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue