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