Changement d'année fiscale avec boîte dialogue
FossilOrigin-Name: 605e1489aaf780359cba3fd9519cf53b1cc936abc5891e09e28693e35102cf30
This commit is contained in:
parent
095df94e2f
commit
37b05bfe6a
|
@ -12,14 +12,13 @@ if ($anneesFiscales[0] < $anneeCourante) {
|
|||
array_unshift($anneesFiscales, $anneeCourante);
|
||||
}
|
||||
|
||||
if (f('change'))
|
||||
{
|
||||
$csrf_key = 'acc_select_year';
|
||||
$form->runIf('change', function () {
|
||||
$_SESSION['annee_recu'] = f('annee_recu');
|
||||
\Paheko\Utils::redirect(f('from') ?: \Paheko\Utils::plugin_url());
|
||||
}
|
||||
}, $csrf_key, PLUGIN_ROOT . '/admin/index.php');
|
||||
|
||||
$tpl->assign(compact('anneesFiscales', 'csrf_key'));
|
||||
|
||||
$tpl->assign('anneesFiscales', $anneesFiscales);
|
||||
$tpl->assign('annee_recu', $_SESSION['annee_recu']);
|
||||
$tpl->assign('from', qg('from'));
|
||||
|
||||
$tpl->display(PLUGIN_ROOT . '/templates/choix_annee.tpl');
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
</select>
|
||||
</fieldset>
|
||||
<p class="submit">
|
||||
{csrf_field key="acc_select_year"}
|
||||
<input type="hidden" name="from" value="{$from}" />
|
||||
{csrf_field key=$csrf_key}
|
||||
{button type="submit" name="change" label="Changer" shape="right" class="main"}
|
||||
</p>
|
||||
</form>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<nav class="acc-year">
|
||||
<h4>Année fiscale sélectionnée :</h4>
|
||||
<h3>{$annee_recu}</h3>
|
||||
<footer>{linkbutton label="Changer d'année fiscale" href="%s/choix_annee.php?from=%s"|args:$plugin_url,rawurlencode($self_url) shape="settings"}</footer>
|
||||
<footer>{linkbutton label="Changer d'année fiscale" target="_dialog" href="%s/choix_annee.php"|args:$plugin_url shape="settings"}</footer>
|
||||
</nav>
|
||||
|
||||
<form id="formulaire_saisie" method="post" action="action.php">
|
||||
|
|
Loading…
Reference in New Issue