Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / marc_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;[% IF ( add_form ) %][% IF ( use_heading_flags_p ) %][% IF ( heading_edit_subfields_p ) %] MARC subfield structure &rsaquo; Edit MARC subfields constraints[% END %][% ELSE %] MARC subfield structure &rsaquo; [% action | html %][% END %][% END %]
6 [% IF ( delete_confirm ) %] MARC subfield structure &rsaquo; Confirm deletion of subfield [% tagsubfield | html %][% END %][% IF ( delete_confirmed ) %] MARC subfield structure &rsaquo; Subfield deleted[% END %][% IF ( else ) %]MARC subfield structure[% END %]</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9
10 <body id="admin_marc_subfields_structure" class="admin">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'prefs-admin-search.inc' %]
13
14 <div id="breadcrumbs">
15   <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a> &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode | html %]&amp;searchfield=[% tagfield | uri %]">[% IF ( frameworkcode ) %][% frameworkcode | html %][% ELSE %]Default[% END %] framework structure</a> &rsaquo;
16   [% IF ( add_form ) %]
17   [% IF ( use_heading_flags_p ) %]
18   [% IF ( heading_edit_subfields_p ) %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | html %]">Tag [% tagfield | html %] subfield structure</a> &rsaquo; Edit subfields constraints
19   [% END %]
20   [% ELSE %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | html %]">Tag [% tagfield | html %] Subfield structure</a> &rsaquo; [% action | html %]
21   [% END %]
22   [% END %]
23 [% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | html %]">Tag [% tagfield | html %] Subfield structure</a> &rsaquo; Confirm deletion of subfield [% tagsubfield | html %]
24 [% END %]
25 [% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | html %]">Tag [% tagfield | html %] subfield structure</a> &rsaquo; Subfield deleted
26 [% END %]
27 [% IF ( else ) %]Tag [% tagfield | html %] Subfield structure[% END %]
28 </div>
29
30 <div id="doc3" class="yui-t2">
31
32     <div id="bd">
33     <div id="yui-main">
34     <div class="yui-b">
35
36 [% IF ( add_form ) %]
37     <h1>
38         [% IF ( use_heading_flags_p ) %]
39             [% IF ( heading_edit_subfields_p ) %]Tag [% tagfield | html %] Subfield constraints[% END %]
40         [% ELSE %]
41             [% action | html %]
42         [% END %]
43     </h1>
44     <form action="[% script_name | html %]" name="Aform" method="post">
45     <input type="hidden" name="op" value="add_validate" />
46     <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
47     <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
48     <div id="subfieldtabs" class="toptabs numbered">
49    <ul>
50         [% FOREACH loo IN loop %]
51             [% IF ( loo.new_subfield ) %]
52                 <li><a href="#sub[% loo.urisubfieldcode | html %]field" title="[% loo.liblibrarian | html_entity %]">New</a></li>
53             [% ELSE %]
54                 <li><a href="#sub[% loo.urisubfieldcode | html %]field" title="[% loo.liblibrarian | html_entity %]">
55                     [% loo.subfieldcode | html %]
56                </a></li>
57             [% END %]
58         [% END %]
59     </ul>
60     
61     [% FOREACH loo IN loop %] 
62         <div class="constraints" id="sub[% loo.urisubfieldcode | html %]field">
63
64                <h3><a href="#basic[% loo.urisubfieldcode | html %]">Basic constraints</a></h3>
65                     <div id="basic[% loo.urisubfieldcode | html %]">
66                     <fieldset class="rows">
67                         <ol>
68                                 [% IF ( subfieldcode == 0 || subfieldcode ) %] 
69                                 <li><span class="label">Subfield code:</span> [% loo.subfieldcode | html %] <input type="hidden" name="tagsubfield" value="[% loo.subfieldcode | html %]" /></li>
70                                 [% ELSE %]
71                                 <li><label for="tagsubfield[% loo.row | html %]">Subfield code:</label> <input type="text" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% loo.subfieldcode | html %]" /></li>
72                                 [% END %]
73                         <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>
74                         <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>
75                         <li>
76                             <label for="repeatable[% loo.row | html %]">Repeatable: </label>
77                             [% IF loo.repeatable %]
78                                 <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
79                             [% ELSE %]
80                                 <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
81                             [% END %]
82                         </li>
83                         <li>
84                             <label for="mandatory[% loo.row | html %]">Mandatory: </label>
85                             [% IF loo.mandatory %]
86                                 <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
87                             [% ELSE %]
88                                 <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
89                             [% END %]
90                         </li>
91                         <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
92                             <select name="tab" tabindex="" size="1" id="tab[% loo.row | html %]">
93                             [%- IF ( loo.tab ==  -1 ) -%]
94                                 <option value="-1" selected="selected">ignore</option>
95                             [%- ELSE -%]
96                                 <option value="-1">ignore</option>
97                             [%- END -%]
98                             [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
99                                 [%- IF ( loo.tab ==  t ) -%]
100                                 <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
101                                 [%- ELSE -%]
102                                 <option value="[%- t | html -%]">[%- t | html -%]</option>
103                                 [%- END -%]
104                             [%- END -%]
105                             [%- IF ( loo.tab ==  10 ) -%]
106                                 <option value="10" selected="selected">items (10)</option>
107                             [%- ELSE -%]
108                                 <option value="10">items (10)</option>
109                             [%- END -%]
110                             </select>
111                             (ignore means that the subfield does not display in the record editor)
112                         </li>
113                         </ol>
114                     </fieldset>
115                     </div>
116
117
118             <h3><a href="#advanced[% loo.urisubfieldcode | html %]">Advanced constraints</a></h3>
119             <div id="advanced[% loo.urisubfieldcode | html %]">
120             <fieldset class="rows">
121                 <ol><li><label for="defaultvalue[% loo.row | html %]">Default value:</label>
122                     <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" /></li>
123                                 <li><label for="maxlength[% loo.row | html %]">Max length:</label><input type="text" id="maxlength[% loo.row | html %]" name="maxlength" value="[% loo.maxlength | html %]" size="4" /> (see online help)</li>
124                 <li><input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" />
125                     <label for="hidden[% loo.row | html %]" style="float: none;">Visibility: </label>
126                     <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
127                     <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
128                     <input type="checkbox" id="hidden_intranet_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_intranet_[% loo.row | html %]"/>
129                     <label for="hidden_intranet_[% loo.row | html %]" style="float: none;">Intranet</label>
130                     <input type="checkbox" id="hidden_editor_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_editor_[% loo.row | html %]"/>
131                     <label for="hidden_editor_[% loo.row | html %]" style="float: none;">Editor</label>
132                     <input type="checkbox" id="hidden_collapsed_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_collapsed_[% loo.row | html %]"/>
133                     <label for="hidden_collapsed_[% loo.row | html %]" style="float: none;">Collapsed</label>
134                     <input type="checkbox" id="hidden_flagged_[% loo.row | html %]" name="flagged_[% loo.row | html %]"/>
135                     <label for="hidden_flagged_[% loo.row | html %]" style="float: none;">Flagged</label>
136                 </li>
137                 <li>
138                     <label for="isurl[% loo.row | html %]">Is a URL:</label>
139                     [% IF loo.isurl %]
140                         <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
141                     [% ELSE %]
142                         <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
143                     [% END %]
144                     (if checked, it means that the subfield is a URL and can be clicked)
145                 </li>
146                 <li><label for="link[% loo.row | html %]">Link:</label><input type="text" id="link[% loo.row | html %]" name="link" value="[% loo.link | html %]" size="10" maxlength="80" /> (e.g., Title or Local-Number) <span class="error"><em>NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</em></span></li>
147                 <li>
148                     <label for="kohafield[% loo.row | html %]">Koha link:</label>
149                     <!-- This select should be DISABLED; value is submitted by the following hidden input -->
150                     <select name="kohafield" id="kohafield[% loo.row | html %]" size="1" disabled>
151                     [% FOREACH value IN loo.kohafields %]
152                       [% IF ( value == loo.kohafield ) %]
153                         <option value="[% value | html %]" selected="selected">[% value | html %]</option>
154                       [% ELSE %]
155                         <option value="[% value | html %]">[% value | html %]</option>
156                       [% END %]
157                     [% END %]
158                     </select>
159                     <!-- Do NOT remove this next hidden input! We need it to save kohafield. -->
160                     <input type="hidden" name="kohafield" value="[% loo.kohafield | html %]"/>
161                 </li>
162                         </ol>
163             </fieldset>
164             </div>
165             <h3><a href="#oth[% loo.urisubfieldcode | html %]">Other options (choose one)</a></h3>
166             <div id="oth[% loo.urisubfieldcode | html %]">
167             <fieldset class="rows">
168                         <ol>
169                             <li>
170                                 <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
171                                 <select name="authorised_value" id="authorised_value[% loo.row | html %]" size="1">
172                                 <option value=""></option>
173                                 [% FOREACH value IN loo.authorised_values %]
174                                     [% IF ( value == loo.authorised_value ) %]
175                                     <option value="[% value | html %]" selected="selected">[% value | html %]</option>
176                                     [% ELSE %]
177                                     <option value="[% value | html %]">[% value | html %]</option>
178                                     [% END %]
179                                 [% END %]
180                                 </select>
181                             </li>
182                             <li>
183                                 <label for="authtypecode[% loo.row | html %]">Thesaurus:</label>
184                                 <select name="authtypecode" id="authtypecode[% loo.row | html %]" size="1">
185                                 [% FOREACH value IN loo.authtypes %]
186                                     [% IF ( value == loo.authtypecode ) %]
187                                     <option value="[% value | html %]" selected="selected">[% value | html %]</option>
188                                     [% ELSE %]
189                                     <option value="[% value | html %]">[% value | html %]</option>
190                                     [% END %]
191                                 [% END %]
192                                 </select>
193                             </li>
194                             <li>
195                                 <label for="value_builder[% loo.row | html %]">Plugin:</label>
196                                 <select name="value_builder" id="value_builder[% loo.row | html %]" size="1">
197                                 [% FOREACH value IN loo.value_builders %]
198                                     [% IF ( value == loo.value_builder ) %]
199                                     <option value="[% value | html %]" selected="selected">[% value | html %]</option>
200                                     [% ELSE %]
201                                     <option value="[% value | html %]">[% value | html %]</option>
202                                     [% END %]
203                                 [% END %]
204                                 </select>
205                             </li>
206                         </ol>
207             </fieldset>
208             </div>
209         </div><!-- /content_sub -->
210         [% END %]
211                 </div><!-- /content -->
212     <fieldset class="action">
213         <input type="submit" value="Save changes" /> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield  | uri %]&amp;frameworkcode=[% frameworkcode | html %]" class="cancel">Cancel</a>
214     </fieldset>
215     </form>
216 [% END %]
217
218 [% IF ( delete_confirm ) %]
219
220     <div class="dialog alert">
221         <h3>Confirm deletion of subfield [% tagsubfield | html %]?</h3>
222         <p>Subfield: [% tagsubfield | html %]</p>
223         <p>Description: [% liblibrarian | html_entity %]</p>
224
225         <form action="[% delete_link | html %]" method="post"><input type="hidden" name="op" value="delete_confirmed" />
226             <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
227             <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
228             <input type="hidden" name="tagsubfield" value="[% tagsubfield | html %]" />
229             <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
230             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this subfield</button>
231         </form>
232
233
234         <form action="[% script_name | html %]" method="post">
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="frameworkcode" value="[% frameworkcode | html %]" />
239             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
240         </form>
241     </div>
242
243 [% END %]
244
245 [% IF ( delete_confirmed ) %]
246
247     <h3>Data deleted</h3>
248     <form action="[% script_name | html %]" method="post">
249         <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
250     <input type="submit" value="OK" />
251     </form>
252 [% END %]
253
254
255 [% IF ( else ) %]
256 <h1>MARC subfield structure admin for [% tagfield | html %] [% IF ( frameworkcode ) %](framework [% frameworkcode | html %])[% ELSE %](default framework)[% END %]</h1>
257 <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>
258 <p>The column 'Koha field' shows that the subfield is linked with a Koha field.</p>
259
260 <table>
261 <tr>
262     <th>Subfield</th>
263     <th>Text</th>
264     <th>Constraints</th>
265     <th>Actions</th>
266 </tr>
267 [% FOREACH loo IN loop %]
268 <tr>
269     <td><a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | html %]&amp;frameworkcode=[% frameworkcode | html %]#sub[% loo.tagsubfield | html %]field">[% loo.tagsubfield | html %]</a></td>
270     <td>
271         [% IF ( loo.subfield_ignored ) %]
272             <i>[% loo.liblibrarian | html_entity %]</i>
273         [% ELSE %]
274             [% loo.liblibrarian | html_entity %]
275         [% END %]
276     </td>
277     <td>
278         [% IF ( loo.subfield_ignored ) %]
279             <i>subfield ignored</i>
280         [% ELSE %]
281             Tab:[% loo.tab | html %],
282             [% IF ( loo.kohafield ) %] | Koha field: [% loo.kohafield | html %], [% END %]
283             [% IF ( loo.repeatable ) %]Repeatable, [% ELSE %]Not repeatable,[% END %]
284             [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,[% END %]
285             [% IF ( loo.seealso ) %] | See Also: [% loo.seealso | html %],[% END %]
286             [% IF ( loo.hidden ) %]hidden,[% END %]
287             [% IF ( loo.isurl ) %]is a URL,[% END %]
288             [% IF ( loo.authorised_value ) %] | Auth value:[% loo.authorised_value | html %],[% END %]
289             [% IF ( loo.authtypecode ) %] | Authority:[% loo.authtypecode | html %],[% END %]
290             [% IF ( loo.value_builder ) %] | Plugin:[% loo.value_builder | html %],[% END %]
291             [% IF ( loo.link ) %] | Link:[% loo.link | html %],[% END %]
292         [% END %]
293     </td>
294     <td class="actions">
295         <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | html %]&amp;frameworkcode=[% frameworkcode | html %]#sub[% loo.tagsubfield | html %]field" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
296         <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=delete_confirm&amp;tagfield=[% loo.tagfield | html %]&amp;tagsubfield=[% loo.tagsubfield | html %]&amp;frameworkcode=[% frameworkcode | html %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
297     </td>
298 </tr>
299 [% END %]
300 </table>
301
302 <form action="[% script_name | html %]" method="get">
303     <fieldset class="action"><input type="hidden" name="op" value="add_form" />
304     <input type="hidden" name="tagfield" value="[% edit_tagfield | html %]" />
305     <input type="hidden" name="frameworkcode" value="[% edit_frameworkcode | html %]" />
306     <input type="submit" value="Edit subfields" />
307         <a class="cancel" href="marctagstructure.pl?searchfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | html %]">Cancel</a>
308         </fieldset>
309 </form>
310
311 [% END %]
312
313
314
315 </div>
316 </div>
317 <div class="yui-b noprint">
318     [% INCLUDE 'admin-menu.inc' %]
319 </div>
320 </div>
321
322 [% MACRO jsinclude BLOCK %]
323     [% Asset.js("js/admin-menu.js") | $raw %]
324     [% Asset.js("js/marc_subfields_structure.js") | $raw %]
325 [% END %]
326 [% INCLUDE 'intranet-bottom.inc' %]