Overview
Comment: | Suppression d'exercice |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
7581683c14117be494f8b460629963e5 |
User & Date: | bohwaz on 2012-10-15 01:13:45 |
Other Links: | manifest | tags |
Context
2012-10-15
| ||
01:39 | Un peu de rangement dans les fichiers de la compta check-in: 16376296b5 user: bohwaz tags: trunk | |
01:13 | Suppression d'exercice check-in: 7581683c14 user: bohwaz tags: trunk | |
01:05 | Modification d'exercice check-in: aaff552f5e user: bohwaz tags: trunk | |
Changes
Modified templates/admin/compta/exercice_modifier.tpl from [eb9b21bb41] to [86921d4443].
︙ | ︙ | |||
17 18 19 20 21 22 23 | <dd><input type="date" name="debut" id="f_debut" value="{form_field name=debut default=$exercice.debut|date_fr:'Y-m-d'}" size="10" /></dd> <dt><label for="f_fin">Fin de l'exercice</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="date" name="fin" id="f_fin" value="{form_field name=fin default=$exercice.fin|date_fr:'Y-m-d'}" size="10" /></dd> </dl> </fieldset> <p class="submit"> | | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | <dd><input type="date" name="debut" id="f_debut" value="{form_field name=debut default=$exercice.debut|date_fr:'Y-m-d'}" size="10" /></dd> <dt><label for="f_fin">Fin de l'exercice</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="date" name="fin" id="f_fin" value="{form_field name=fin default=$exercice.fin|date_fr:'Y-m-d'}" size="10" /></dd> </dl> </fieldset> <p class="submit"> {csrf_field key="compta_modif_exercice_`$exercice.id`"} <input type="submit" name="edit" value="Enregistrer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Added templates/admin/compta/exercice_supprimer.tpl version [42cf41c810].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | {include file="admin/_head.tpl" title="Supprimer un exercice" current="compta/exercices"} {if $error} <p class="error"> {$error|escape} </p> {/if} <form method="post" action="{$self_url|escape}"> <fieldset> <legend>Supprimer un exercice</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer l'exercice « {$exercice.libelle|escape} » du {$exercice.debut|date_fr:'d/m/Y'} au {$exercice.fin|date_fr:'d/m/Y'} ? </h3> <p class="help"> Attention, l'exercice ne pourra pas être supprimé si des opérations y sont toujours affectées. </p> </fieldset> <p class="submit"> {csrf_field key="compta_supprimer_exercice_`$exercice.id`"} <input type="submit" name="delete" value="Supprimer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified www/admin/compta/exercice_modifier.php from [e32b2cc8f3] to [4e0438a488].
︙ | ︙ | |||
15 16 17 18 19 20 21 | if (!$exercice) { throw new UserException('Exercice inconnu.'); } $error = false; | | | | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | if (!$exercice) { throw new UserException('Exercice inconnu.'); } $error = false; if (!empty($_POST['edit'])) { if (!utils::CSRF_check('compta_modif_exercice_'.$exercice['id'])) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { |
︙ | ︙ |
Added www/admin/compta/exercice_supprimer.php version [2102b756f1].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | <?php require_once __DIR__ . '/_inc.php'; if ($user['droits']['compta'] < Garradin_Membres::DROIT_ADMIN) { throw new UserException("Vous n'avez pas le droit d'accéder à cette page."); } require_once GARRADIN_ROOT . '/include/class.compta_exercices.php'; $e = new Garradin_Compta_Exercices; $exercice = $e->get((int)utils::get('id')); if (!$exercice) { throw new UserException('Exercice inconnu.'); } $error = false; if (!empty($_POST['delete'])) { if (!utils::CSRF_check('compta_supprimer_exercice_'.$exercice['id'])) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $id = $e->delete($exercice['id']); utils::redirect('/admin/compta/exercices.php'); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('error', $error); $tpl->assign('exercice', $exercice); $tpl->display('admin/compta/exercice_supprimer.tpl'); ?> |