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