Commit | Line | Data |
---|---|---|
0337d704 | 1 | {**************************************************************************} |
2 | {* *} | |
5e1513f6 | 3 | {* Copyright (C) 2003-2011 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 *} | |
65934312 | 18 | |
0337d704 | 19 | {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} |
20 | {* *} | |
21 | {**************************************************************************} | |
22 | ||
65934312 FB |
23 | <script type="text/javascript">//<![CDATA[ |
24 | {literal} | |
cbc404da VZ |
25 | function toggleField(name, id, obj) { |
26 | $("#" + name + "_" + id).toggle(); | |
65934312 FB |
27 | } |
28 | {/literal} | |
29 | //]]></script> | |
30 | ||
0337d704 | 31 | <h1>Validation</h1> |
65934312 | 32 | |
0337d704 | 33 | |
34 | {if $vit->total()} | |
35 | ||
cfb96867 | 36 | {counter print=false start=0 assign=hidden} |
37 | ||
e654517d | 38 | {iterate item=valid from=$vit} |
cfb96867 | 39 | {assign var=type value=$valid->type} |
e33b29e5 | 40 | {if !t($hide_requests[$type]) && !($valid->requireAdmin && !$isAdmin)} |
0337d704 | 41 | <br /> |
42 | <table class="bicol"> | |
43 | <tr> | |
fa33f7c6 | 44 | <th colspan="2"><a id="valid{$valid->id()}"></a>{$valid->type}</th> |
0337d704 | 45 | </tr> |
46 | <tr> | |
47 | <td class="titre" style="width: 20%">Demandeur :</td> | |
48 | <td> | |
09e54905 SJ |
49 | {if $valid->user->hasProfile()} |
50 | {assign var="profile" value=$valid->user->profile()} | |
51 | <a href="profile/{$profile->hrpid}" class="popup2"> | |
52 | {/if} | |
53 | {$valid->user->fullName("promo")} | |
aba1be6d | 54 | {if $valid->user->hasProfile()} |
0337d704 | 55 | </a> |
aba1be6d | 56 | {/if} |
0337d704 | 57 | </td> |
58 | </tr> | |
aba1be6d | 59 | {if t($valid->profile) && !$valid->userIsProfileOwner} |
f9967b19 SJ |
60 | <tr> |
61 | <td class="titre" style="width: 20%">Profil concerné :</td> | |
62 | <td> | |
63 | <a href="profile/{$valid->profile->hrpid}" class="popup2"> | |
64 | {$valid->profile->fullName("promo")} | |
65 | </a> | |
66 | </td> | |
67 | </tr> | |
68 | {/if} | |
4aec8eff | 69 | <tr> |
70 | <td class="titre" style="width: 20%">Date de demande :</td> | |
71 | <td> | |
72 | {$valid->stamp|date_format} | |
73 | </td> | |
74 | </tr> | |
0337d704 | 75 | {include file=$valid->formu()} |
6aa01fed | 76 | {if $valid->editor()} |
fe30a442 | 77 | <tr onclick="toggleField('edit', '{$valid->id()}')" style="cursor: pointer"> |
65934312 | 78 | <th colspan="2"> |
cbc404da | 79 | {if $preview_id neq $valid->id()} |
65934312 | 80 | <div style="float: left"> |
fe30a442 | 81 | {icon name="add"} |
65934312 FB |
82 | </div> |
83 | {/if} | |
fe30a442 | 84 | Éditer |
65934312 FB |
85 | </th> |
86 | </tr> | |
87 | <tr {if $preview_id neq $valid->id()}style="display: none"{/if} id="edit_{$valid->id()}"> | |
6aa01fed | 88 | <td colspan="2" class="center"> |
65934312 | 89 | <form enctype="multipart/form-data" action="{$platal->pl_self(0)}/edit/{$valid->id()}#valid{$valid->id()}" method="post"> |
e61326ed | 90 | {xsrf_token_field} |
6aa01fed | 91 | <div> |
92 | {include file=$valid->editor()} | |
5daf68f6 | 93 | <input type="hidden" name="uid" value="{$valid->user->id()}" /> |
6aa01fed | 94 | <input type="hidden" name="type" value="{$valid->type}" /> |
95 | <input type="hidden" name="stamp" value="{$valid->stamp}" /> | |
96 | <br /> | |
fe30a442 | 97 | <input type="submit" name="edit" value="Éditer" /> |
6aa01fed | 98 | </div> |
99 | </form> | |
100 | </td> | |
101 | </tr> | |
102 | {/if} | |
fe30a442 | 103 | <tr onclick="toggleField('comment', '{$valid->id()}')" style="cursor: pointer"> |
65934312 FB |
104 | <th colspan='2'> |
105 | {if $valid->comments|@count eq 0} | |
106 | <div style="float: left"> | |
fe30a442 | 107 | {icon name="add"} |
65934312 FB |
108 | </div> |
109 | {/if} | |
110 | Commentaires | |
111 | </th> | |
112 | </tr> | |
0337d704 | 113 | {foreach from=$valid->comments item=c} |
114 | <tr class="{cycle values="impair,pair"}"> | |
115 | <td class="titre"> | |
7b2413f6 | 116 | <a href="profile/{$c[0]}" class="popup2">{$c[0]}</a> |
0337d704 | 117 | </td> |
716c76f6 | 118 | <td>{$c[1]|nl2br}</td> |
0337d704 | 119 | </tr> |
120 | {/foreach} | |
65934312 | 121 | <tr {if $valid->comments|@count eq 0}style="display: none"{/if} id="comment_{$valid->id()}"> |
0337d704 | 122 | <td colspan='2' class='center'> |
86f0a6af | 123 | <form action="admin/validate" method="post"> |
e61326ed | 124 | {xsrf_token_field} |
0337d704 | 125 | <div> |
5daf68f6 | 126 | <input type="hidden" name="uid" value="{$valid->user->id()}" /> |
0337d704 | 127 | <input type="hidden" name="type" value="{$valid->type}" /> |
128 | <input type="hidden" name="stamp" value="{$valid->stamp}" /> | |
4791ff77 | 129 | <input type="hidden" name="formid" value="{0|rand:65535}" /> |
0337d704 | 130 | <textarea rows="3" cols="50" name="comm"></textarea> |
131 | <br /> | |
132 | <input type="submit" name="hold" value="Commenter" /> | |
133 | </div> | |
134 | </form> | |
135 | </td> | |
136 | </tr> | |
fe30a442 SJ |
137 | <tr> |
138 | <th colspan='2'> | |
139 | {if $preview_id neq $valid->id()} | |
140 | <div style="float: left"> | |
141 | {icon name="null"} | |
142 | </div> | |
143 | {/if} | |
144 | Réponse | |
145 | </th> | |
146 | </tr> | |
0337d704 | 147 | <tr> |
fba760d2 | 148 | <td colspan='2' {popup caption="Règles de validation" text=$valid->ruleText()}> |
86f0a6af | 149 | <form action="admin/validate" method="post"> |
e61326ed | 150 | {xsrf_token_field} |
0337d704 | 151 | <div> |
e8439508 | 152 | Réponse préremplie : |
e18888f4 | 153 | <select onchange="this.form.comm.value=this.value"> |
9fce7016 | 154 | <option value=""> </option> |
e18888f4 | 155 | {foreach from=$valid->answers() item=automatic_answer} |
156 | <option value="{$automatic_answer.answer}">{$automatic_answer.title}</option> | |
157 | {/foreach} | |
158 | </select> | |
fe30a442 | 159 | <a href="admin/validate/answers">{icon name="page_edit" title="Éditer les réponses automatiques"}</a> |
e18888f4 | 160 | </div> |
161 | <div class='center'> | |
e8439508 | 162 | Ajouté dans l'email :<br /> |
0337d704 | 163 | <textarea rows="5" cols="50" name="comm"></textarea><br /> |
164 | ||
5daf68f6 | 165 | <input type="hidden" name="uid" value="{$valid->user->id()}" /> |
0337d704 | 166 | <input type="hidden" name="type" value="{$valid->type}" /> |
167 | <input type="hidden" name="stamp" value="{$valid->stamp}" /> | |
168 | <input type="submit" name="accept" value="Accepter" /> | |
169 | {if $valid->refuse}<input type="submit" name="refuse" value="Refuser" />{/if} | |
170 | <input type="submit" name="delete" value="Supprimer" /> | |
171 | </div> | |
172 | </form> | |
173 | </td> | |
174 | </tr> | |
175 | </table> | |
cfb96867 | 176 | {else} |
177 | {counter print=false assign=hidden} | |
178 | {/if} | |
0337d704 | 179 | {/iterate} |
180 | ||
cfb96867 | 181 | {if $hidden} |
a7de4ef7 | 182 | <p>{$hidden} validation{if $hidden > 1}s ont été masquées{else} a été masquée{/if}.</p> |
cfb96867 | 183 | {/if} |
184 | ||
0337d704 | 185 | {else} |
186 | ||
a7de4ef7 | 187 | <p>Rien à valider</p> |
0337d704 | 188 | |
189 | {/if} | |
190 | ||
cfb96867 | 191 | <p> |
e8439508 | 192 | Afficher seulement les validation suivantes : |
cfb96867 | 193 | </p> |
0337d704 | 194 | |
2069538b | 195 | <form action="admin/validate" method="post"> |
196 | {foreach from=$categories item=type} | |
5b8c317d | 197 | <div style="float:left;width:33%"><input type="checkbox" name="{$type}" id="hide_{$type}"{if !t($hide_requests[$type])} checked="checked"{/if}/> |
2069538b | 198 | <label for="hide_{$type}">{$type}</label></div> |
199 | {/foreach} | |
200 | <div class="center" style="clear:left"><input type="submit" name="hide" value="Valider" /></div> | |
201 | </form> | |
202 | ||
a7de4ef7 | 203 | {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} |