Bug 28438: Capitalization: Various corrections
[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>
6     [%- IF ( add_form ) -%]
7         [%- IF ( use_heading_flags_p ) -%]
8             [%- IF ( heading_edit_subfields_p ) -%]
9                 Edit MARC subfields constraints &rsaquo; MARC subfield structure
10             [%- END -%]
11
12         [%- ELSE -%]
13             [%- action | html -%] &rsaquo; MARC subfield structure
14         [%- END -%]
15
16     [%- END -%]
17
18     [%- IF ( delete_confirm ) -%]
19
20         MARC subfield structure &rsaquo; Confirm deletion of subfield [%- mss.tagsubfield | html -%]
21
22         Confirm deletion of subfield [%- tagsubfield | html -%] &rsaquo; MARC subfield structure
23     [%- END -%]
24
25     [%- IF ( delete_confirmed ) -%]
26         Subfield deleted &rsaquo; MARC subfield structure
27
28     [%- END -%]
29
30     [%- IF ( else ) -%]
31         MARC subfield structure
32     [%- END -%] &rsaquo; Administration &rsaquo; Koha
33 </title>
34 [% INCLUDE 'doc-head-close.inc' %]
35 <style>.constraints::after { content:  " "; clear: both; display:block; }</style>
36 </head>
37
38 <body id="admin_marc_subfields_structure" class="admin">
39     [% INCLUDE 'header.inc' %]
40     [% INCLUDE 'prefs-admin-search.inc' %]
41
42     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
43         <ol>
44             <li>
45                 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
46             </li>
47             <li>
48                 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
49             </li>
50             <li>
51                 <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
52             </li>
53             <li>
54                 <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode | uri %]&amp;searchfield=[% tagfield | uri %]">
55                     [% IF ( frameworkcode ) %]
56                         [% frameworkcode | html %]
57                     [% ELSE %]
58                         Default
59                     [% END %] framework structure
60                 </a>
61             </li>
62
63             [% IF ( add_form ) %]
64                 [% IF ( use_heading_flags_p ) %]
65                     [% IF ( heading_edit_subfields_p ) %]
66                         <li>
67                             <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] subfield structure</a>
68                         </li>
69                         <li>
70                             <a href="#" aria-current="page">
71                                 Edit subfields constraints
72                             </a>
73                         </li>
74                     [% END %]
75                 [% ELSE %]
76                     <li>
77                         <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] Subfield structure</a>
78                     </li>
79                     <li>
80                         <a href="#" aria-current="page">
81                             [% action | html %]
82                         </a>
83                     </li>
84                 [% END %]
85             [% END %]
86
87             [% IF ( delete_confirm ) %]
88                 <li>
89                     <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% mss.tagfield | uri %]&amp;frameworkcode=[% mss.frameworkcode | uri %]">Tag [% mss.tagfield | html %] Subfield structure</a>
90                 </li>
91                 <li>
92                     <a href="#" aria-current="page">
93                         Confirm deletion of subfield [% mss.tagsubfield | html %]i
94                     </a>
95                 </li>
96             [% END %]
97
98             [% IF ( else ) %]
99                 <li>
100                     <a href="#" aria-current="page">
101                         Tag [% tagfield | html %] Subfield structure
102                     </a>
103                 </li>
104             [% END %]
105         </ol>
106     </nav> <!-- /#breadcrumbs -->
107
108     <div class="main container-fluid">
109         <div class="row">
110             <div class="col-sm-10 col-sm-push-2">
111                 <main>
112
113                     [% IF ( add_form ) %]
114                         <h1>
115                             [% IF ( use_heading_flags_p ) %]
116                                 [% IF ( heading_edit_subfields_p ) %]Tag [% tagfield | html %] Subfield constraints[% END %]
117                             [% ELSE %]
118                                 [% action | html %]
119                             [% END %]
120                         </h1>
121
122                         <form action="[% script_name | html %]" name="Aform" method="post">
123                             <input type="hidden" name="op" value="add_validate" />
124                             <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
125                             <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
126
127                             <div id="subfieldtabs" class="toptabs numbered">
128                                 <ul>
129                                     [% FOREACH loo IN loop %]
130                                         <li id="tab_subfield_[% loo.urisubfieldcode | html %]">
131                                             [% IF ( loo.new_subfield ) %]
132                                                 <a href="#sub[% loo.urisubfieldcode | uri %]field" title="[% loo.liblibrarian | html_entity %]">New</a>
133                                             [% ELSE %]
134                                                 <a href="#sub[% loo.urisubfieldcode | uri %]field" title="[% loo.liblibrarian | html_entity %]">
135                                                     [% loo.subfieldcode | html %]
136                                                 </a>
137                                             [% END %]
138                                         </li>
139                                     [% END %]
140                                 </ul>
141
142                                 [% FOREACH loo IN loop %]
143                                     <div class="constraints" id="sub[% loo.urisubfieldcode | uri %]field">
144                                         <div id="basic[% loo.urisubfieldcode | html %]" class="contraints">
145                                             <fieldset class="rows">
146                                                 <legend>Basic constraints</legend>
147                                                 <ol>
148                                                     [% IF ( subfieldcode == 0 || subfieldcode ) %]
149                                                         <li>
150                                                             <span class="label">Subfield code:</span>
151                                                             [% loo.subfieldcode | html %] <input type="hidden" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
152                                                         </li>
153                                                     [% ELSE %]
154                                                         <li>
155                                                             <label for="tagsubfield[% loo.row | html %]">Subfield code:</label>
156                                                                 <input type="text" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
157                                                             </li>
158                                                     [% END %]
159                                                     <li>
160                                                         <label for="liblibrarian[% loo.row | html %]">Text for librarian: </label>
161                                                         <input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" />
162                                                     </li>
163                                                     <li>
164                                                         <label for="libopac[% loo.row | html %]">Text for OPAC: </label>
165                                                         <input type="text" id="libopac[% loo.row | html %]" name="libopac" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" />
166                                                     </li>
167                                                     <li>
168                                                         <label for="repeatable[% loo.row | html %]">Repeatable: </label>
169                                                         [% IF loo.repeatable %]
170                                                             <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
171                                                         [% ELSE %]
172                                                             <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
173                                                         [% END %]
174                                                     </li>
175                                                     <li>
176                                                         <label for="mandatory[% loo.row | html %]">Mandatory: </label>
177                                                         [% IF loo.mandatory %]
178                                                             <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
179                                                         [% ELSE %]
180                                                             <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
181                                                         [% END %]
182                                                     </li>
183                                                     <li>
184                                                         <label for="important[% loo.row | html %]">Important: </label>
185                                                         [% IF loo.important %]
186                                                             <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" checked="checked" value="1" />
187                                                         [% ELSE %]
188                                                             <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" value="1" />
189                                                         [% END %]
190                                                     </li>
191                                                     <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
192                                                         <select name="tab" tabindex="" id="tab[% loo.row | html %]">
193                                                         [%- IF ( loo.tab ==  -1 ) -%]
194                                                             <option value="-1" selected="selected">ignore</option>
195                                                         [%- ELSE -%]
196                                                             <option value="-1">ignore</option>
197                                                         [%- END -%]
198                                                         [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
199                                                             [%- IF ( loo.tab ==  t ) -%]
200                                                             <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
201                                                             [%- ELSE -%]
202                                                             <option value="[%- t | html -%]">[%- t | html -%]</option>
203                                                             [%- END -%]
204                                                         [%- END -%]
205                                                         [%- IF ( loo.tab ==  10 ) -%]
206                                                             <option value="10" selected="selected">items (10)</option>
207                                                         [%- ELSE -%]
208                                                             <option value="10">items (10)</option>
209                                                         [%- END -%]
210                                                         </select>
211                                                         <div class="hint">Ignore means that the subfield does not display in the record editor</div>
212                                                     </li>
213                                                 </ol>
214                                             </fieldset> <!-- /.rows -->
215                                         </div> <!-- /#basic[% loo.urisubfieldcode | html %] -->
216
217                                         <div id="advanced[% loo.urisubfieldcode | html %]" class="contraints">
218                                             <fieldset class="rows">
219                                                 <legend>Advanced constraints</legend>
220                                                 <ol>
221                                                     <li>
222                                                         <label for="defaultvalue[% loo.row | html %]">Default value:</label>
223                                                         <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
224                                                     </li>
225                                                     <li>
226                                                         <label for="maxlength[% loo.row | html %]">Max length:</label>
227                                                         <input type="text" id="maxlength[% loo.row | html %]" name="maxlength" value="[% loo.maxlength | html %]" size="4" />
228                                                     </li>
229                                                     <li>
230                                                         [% IF loo.hidden_protected %]
231                                                             <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" data-koha-protected="1" />
232                                                         [% ELSE %]
233                                                             <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" />
234                                                         [% END %]
235                                                         <label for="hidden[% loo.row | html %]">Visibility: </label>
236                                                         <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
237                                                         <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
238                                                         <input type="checkbox" id="hidden_intranet_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_intranet_[% loo.row | html %]"/>
239                                                         <label for="hidden_intranet_[% loo.row | html %]" style="float: none;">Intranet</label>
240                                                         <input type="checkbox" id="hidden_editor_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_editor_[% loo.row | html %]"/>
241                                                         <label for="hidden_editor_[% loo.row | html %]" style="float: none;">Editor</label>
242                                                         <input type="checkbox" id="hidden_collapsed_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_collapsed_[% loo.row | html %]"/>
243                                                         <label for="hidden_collapsed_[% loo.row | html %]" style="float: none;">Collapsed</label>
244                                                         <input type="checkbox" id="hidden_flagged_[% loo.row | html %]" name="flagged_[% loo.row | html %]"/>
245                                                         <label for="hidden_flagged_[% loo.row | html %]" style="float: none;">Flagged</label>
246                                                     </li>
247                                                     <li>
248                                                         <label for="isurl[% loo.row | html %]">Is a URL:</label>
249                                                         [% IF loo.isurl %]
250                                                             <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
251                                                         [% ELSE %]
252                                                             <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
253                                                         [% END %]
254                                                         <div class="hint">If checked, it means that the subfield is a URL and can be clicked</div>
255                                                     </li>
256                                                     <li>
257                                                         <label for="link[% loo.row | html %]">Link:</label>
258                                                         <input type="text" id="link[% loo.row | html %]" name="link" value="[% loo.link | html %]" size="10" maxlength="80" />
259                                                         <div class="hint">An index name, e.g. title or Local-Number</div>
260                                                     </li>
261                                                     <li>
262                                                         <label for="kohafield[% loo.row | html %]">Koha link:</label>
263                                                         <!-- This select should be DISABLED; value is submitted by the following hidden input -->
264                                                         <select name="kohafield" id="kohafield[% loo.row | html %]" disabled>
265                                                         [% FOREACH value IN loo.kohafields %]
266                                                         [% IF ( value == loo.kohafield ) %]
267                                                             <option value="[% value | html %]" selected="selected">[% value | html %]</option>
268                                                         [% ELSE %]
269                                                             <option value="[% value | html %]">[% value | html %]</option>
270                                                         [% END %]
271                                                         [% END %]
272                                                         </select>
273                                                         <!-- Do NOT remove this next hidden input! We need it to save kohafield. -->
274                                                         <input type="hidden" name="kohafield" value="[% loo.kohafield | html %]"/>
275                                                     </li>
276                                                 </ol>
277                                             </fieldset> <!-- /.rows -->
278                                         </div> <!-- /#advanced[% loo.urisubfieldcode | html %] -->
279
280                                         <div id="oth[% loo.urisubfieldcode | html %]" class="constraints">
281                                             <fieldset class="rows">
282                                                 <legend>Other options (choose one)</legend>
283                                                 <ol>
284                                                     <li>
285                                                         <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
286                                                         <select name="authorised_value" id="authorised_value[% loo.row | html %]">
287                                                         <option value=""></option>
288                                                         [% FOREACH value IN loo.authorised_values %]
289                                                             [% IF ( value == loo.authorised_value ) %]
290                                                                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
291                                                             [% ELSE %]
292                                                                 <option value="[% value | html %]">[% value | html %]</option>
293                                                             [% END %]
294                                                         [% END %]
295                                                         </select>
296                                                     </li>
297                                                     <li>
298                                                         <label for="authtypecode[% loo.row | html %]">Thesaurus:</label>
299                                                         <select name="authtypecode" id="authtypecode[% loo.row | html %]">
300                                                         [% FOREACH value IN loo.authtypes %]
301                                                             [% IF ( value == loo.authtypecode ) %]
302                                                                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
303                                                             [% ELSE %]
304                                                                 <option value="[% value | html %]">[% value | html %]</option>
305                                                             [% END %]
306                                                         [% END %]
307                                                         </select>
308                                                     </li>
309                                                     <li>
310                                                         <label for="value_builder[% loo.row | html %]">Plugin:</label>
311                                                         <select name="value_builder" id="value_builder[% loo.row | html %]">
312                                                         [% FOREACH value IN loo.value_builders %]
313                                                             [% IF ( value == loo.value_builder ) %]
314                                                                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
315                                                             [% ELSE %]
316                                                                 <option value="[% value | html %]">[% value | html %]</option>
317                                                             [% END %]
318                                                         [% END %]
319                                                         </select>
320                                                     </li>
321                                                 </ol>
322                                             </fieldset> <!-- /.rows -->
323                                         </div> <!-- /#oth[% loo.urisubfieldcode | html %] -->
324                                     </div><!-- /constraints -->
325                                 [% END # /FOREACH loo %]
326                             </div><!-- /subfieldtabs -->
327
328                             <fieldset class="action">
329                                 <input type="submit" value="Save changes" /> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield  | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="cancel">Cancel</a>
330                             </fieldset>
331                         </form>
332                     [% END # /IF ( add_form ) %]
333
334                     [% IF ( delete_confirm ) %]
335                         <div class="dialog alert">
336                             <h3>Confirm deletion of subfield [% mss.tagsubfield | html %]?</h3>
337                             <p>Subfield: [% mss.tagsubfield | html %]</p>
338                             <p>Description: [% mss.liblibrarian | html_entity %]</p>
339
340                             <form action="[% delete_link | html %]" method="post"><input type="hidden" name="op" value="delete_confirmed" />
341                                 <input type="hidden" name="tagfield" value="[% mss.tagfield | html %]" />
342                                 <input type="hidden" name="tagsubfield" value="[% mss.tagsubfield | html %]" />
343                                 <input type="hidden" name="frameworkcode" value="[% mss.frameworkcode | html %]" />
344                                 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this subfield</button>
345                             </form>
346
347
348                             <form action="[% script_name | html %]" method="post">
349                                 <input type="hidden" name="tagfield" value="[% mss.tagfield | html %]" />
350                                 <input type="hidden" name="tagsubfield" value="[% mss.tagsubfield | html %]" />
351                                 <input type="hidden" name="frameworkcode" value="[% mss.frameworkcode | html %]" />
352                                 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
353                             </form>
354                         </div> <!-- /.dialog.alert -->
355                     [% END # /IF ( delete_confirm ) %]
356
357                     [% IF ( else ) %]
358                         <h1>MARC subfield structure admin for [% tagfield | html %] [% IF ( frameworkcode ) %](framework [% frameworkcode | html %])[% ELSE %](default framework)[% END %]</h1>
359
360                         <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>
361                         <p>The column 'Koha field' shows that the subfield is linked with a Koha field.</p>
362
363                         <table id="table_marcsubfieldstructure">
364                             <thead>
365                                 <tr>
366                                     <th>Subfield</th>
367                                     <th>Text</th>
368                                     <th>Constraints</th>
369                                     <th class="NoSort noExport">Actions</th>
370                                 </tr>
371                             </thead>
372                             <tbody>
373                                 [% FOREACH loo IN loop %]
374                                     <tr>
375                                         <td><a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]#sub[% loo.tagsubfield | uri %]field">[% loo.tagsubfield | html %]</a></td>
376                                         <td>
377                                             [% IF loo.tab == -1 %]
378                                                 <em>[% loo.liblibrarian | html_entity %]</em>
379                                             [% ELSE %]
380                                                 [% loo.liblibrarian | html_entity %]
381                                             [% END %]
382                                         </td>
383                                         <td>
384                                             [% IF loo.tab == -1 %]
385                                                 <em>subfield ignored</em>
386                                             [% ELSE %]
387                                                 Tab:[% loo.tab | html %],
388                                                 [% IF ( loo.kohafield ) %] | Koha field: [% loo.kohafield | html %], [% END %]
389                                                 [% IF ( loo.repeatable ) %]Repeatable, [% ELSE %]Not repeatable,[% END %]
390                                                 [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,[% END %]
391                                                 [% IF ( loo.important ) %]Important, [% ELSE %]Not important,[% END %]
392                                                 [% IF ( loo.seealso ) %] | See also: [% loo.seealso | html %],[% END %]
393                                                 [% IF ( loo.hidden ) %]hidden,[% END %]
394                                                 [% IF ( loo.isurl ) %]is a URL,[% END %]
395                                                 [% IF ( loo.authorised_value ) %] | Auth value:[% loo.authorised_value | html %],[% END %]
396                                                 [% IF ( loo.authtypecode ) %] | Authority:[% loo.authtypecode | html %],[% END %]
397                                                 [% IF ( loo.value_builder ) %] | Plugin:[% loo.value_builder | html %],[% END %]
398                                                 [% IF ( loo.link ) %] | Link:[% loo.link | html %],[% END %]
399                                             [% END %]
400                                         </td>
401                                         <td class="actions">
402                                             <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]#sub[% loo.tagsubfield | uri %]field" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
403                                             <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=delete_confirm&amp;tagfield=[% loo.tagfield | uri %]&amp;tagsubfield=[% loo.tagsubfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
404                                         </td>
405                                     </tr>
406                                 [% END %]
407                             </tbody>
408                         </table> <!-- /#table_marcsubfieldstructure -->
409
410                         <form action="[% script_name | html %]" method="get">
411                             <fieldset class="action"><input type="hidden" name="op" value="add_form" />
412                                 <input type="hidden" name="tagfield" value="[% edit_tagfield | html %]" />
413                                 <input type="hidden" name="frameworkcode" value="[% edit_frameworkcode | html %]" />
414                                 <input type="submit" value="Edit subfields" />
415                                 <a class="cancel" href="marctagstructure.pl?searchfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | html %]">Cancel</a>
416                             </fieldset>
417                         </form>
418
419                     [% END # /IF else %]
420
421                 </main>
422             </div> <!-- /.col-sm-10.col-sm-push-2 -->
423
424             <div class="col-sm-2 col-sm-pull-10">
425                 <aside>
426                     [% INCLUDE 'admin-menu.inc' %]
427                 </aside>
428             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
429         </div> <!-- /.row -->
430
431     [% MACRO jsinclude BLOCK %]
432         [% INCLUDE 'datatables.inc' %]
433         [% Asset.js("js/admin-menu.js") | $raw %]
434         [% Asset.js("js/marc_subfields_structure.js") | $raw %]
435     [% END %]
436
437     [% INCLUDE 'intranet-bottom.inc' %]