Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / auth_subfields_structure.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Administration &rsaquo; Authority MARC subfield structure</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
8
9 <body id="admin_auth_subfields_structure" class="admin">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'prefs-admin-search.inc' %]
12 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;
13   <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a> &rsaquo;
14   [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | uri%]">[% authtypecode | html %] framework</a> &rsaquo;
15   [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a> &rsaquo;
16   [% END %]
17   [% IF ( else ) %]Authority MARC subfield structure for [% tagfield | html %]
18   [% ELSE %]<a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;tagsubfield=[% tagsubfield | html %]&amp;authtypecode=[% authtypecode |uri %]">Authority MARC subfield structure for [% tagfield | html %]</a> &rsaquo;
19   [% END %]
20   [% IF ( delete_confirm ) %]Confirm deletion of subfield [% tagsubfield | html %]?[% END %]
21   [% IF ( delete_confirmed ) %]Data deleted[% END %]
22   [% IF ( add_form ) %]
23   [% IF ( use_heading_flags_p ) %]
24   [% IF ( heading_edit_subfields_p ) %]Edit MARC subfields constraints[% END %]
25   [% ELSE %][% action | html %][% END %]
26   [% END %]
27 </div>
28
29 <div id="doc3" class="yui-t2">
30
31 <div id="bd">
32     <div id="yui-main">
33     <div class="yui-b">
34
35 [% IF ( add_form ) %]
36
37     <h1>[% IF ( use_heading_flags_p ) %]
38     [% IF ( heading_edit_subfields_p ) %]Edit MARC subfields constraints for field [% tagfield | html %] authority [% authtypecode | html %][% END %]
39     [% ELSE %][% action | html %][% END %]</h1>
40     <form action="[% script_name | html %]" name="Aform" method="post">
41         <input type="hidden" name="op" value="add_validate" />
42         <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
43         <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
44         <fieldset class="action"><input type="submit" class="submit" value="Save changes" /> <a class="cancel" href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;authtypecode=[% authtypecode |uri %]">Cancel</a></fieldset>
45         <div id="subfieldtabs" class="toptabs numbered">
46             <ul>
47                 [% FOREACH loo IN loop %]
48                     [% IF ( loo.new_subfield ) %]
49                         <li><a href="#sub[% loo.tagsubfield | html %]field" title="[% loo.liblibrarian | html_entity %]">New</a></li>
50                     [% ELSE %]
51                         <li><a href="#sub[% loo.tagsubfield | html %]field" title="[% loo.liblibrarian | html_entity %]">
52                             [% loo.tagsubfield | html %]
53                     </a></li>
54                     [% END %]
55                 [% END %]
56             </ul>
57
58         [% FOREACH loo IN loop %]
59         <div id="sub[% loo.tagsubfield | html %]field">
60             <fieldset class="rows"><ol>
61
62                 [% IF ( loo.new_subfield ) %]
63                     <li>
64                         <label for="tagsubfieldinput[% loo.row | html %]">Subfield code: </label>
65                         <input type="text" name="tagsubfield" value="[% loo.tagsubfield | html %]" size="1" id="tagsubfield" maxlength="1" />
66                     </li>
67                 [% ELSE %]
68                     <li>
69                         <input type="hidden" name="tagsubfield" value="[% loo.tagsubfield | html %]" />
70                     </li>
71                 [% END %]
72                 <li>
73                     <label for="repeatable[% loo.row | html %]">Repeatable: </label>
74                     [% IF loo.repeatable %]
75                         <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
76                     [% ELSE %]
77                         <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
78                     [% END %]
79                 </li>
80                 <li>
81                     <label for="mandatory[% loo.row | html %]">Mandatory: </label>
82                     [% IF loo.mandatory %]
83                         <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
84                     [% ELSE %]
85                         <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
86                     [% END %]
87                 </li>
88                 <li><label for="liblibrarian[% loo.row | html %]">Text for librarian: </label><input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" /></li>
89                 <li><label for="libopac[% loo.row | html %]">Text for OPAC: </label><input type="text" id="libopac[% loo.row | html %]" name="libopac" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" /></li>
90                 <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
91                     <select name="tab" size="1" id="tab[% loo.row | html %]">
92                         [%- IF ( loo.tab ==  -1 ) -%]
93                         <option value="-1" selected="selected">ignore</option>
94                         [%- ELSE -%]
95                         <option value="-1">ignore</option>
96                         [%- END -%]
97                     [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%]
98                         [%- IF ( loo.tab ==  t && t.length>0 ) -%]
99                         <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
100                         [%- ELSIF ( loo.tab ==  t ) -%]
101                         <option value="[%- t | html -%]" selected="selected">&nbsp;</option>
102                         [%- ELSE -%]
103                         <option value="[%- t | html -%]">[%- t | html -%]</option>
104                         [%- END -%]
105                     [%- END -%]
106                     </select>
107                     (ignore means that the subfield does not display in the record editor)
108                 </li>
109                 <li>
110                     <fieldset>
111                         <legend>Display</legend>
112                         <ol>
113                             <li><label for="ohidden[% loo.row | html %]">Select to display or not:</label>
114                                 <select name="ohidden" size="1" id="ohidden[% loo.row | html %]">
115                                     [%- IF ( loo.ohidden ==  0 ) -%]
116                                     <option value= "0" selected="selected">Show all</option>
117                                     <option value="1">Hide all</option>
118                                     [%- ELSE -%]
119                                     [%# All other non-zero values mean: Hide %]
120                                     <option value= "0">Show all</option>
121                                     <option value="1" selected="selected">Hide all</option>
122                                     [%- END -%]
123                                 </select>
124                             </li>
125                         </ol>
126                     </fieldset>
127                 </li>
128                 <li>
129                     <fieldset class="rows">
130                         <legend>Advanced constraints:</legend>
131                         <ol>
132                             <li>
133                                 <label for="isurl[% loo.row | html %]">Is a URL:</label>
134                                 [% IF loo.isurl %]
135                                     <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
136                                 [% ELSE %]
137                                     <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
138                                 [% END %]
139                                 (if checked, it means that the subfield is a URL and can be clicked)
140                             </li>
141                             <li>
142                                 <label for="defaultvalue[% loo.row | html %]">Default value:</label>
143                                 <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
144                             </li>
145                         </ol>
146                     </fieldset>
147                 </li>
148                 <li>
149                     <fieldset><legend>Help input</legend>    
150                         <ol>
151                             <li>
152                                 <label for="kohafield[% loo.row | html %]">Koha field:</label>
153                                 <select name="kohafield" id="kohafield[% loo.row | html %]" size="1">
154                                 [%- FOREACH value IN loo.kohafields %]
155                                     [% IF ( value == loo.kohafield  && value.length>0 ) -%]
156                                     <option value="[% value | html %]" selected="selected">[% value | html %]</option>
157                                     [%- ELSIF ( value == loo.kohafield ) -%]
158                                     <option value="[% value | html %]" selected="selected">&nbsp;</option>
159                                     [%- ELSIF ( value.length==0 ) -%]
160                                     <option value="[% value | html %]">&nbsp;</option>
161                                     [%- ELSE -%]
162                                     <option value="[% value | html %]">[% value | html %]</option>
163                                     [%- END -%]
164                                 [%- END %]
165                                 </select>
166                             </li>
167                             <li>
168                                 <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
169                                 <select name="authorised_value" id="authorised_value[% loo.row | html %]" size="1">
170                                 [%- FOREACH value IN loo.authorised_values %]
171                                     [% IF ( value == loo.authorised_value && value.length>0 ) -%]
172                                     <option value="[% value | html %]" selected="selected">[% value | html %]</option>
173                                     [%- ELSIF ( value == loo.authorised_value ) -%]
174                                     <option value="[% value | html %]" selected>&nbsp;</option>
175                                     [%- ELSIF ( value.length==0 ) -%]
176                                     <option value="[% value | html %]">&nbsp;</option>
177                                     [%- ELSE -%]
178                                     <option value="[% value | html %]">[% value | html %]</option>
179                                     [%- END -%]
180                                 [%- END %]
181                                 </select>
182                             </li>
183                             <li>
184                                 <label for="frameworkcode[% loo.row | html %]">Thesaurus:</label>
185                                 <select name="frameworkcode" id="frameworkcode[% loo.row | html %]" size="1">
186                                 [%- FOREACH value IN loo.frameworkcodes %]
187                                     [% IF ( value == loo.frameworkcode && value.length>0 ) -%]
188                                     <option value="[% value | html %]" selected="selected">[% value | html %]</option>
189                                     [%- ELSIF ( value == loo.frameworkcode ) -%]
190                                     <option value="[% value | html %]" selected="selected">&nbsp;</option>
191                                     [%- ELSIF ( value.length==0 ) -%]
192                                     <option value="[% value | html %]">&nbsp;</option>
193                                     [%- ELSE -%]
194                                     <option value="[% value | html %]">[% value | html %]</option>
195                                     [%- END -%]
196                                 [%- END %]
197                                 </select>
198                             </li>
199                             <li>
200                                 <label for="value_builder[% loo.row | html %]">Plugin:</label>
201                                 <select name="value_builder" id="value_builder[% loo.row | html %]" size="1">
202                                 [%- FOREACH value IN loo.value_builders %]
203                                     [% IF ( value == loo.value_builder && value.length>0 ) -%]
204                                     <option value="[% value | html %]" selected="selected">[% value | html %]</option>
205                                     [%- ELSIF ( value == loo.value_builder ) -%]
206                                     <option value="[% value | html %]" selected="selected">&nbsp;</option>
207                                     [%- ELSIF ( value.length==0 ) -%]
208                                     <option value="[% value | html %]">&nbsp;</option>
209                                     [%- ELSE -%]
210                                     <option value="[% value | html %]">[% value | html %]</option>
211                                     [%- END -%]
212                                 [%- END %]
213                                 </select>
214                             </li>
215                         </ol>
216                     </fieldset>
217                 </li>
218             </ol></fieldset><br class="clear" />
219         </div>
220         [% END %]
221         </div>
222     </form>
223 [% END %]
224
225 [% IF ( delete_confirm ) %]
226
227     <div class="dialog alert">
228         <h3>Delete subfield <span class="ex">'[% tagsubfield | html %]'?</span></h3>
229         <form action="[% delete_link | html %]" method="post">
230             <input type="hidden" name="op" value="delete_confirmed" />
231             <table>
232                 <tr><th scope="row">Subfield:</th> <td>[% tagsubfield | html %]</td></tr>
233                 <tr><th scope="row">Description:</th> <td>[% liblibrarian | html_entity %]</td></tr>
234             </table>
235             <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
236             <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
237             <input type="hidden" name="tagsubfield" value="[% tagsubfield | html %]" />
238             <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
239             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this subfield</button>
240         </form>
241
242         <form action="[% delete_link | html %]" method="get">
243             <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
244             <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
245             <input type="hidden" name="tagsubfield" value="[% tagsubfield | html %]" />
246             <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
247             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
248         </form>
249     </form></div>
250 [% END %]
251
252 [% IF ( delete_confirmed ) %]
253
254    <div class="dialog message"> <h3>Data deleted</h3>
255     <form action="[% script_name | html %]" method="post">
256         <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
257         <input type="submit" class="approve" value="OK" />
258     </form></div>
259 [% END %]
260
261
262 [% IF ( else ) %]
263 <h1>Authority MARC subfield structure admin for [% tagfield | html %] (authority: [% authtypecode | html %])</h1>
264 <p>This screen shows the subfields associated with the selected tag. You can edit subfields or add a new one by clicking on edit.</p>
265 <p>The column 'Koha field' shows that the subfield is linked with a Koha field.</p>
266
267 <table>
268     <tr>
269         <th>Subfield</th>
270         <th>Text</th>
271         <th>Constraints</th>
272         <th>&nbsp;</th>
273     </tr>
274     [% FOREACH loo IN loop %]
275     <tr>
276         <td>[% loo.tagsubfield | html %]</td>
277         <td>
278             [% IF ( loo.subfield_ignored ) %]
279                     <i>[% loo.liblibrarian | html_entity %]</i>
280             [% ELSE %]
281                     [% loo.liblibrarian | html_entity %]
282             [% END %]
283         </td>
284         <td>
285             [% IF ( loo.subfield_ignored ) %]
286                     <i>subfield ignored</i>
287             [% ELSE %]
288                 <strong>Tab:</strong>[% loo.tab | html %],
289                 [% IF ( loo.kohafield ) %] | <strong>Koha field:</strong> [% loo.kohafield | html %], [% END %]
290                 [% IF ( loo.repeatable ) %]Repeatable, [% ELSE %]Not repeatable,
291                 [% END %]
292                         [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,
293                 [% END %]
294                         [% IF ( loo.hidden ) %]hidden,
295                 [% END %]
296                         [% IF ( loo.isurl ) %]is a url,
297                 [% END %]
298                         [% IF ( loo.authorised_value ) %] | <strong>Auth value:</strong>[% loo.authorised_value | html %],
299                 [% END %]
300                         [% IF ( loo.frameworkcode ) %] | <strong>Authority:</strong>[% loo.frameworkcode | html %],
301                 [% END %]
302                 [% IF ( loo.value_builder ) %] | <strong>Plugin:</strong>[% loo.value_builder | html %],[% END %]
303             [% END %]
304         </td>
305         <td><a href="[% loo.delete | html %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a></td>
306     </tr>
307     [% END %]
308 </table>
309
310     <form action="[% script_name | html %]" method="get">
311     <fieldset class="action"><input type="hidden" name="op" value="add_form" />
312     <input type="hidden" name="tagfield" value="[% edit_tagfield | html %]" />
313     <input type="hidden" name="authtypecode" value="[% edit_authtypecode | html %]" />
314     <input type="submit" value="Edit subfields" />
315     <a class="cancel" href="auth_tag_structure.pl?searchfield=[% tagfield | uri%]&amp;authtypecode=[% authtypecode | uri %]">Cancel</a></fieldset>
316     </form>
317
318     [% IF ( previous ) %]
319     <input type="image" src="[% interface | html %]/[% theme | html %]/images/1leftarrow.png" title="previous" alt="previous" />
320     </a>
321     [% END %]
322     [% IF ( next ) %]
323         [% next | html %]
324     <input type="image" src="[% interface | html %]/[% theme | html %]/images/1rightarrow.png" title="next" alt="next" />
325     </a>
326     [% END %]
327
328 [% END %]
329
330 </div>
331 </div>
332 <div class="yui-b">
333 [% INCLUDE 'admin-menu.inc' %]
334 </div>
335 </div>
336
337 [% MACRO jsinclude BLOCK %]
338     [% Asset.js("js/admin-menu.js") | $raw %]
339     <script type="text/javascript">
340      $(document).ready(function() {
341         $('#subfieldtabs').tabs();
342      });
343     </script>
344 [% END %]
345 [% INCLUDE 'intranet-bottom.inc' %]