{**************************************************************************}
{* *}
-{* Copyright (C) 2003-2004 Polytechnique.org *}
+{* Copyright (C) 2003-2008 Polytechnique.org *}
{* http://opensource.polytechnique.org/ *}
{* *}
{* This program is free software; you can redistribute it and/or modify *}
-<form action="{$smarty.server.PHP_SELF}" method="get">
+<form action="admin/deaths" method="post">
<table class="tinybicol">
<tr>
<td>
</td>
<td><input type="submit" value="<" name="sub01" /></td>
<td>
- Promotion :
+ Promotion :
<input type="text" name="promo" value="{$promo}" size="4" maxlength="4" />
<input type="submit" value="GO" />
</td>
</table>
</form>
-<form action="{$smarty.server.REQUEST_URI}" method="post">
- <table class="bicol" summary="liste des dates de décès">
+<form action="admin/deaths/{$promo}/validate" id="deathDateList" method="post">
+ {xsrf_token_field}
+ <table class="bicol" summary="liste des dates de décès">
<tr>
<th>Nom</th>
- <th>Date de décès</th>
+ <th>Date de décès</th>
</tr>
{iterate item=x from=$decedes}
<tr class="{cycle values="impair,pair"}">
<td>{$x.nom} {$x.prenom}</td>
<td class="center">
- <input type="text" name="{$x.matricule}" value="{$x.deces}" size="10" maxlength="10" />
+ <input type="text" class="deathDate" name="{$x.matricule}" value="{$x.deces}" size="10" maxlength="10" />
</td>
</tr>
{/iterate}
<tr>
<td class="center" colspan="2">
- <input type="hidden" name="promo" value="{$promo}" />
- <input type="submit" name="valider" value="Valider" />
+ <input type="submit" value="Valider" />
</td>
</tr>
</table>
</form>
-{* vim:set et sw=2 sts=2 sws=2: *}
+<script type='text/javascript' src='javascript/jquery.js'></script>
+<script type="text/javascript">//<![CDATA[
+ {literal}
+ $('input.deathDate').change(
+ function ()
+ {
+ $(this).addClass('sendDate');
+ });
+
+ $('#deathDateList').submit(
+ function ()
+ {
+ // Avoid sending useless data to the webserver
+ $('input.deathDate').not('.sendDate').attr('disabled', true);
+ });
+ {/literal}
+//]]></script>
+
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}