nouveau table-editor (exit celui de diogenes), migration des dernieres pages admin
[platal.git] / templates / table-editor.tpl
CommitLineData
0337d704 1{**************************************************************************}
2{* *}
50a40a33 3{* Copyright (C) 2003-2006 Polytechnique.org *}
0337d704 4{* http://opensource.polytechnique.org/ *}
5{* *}
6{* This program is free software; you can redistribute it and/or modify *}
7{* it under the terms of the GNU General Public License as published by *}
8{* the Free Software Foundation; either version 2 of the License, or *}
9{* (at your option) any later version. *}
10{* *}
11{* This program is distributed in the hope that it will be useful, *}
12{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
13{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
14{* GNU General Public License for more details. *}
15{* *}
16{* You should have received a copy of the GNU General Public License *}
17{* along with this program; if not, write to the Free Software *}
18{* Foundation, Inc., *}
19{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
20{* *}
21{**************************************************************************}
22
23
24
25<h1>{$title}</h1>
26
e7ae7df9 27{if $list}
0337d704 28
29<table class="bicol">
30<tr>
e7ae7df9 31 {foreach from=$t->vars item=myval}{if $myval.display}
32 <th>{$myval.desc}</th>
33 {/if}{/foreach}
0337d704 34 {if !$hideactions}
35 <th>action</th>
36 {/if}
37</tr>
38{if !$readonly}
39<tr class="impair">
e7ae7df9 40 <td colspan="{$t->nbfields}"><strong>nouvelle entrée</strong></td>
0337d704 41 <td class="action">
e7ae7df9 42 <a href="{$t->pl}/new">créer{icon name=add title='nouvelle entrée'}</a>
0337d704 43 </td>
44</tr>
45{/if}
e7ae7df9 46{iterate from=$list item=myrow}
0337d704 47<tr class="{cycle values="pair,impair"}">
e7ae7df9 48{foreach from=$t->vars item=myval}{if $myval.display}
0337d704 49 <td>
e7ae7df9 50 {assign var="myfield" value=$myval.Field}
51 {if $myfield eq $t->idfield}
52 {assign var="idval" value=$myrow.$myfield}
53 {/if}
54 {if $myval.Type eq 'timestamp'}
55 <span class="smaller">{$myrow.$myfield|date_format:"%x %X"}</span>
56 {else}
57 {$myrow.$myfield}
58 {/if}
0337d704 59 </td>
e7ae7df9 60{/if}{/foreach}
0337d704 61 {if !$hideactions}
62 <td class="action">
63 {if !$readonly}
e7ae7df9 64 <a href="{$t->pl}/edit/{$idval}">{icon name=date_edit title='éditer'}</a>
65 <a href="{$t->pl}/delete/{$idval}">{icon name=delete title='supprimer'}</a>
0337d704 66 {/if}
0337d704 67 </td>
68 {/if}
69</tr>
e7ae7df9 70{/iterate}
0337d704 71</table>
72
73{if ($p_prev > -1) || ($p_next > -1)}
74<p class="pagenavigation">
1f7c3690 75{if $p_prev > -1}<a href="{$smarty.request.PHP_SELF}?start={$p_prev}">{$msg_previous_page}</a>&nbsp;{/if}
76{if $p_next > -1}<a href="{$smarty.request.PHP_SELF}?start={$p_next}">{$msg_next_page}</a>{/if}
0337d704 77</p>
78{/if}
79
80{else}
81
e7ae7df9 82<form method="post" action="{$t->pl}/update/{$id}">
0337d704 83 <table class="bicol">
84 <tr class="impair">
85 <th colspan="2">
e7ae7df9 86 {if $id}
87 modification de l'entrée
0337d704 88 {else}
e7ae7df9 89 nouvelle entrée
0337d704 90 {/if}
91 </th>
92 </tr>
e7ae7df9 93 {foreach from=$t->vars item=myval}{assign var="myfield" value=$myval.Field}{if ($myfield neq $t->idfield) or ($t->idfield_editable)}
0337d704 94 <tr class="{cycle values="pair,impair"}">
95 <td>
96 <strong>{$myval.desc}</strong>
0337d704 97 </td>
98 <td>
e7ae7df9 99 {if $myval.Type eq 'set'}
100 <select name="{$myfield}[]" multiple="multiple">
101 {foreach from=$myval.List item=option}
102 <option value="{$option}" {if $entry.$myfield.$option}selected="selected"{/if}>{$option}</option>
103 {/foreach}
104 </select>
105 {elseif $myval.Type eq 'enum'}
106 <select name="{$myfield}">
107 {foreach from=$myval.List item=option}
108 <option value="{$option}" {if $entry.$myfield.$option}selected="selected"{/if}>{$option}</option>
109 {/foreach}
110 </select>
111 {elseif ($myval.Type eq 'textarea') or ($myval.Type eq 'varchar200')}
112 <textarea name="{$myfield}" rows="{if $myval.Type eq 'varchar200'}3{else}10{/if}" cols="70">{$entry.$myfield}</textarea>
0337d704 113 {else}
e7ae7df9 114 <input type="text" name="{$myfield}" value="{$entry.$myfield}" {if $myval.Size}size="{$myval.Size}" maxlength="{$myval.Maxlength}"{/if}/>
115 {if $myval.Type eq 'timestamp'}<em>jj/mm/aaaa hh:mm:ss</em>{/if}
116 {if $myval.Type eq 'time'}<em>hh:mm:ss</em>{/if}
0337d704 117 {/if}
118 </td>
119 </tr>
e7ae7df9 120 {/if}{/foreach}
0337d704 121 </table>
122
123 <p class="center">
124 <input type="submit" value="enregistrer" />
125 </p>
126
127</form>
128
129<p>
e7ae7df9 130<a href="{$t->pl}">back</a>
0337d704 131</p>
132
133{/if}
134
135
136{* vim:set et sw=2 sts=2 sws=2: *}