Simplify javascript.
[platal.git] / templates / table-editor.tpl
index 0bd0a41..7a0cbaf 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -60,6 +60,9 @@
     {if $myfield eq $t->idfield}
         {assign var="idval" value=$myrow.$myfield}
     {/if}
+    {if $t->idfield2 && $myfield eq $t->idfield2}
+        {assign var="idval2" value=$myrow.$myfield}
+    {/if}
     {if $myval.Type eq 'timestamp'}
       <span class="smaller">{$myrow.$myfield|date_format:"%x %X"}</span>
     {elseif $myval.Type eq 'checkbox'}
@@ -77,7 +80,7 @@
     <a href="{$t->pl}/edit/{$idval}">{icon name=page_edit title='éditer'}</a>
     {/if}
     {if !$readonly}
-    <a href="{$t->pl}/delete/{$idval}?token={xsrf_token}">{icon name=delete title='supprimer'}</a>
+    <a href="{$t->pl}/delete/{$idval}{if t($idval2)}/{$idval2}{/if}?token={xsrf_token}">{icon name=delete title='supprimer'}</a>
     {/if}
   </td>
   {/if}
   <table class="bicol">
     <tr class="impair">
       <th colspan="2">
-        {if $id}
-            modification de l'entrée 
+        {if $id !== null}
+            modification de l'entrée
         {else}
             nouvelle entrée
         {/if}