3f226f3af2d175f7c89a0dec816a94172ff9518f
[platal.git] / templates / admin / valider.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2008 Polytechnique.org                             *}
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
19 {*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
20 {*                                                                        *}
21 {**************************************************************************}
22
23 {javascript name="jquery"}
24 <script type="text/javascript">//<![CDATA[
25 {literal}
26 function activateField(name, id, obj) {
27   $("#" + name + "_" + id).show();
28   return true;
29 }
30 {/literal}
31 //]]></script>
32
33 <h1>Validation</h1>
34
35
36 {if $vit->total()}
37
38 {counter print=false start=0 assign=hidden}
39
40 {iterate item=valid from=$vit}
41 {assign var=type value=$valid->type}
42 {if !$hide_requests[$type]}
43 <br />
44 <table class="bicol">
45   <tr>
46     <th colspan="2"><a id="valid{$valid->id()}"></a>{$valid->type}</th>
47   </tr>
48   <tr>
49     <td class="titre" style="width: 20%">Demandeur&nbsp;:</td>
50     <td>
51       <a href="profile/{$valid->bestalias}" class="popup2">
52         {$valid->prenom} {$valid->nom} (X{$valid->promo})
53       </a>
54     </td>
55   </tr>
56   <tr>
57     <td class="titre" style="width: 20%">Date de demande&nbsp;:</td>
58     <td>
59       {$valid->stamp|date_format}
60     </td>
61   </tr>
62   {include file=$valid->formu()}
63   {if $valid->editor()}
64   <tr>
65     <th colspan="2">
66      {if $preview_id neq $valid->id()}
67       <div style="float: left">
68         <a href="javascript:activateField('edit', '{$valid->id()}')">{icon name="add"}</a>
69       </div>
70       {/if}
71       Editer
72     </th>
73   </tr>
74   <tr {if $preview_id neq $valid->id()}style="display: none"{/if} id="edit_{$valid->id()}">
75     <td colspan="2" class="center">
76       <form enctype="multipart/form-data" action="{$platal->pl_self(0)}/edit/{$valid->id()}#valid{$valid->id()}" method="post">
77         <div>
78           {include file=$valid->editor()}
79           <input type="hidden" name="uid"    value="{$valid->uid}" />
80           <input type="hidden" name="type"   value="{$valid->type}" />
81           <input type="hidden" name="stamp"  value="{$valid->stamp}" />
82           <br />
83           <input type="submit" name="edit"   value="Editer" />
84         </div>
85       </form>
86     </td>
87   </tr>
88   {/if}
89   <tr>
90     <th colspan='2'>
91       {if $valid->comments|@count eq 0}
92       <div style="float: left">
93         <a href="javascript:activateField('comment', '{$valid->id()}')">{icon name="add"}</a>
94       </div>
95       {/if}
96       Commentaires
97     </th>
98   </tr>
99   {foreach from=$valid->comments item=c}
100   <tr class="{cycle values="impair,pair"}">
101     <td class="titre">
102       <a href="profile/{$c[0]}" class="popup2">{$c[0]}</a>
103     </td>
104     <td>{$c[1]|nl2br}</td>
105   </tr>
106   {/foreach}
107   <tr {if $valid->comments|@count eq 0}style="display: none"{/if} id="comment_{$valid->id()}">
108     <td colspan='2' class='center'>
109       <form action="admin/validate" method="post">
110         <div>
111           <input type="hidden" name="uid"    value="{$valid->uid}" />
112           <input type="hidden" name="type"   value="{$valid->type}" />
113           <input type="hidden" name="stamp"  value="{$valid->stamp}" />
114           <input type="hidden" name="formid" value="{0|rand:65535}" />
115           <textarea rows="3" cols="50" name="comm"></textarea>
116           <br />
117           <input type="submit" name="hold"   value="Commenter" />
118         </div>
119       </form>
120     </td>
121   </tr>
122   <tr><th colspan='2'>Réponse</th></tr>
123   <tr>
124     <td colspan='2' {popup caption="Règles de validation" text=$valid->ruleText()}>
125       <form action="admin/validate" method="post">
126         <div>
127           Réponse préremplie&nbsp;:
128           <select onchange="this.form.comm.value=this.value">
129             <option value=""></option>
130             {foreach from=$valid->answers() item=automatic_answer}
131               <option value="{$automatic_answer.answer}">{$automatic_answer.title}</option>
132             {/foreach}
133           </select>
134           <a href="admin/validate/answers">{icon name="page_edit" title="Editer les réponses automatiques"}</a>
135         </div>
136         <div class='center'>
137           Ajouté dans l'email&nbsp;:<br />
138           <textarea rows="5" cols="50" name="comm"></textarea><br />
139
140           <input type="hidden" name="uid"    value="{$valid->uid}" />
141           <input type="hidden" name="type"   value="{$valid->type}" />
142           <input type="hidden" name="stamp"  value="{$valid->stamp}" />
143           <input type="submit" name="accept" value="Accepter" />
144           {if $valid->refuse}<input type="submit" name="refuse" value="Refuser" />{/if}
145           <input type="submit" name="delete" value="Supprimer" />
146         </div>
147       </form>
148     </td>
149   </tr>
150 </table>
151 {else}
152 {counter print=false assign=hidden}
153 {/if}
154 {/iterate}
155
156 {if $hidden}
157 <p>{$hidden} validation{if $hidden > 1}s ont été masquées{else} a été masquée{/if}.</p>
158 {/if}
159
160 {else}
161
162 <p>Rien à valider</p>
163
164 {/if}
165
166 <p>
167   Afficher seulement les validation suivantes&nbsp;:
168 </p>
169
170 <form action="admin/validate" method="post">
171   {foreach from=$categories item=type}
172     <div style="float:left;width:33%"><input type="checkbox" name="{$type}" id="hide_{$type}"{if !$hide_requests[$type]} checked="checked"{/if}/>
173     <label for="hide_{$type}">{$type}</label></div>
174   {/foreach}
175   <div class="center" style="clear:left"><input type="submit" name="hide" value="Valider" /></div>
176 </form>
177
178 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}