Compare commits

..

No commits in common. "37b05bfe6ab828b0e84b2ac430cf0520a7c6eaaa" and "200e4e873a85cc0d81c2a9f8f5fef0db3af4341c" have entirely different histories.

4 changed files with 15 additions and 9 deletions

View File

@ -12,13 +12,14 @@ if ($anneesFiscales[0] < $anneeCourante) {
array_unshift($anneesFiscales, $anneeCourante); array_unshift($anneesFiscales, $anneeCourante);
} }
$csrf_key = 'acc_select_year'; if (f('change'))
$form->runIf('change', function () { {
$_SESSION['annee_recu'] = f('annee_recu'); $_SESSION['annee_recu'] = f('annee_recu');
}, $csrf_key, PLUGIN_ROOT . '/admin/index.php'); \Paheko\Utils::redirect(f('from') ?: \Paheko\Utils::plugin_url());
}
$tpl->assign(compact('anneesFiscales', 'csrf_key'));
$tpl->assign('anneesFiscales', $anneesFiscales);
$tpl->assign('annee_recu', $_SESSION['annee_recu']); $tpl->assign('annee_recu', $_SESSION['annee_recu']);
$tpl->assign('from', qg('from'));
$tpl->display(PLUGIN_ROOT . '/templates/choix_annee.tpl'); $tpl->display(PLUGIN_ROOT . '/templates/choix_annee.tpl');

View File

@ -11,7 +11,8 @@
</select> </select>
</fieldset> </fieldset>
<p class="submit"> <p class="submit">
{csrf_field key=$csrf_key} {csrf_field key="acc_select_year"}
<input type="hidden" name="from" value="{$from}" />
{button type="submit" name="change" label="Changer" shape="right" class="main"} {button type="submit" name="change" label="Changer" shape="right" class="main"}
</p> </p>
</form> </form>

View File

@ -4,7 +4,7 @@
<nav class="acc-year"> <nav class="acc-year">
<h4>Année fiscale sélectionnée&nbsp;:</h4> <h4>Année fiscale sélectionnée&nbsp;:</h4>
<h3>{$annee_recu}</h3> <h3>{$annee_recu}</h3>
<footer>{linkbutton label="Changer d'année fiscale" target="_dialog" href="%s/choix_annee.php"|args:$plugin_url shape="settings"}</footer> <footer>{linkbutton label="Changer d'année fiscale" href="%s/choix_annee.php?from=%s"|args:$plugin_url,rawurlencode($self_url) shape="settings"}</footer>
</nav> </nav>
<form id="formulaire_saisie" method="post" action="action.php"> <form id="formulaire_saisie" method="post" action="action.php">

View File

@ -1,4 +1,8 @@
{include file="_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} <?php
$nav = $_GET['type'];
?>
<!-- nav bar -->
{include file="%s/templates/_nav.tpl"|args:$plugin_root current_nav="%s"|args:$nav}
<?php <?php
$fmt = new \NumberFormatter('fr_FR', \NumberFormatter::SPELLOUT); $fmt = new \NumberFormatter('fr_FR', \NumberFormatter::SPELLOUT);