1 {**************************************************************************}
3 {* Copyright (C) 2003-2006 Polytechnique.org *}
4 {* http://opensource.polytechnique.org/ *}
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. *}
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. *}
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 *}
21 {**************************************************************************}
31 <script type="text/javascript">
33 function del( myid ) {
34 if (confirm ("You are about to delete this entry. Do you want to proceed?")) {
35 document.forms.operations.action.value = "del";
36 document.forms.operations.{/literal}{$prefix}{literal}id.value = myid;
37 document.forms.operations.submit();
41 function edit( myid ) {
42 document.forms.operations.action.value = "edit";
43 document.forms.operations.{/literal}{$prefix}{literal}id.value = myid;
44 document.forms.operations.submit();
52 <form method="post" action="{$smarty.server.PHP_SELF}" id="operations">
54 <input type="hidden" name="action" value="" />
55 <input type="hidden" name="{$prefix}id" value="" />
61 {if $idsum}<th>id</th>{/if}
62 {foreach from=$vars item=myval}
63 {if $myval.sum}<th>{$myval.desc}</th>{/if}
71 <td colspan="{$ncols}"><strong>nouvelle entrée</strong></td>
73 <a href="javascript:edit('');">create</a>
77 {foreach from=$rows item=myrow}{assign var="myarr" value=$myrow[1]}
78 <tr class="{cycle values="pair,impair"}">
79 {if $idsum}<td>{$myrow[0]}</td>{/if}
80 {foreach from=$vars key=mykey item=myval}
83 {if $myval.type=="timestamp"}
84 <span class="smaller">{$myarr.$mykey|date_format:"%x %X"}</span>
85 {elseif $myval.type=="set" and $myval.trans}
86 {$myval.trans[$myval.value]}
87 {elseif $myval.type=="ext"}
88 {extval table=$table field=$mykey value=$myarr.$mykey vtable=$myval.vtable vjoinid=$myval.vjoinid vfield=$myval.vfield}
98 <a href="javascript:edit('{$myrow[0]}');">edit</a>
99 <a href="javascript:del('{$myrow[0]}');">delete</a>
101 {foreach from=$myrow[2] item=myaction}
110 {if ($p_prev > -1) || ($p_next > -1)}
111 <p class="pagenavigation">
112 {if $p_prev > -1}<a href="?start={$p_prev}">{$msg_previous_page}</a> {/if}
113 {if $p_next > -1}<a href="?start={$p_next}">{$msg_next_page}</a>{/if}
119 <form method="post" action="{$smarty.server.PHP_SELF}">
120 <table class="bicol">
123 <input type="hidden" name="action" value="update" />
125 modification de l'entrée
126 <input type="hidden" name="{$prefix}id" value="{$id}" />
132 {foreach from=$vars key=mykey item=myval}
133 <tr class="{cycle values="pair,impair"}">
135 <strong>{$myval.desc}</strong>
136 {if $myval.type=="password"}<br /><em>(blank=no change)</em>{/if}
140 {if $myval.type=="textarea"}
141 <textarea name="{$prefix}{$mykey}" rows="10" cols="70">{$myval.value}</textarea>
142 {elseif $myval.type=="set"}
144 {flags table=$table field=$mykey name="$prefix$mykey" selected=$myval.trans[$myval.value] trans=$myval.trans}
146 {flags table=$table field=$mykey name="$prefix$mykey" selected=$myval.value}
148 {elseif $myval.type=="ext"}
149 {extval table=$table field=$mykey name="$prefix$mykey" vtable=$myval.vtable vjoinid=$myval.vjoinid vfield=$myval.vfield selected=$myval.value}
150 {elseif $myval.type=="timestamp"}
151 <input type="text" name="{$prefix}{$mykey}" value="{$myval.value|date_format:"%x %X"}" />
152 {elseif $myval.type=="password"}
153 <input type="password" name="{$prefix}{$mykey}" size="40" />
155 <input type="{$myval.type}" name="{$prefix}{$mykey}" size="40" value="{$myval.value}" />
166 <input type="submit" value="enregistrer" />
172 <a href="{$smarty.server.PHP_SELF}">back</a>
178 {* vim:set et sw=2 sts=2 sws=2: *}