4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Authority MARC subfield structure › Administration › Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
9 <body id="admin_auth_subfields_structure" class="admin">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'prefs-admin-search.inc' %]
13 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
16 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
19 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
22 <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a>
25 [% IF ( authtypecode ) %]
27 <a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | uri%]">[% authtypecode | html %] framework</a>
31 <a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
37 <a href="#" aria-current="page">
38 Authority MARC subfield structure for [% tagfield | html %]
43 <a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield | uri %]&tagsubfield=[% tagsubfield | uri %]&authtypecode=[% authtypecode |uri %]">Authority MARC subfield structure for [% tagfield | html %]</a>
47 [% IF ( delete_confirm ) %]
49 <a href="#" aria-current="page">
50 Confirm deletion of subfield [% tagsubfield | html %]?
56 [% IF ( use_heading_flags_p ) %]
57 [% IF ( heading_edit_subfields_p ) %]
59 <a href="#" aria-current="page">
60 Edit MARC subfields constraints
66 <a href="#" aria-current="page">
75 <div class="main container-fluid">
77 <div class="col-sm-10 col-sm-push-2">
82 <h1>[% IF ( use_heading_flags_p ) %]
83 [% IF ( heading_edit_subfields_p ) %]Edit MARC subfields constraints for field [% tagfield | html %] authority [% authtypecode | html %][% END %]
84 [% ELSE %][% action | html %][% END %]</h1>
85 <form action="[% script_name | html %]" name="Aform" method="post">
86 <input type="hidden" name="op" value="add_validate" />
87 <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
88 <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
89 <fieldset class="action"><input type="submit" class="submit" value="Save changes" /> <a class="cancel" href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield | uri %]&authtypecode=[% authtypecode | uri %]">Cancel</a></fieldset>
90 <div id="subfieldtabs" class="toptabs numbered">
92 [% FOREACH loo IN loop %]
93 <li id="tab_subfield_[% loo.tagsubfield | html %]">
94 [% IF ( loo.new_subfield ) %]
95 <a href="#sub[% loo.tagsubfield | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">New</a>
97 <a href="#sub[% loo.tagsubfield | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">[% loo.tagsubfield | html %]</a>
103 [% FOREACH loo IN loop %]
104 <div id="sub[% loo.tagsubfield | html %]field">
105 <fieldset class="rows"><ol>
107 [% IF ( loo.new_subfield ) %]
109 <label for="tagsubfieldinput[% loo.row | html %]">Subfield code: </label>
110 <input type="text" name="tagsubfield" value="[% loo.tagsubfield | html %]" size="1" id="tagsubfield" maxlength="1" />
114 <input type="hidden" name="tagsubfield" value="[% loo.tagsubfield | html %]" />
118 <label for="repeatable[% loo.row | html %]">Repeatable: </label>
119 [% IF loo.repeatable %]
120 <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
122 <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
126 <label for="mandatory[% loo.row | html %]">Mandatory: </label>
127 [% IF loo.mandatory %]
128 <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
130 <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
133 <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>
134 <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>
135 <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
136 <select name="tab" id="tab[% loo.row | html %]">
137 [%- IF ( loo.tab == -1 ) -%]
138 <option value="-1" selected="selected">ignore</option>
140 <option value="-1">ignore</option>
142 [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%]
143 [%- IF ( loo.tab == t && t.length>0 ) -%]
144 <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
145 [%- ELSIF ( loo.tab == t ) -%]
146 <option value="[%- t | html -%]" selected="selected"> </option>
148 <option value="[%- t | html -%]">[%- t | html -%]</option>
152 (ignore means that the subfield does not display in the record editor)
156 <legend>Display</legend>
158 <li><label for="ohidden[% loo.row | html %]">Select to display or not:</label>
159 <select name="ohidden" id="ohidden[% loo.row | html %]">
160 [%- IF ( loo.hidden == 0 ) -%]
161 <option value= "0" selected="selected">Show all</option>
162 <option value="1">Hide all</option>
164 [%# All other non-zero values mean: Hide %]
165 <option value= "0">Show all</option>
166 <option value="1" selected="selected">Hide all</option>
174 <fieldset class="rows">
175 <legend>Advanced constraints:</legend>
178 <label for="isurl[% loo.row | html %]">Is a URL:</label>
180 <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
182 <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
184 (if checked, it means that the subfield is a URL and can be clicked)
187 <label for="defaultvalue[% loo.row | html %]">Default value:</label>
188 <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
194 <fieldset><legend>Help input</legend>
197 <label for="kohafield[% loo.row | html %]">Koha field:</label>
198 <select name="kohafield" id="kohafield[% loo.row | html %]">
199 [%- FOREACH value IN loo.kohafields %]
200 [% IF ( value == loo.kohafield && value.length>0 ) -%]
201 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
202 [%- ELSIF ( value == loo.kohafield ) -%]
203 <option value="[% value | html %]" selected="selected"> </option>
204 [%- ELSIF ( value.length==0 ) -%]
205 <option value="[% value | html %]"> </option>
207 <option value="[% value | html %]">[% value | html %]</option>
213 <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
214 <select name="authorised_value" id="authorised_value[% loo.row | html %]">
215 [%- FOREACH value IN loo.authorised_values %]
216 [% IF ( value == loo.authorised_value && value.length>0 ) -%]
217 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
218 [%- ELSIF ( value == loo.authorised_value ) -%]
219 <option value="[% value | html %]" selected> </option>
220 [%- ELSIF ( value.length==0 ) -%]
221 <option value="[% value | html %]"> </option>
223 <option value="[% value | html %]">[% value | html %]</option>
229 <label for="frameworkcode[% loo.row | html %]">Thesaurus:</label>
230 <select name="frameworkcode" id="frameworkcode[% loo.row | html %]">
231 [%- FOREACH value IN loo.frameworkcodes %]
232 [% IF ( value == loo.frameworkcode && value.length>0 ) -%]
233 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
234 [%- ELSIF ( value == loo.frameworkcode ) -%]
235 <option value="[% value | html %]" selected="selected"> </option>
236 [%- ELSIF ( value.length==0 ) -%]
237 <option value="[% value | html %]"> </option>
239 <option value="[% value | html %]">[% value | html %]</option>
245 <label for="value_builder[% loo.row | html %]">Plugin:</label>
246 <select name="value_builder" id="value_builder[% loo.row | html %]">
247 [%- FOREACH value IN loo.value_builders %]
248 [% IF ( value == loo.value_builder && value.length>0 ) -%]
249 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
250 [%- ELSIF ( value == loo.value_builder ) -%]
251 <option value="[% value | html %]" selected="selected"> </option>
252 [%- ELSIF ( value.length==0 ) -%]
253 <option value="[% value | html %]"> </option>
255 <option value="[% value | html %]">[% value | html %]</option>
263 </ol></fieldset><br class="clear" />
270 [% IF ( delete_confirm ) %]
272 <div class="dialog alert">
273 <h3>Delete subfield <span class="ex">'[% ass.tagsubfield | html %]'?</span></h3>
274 <form action="[% delete_link | html %]" method="post">
275 <input type="hidden" name="op" value="delete_confirmed" />
277 <tr><th scope="row">Subfield:</th> <td>[% ass.tagsubfield | html %]</td></tr>
278 <tr><th scope="row">Description:</th> <td>[% ass.liblibrarian | html_entity %]</td></tr>
280 <input type="hidden" name="tagfield" value="[% ass.tagfield | html %]" />
281 <input type="hidden" name="tagsubfield" value="[% ass.tagsubfield | html %]" />
282 <input type="hidden" name="authtypecode" value="[% ass.authtypecode | html %]" />
283 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this subfield</button>
286 <form action="[% delete_link | html %]" method="get">
287 <input type="hidden" name="tagfield" value="[% ass.tagfield | html %]" />
288 <input type="hidden" name="tagsubfield" value="[% ass.tagsubfield | html %]" />
289 <input type="hidden" name="authtypecode" value="[% ass.authtypecode | html %]" />
290 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
296 <h1>Authority MARC subfield structure admin for [% tagfield | html %] (authority: [% authtypecode | html %])</h1>
297 <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>
298 <p>The column 'Koha field' shows that the subfield is linked with a Koha field.</p>
300 <table id="table_authsubfieldstructure">
306 <th class="NoSort"> </th>
310 [% FOREACH loo IN loop %]
313 <a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?op=add_form&tagfield=[% tagfield | uri %]&authtypecode=[% authtypecode | uri %]#sub[% loo.tagsubfield | uri %]field">[% loo.tagsubfield | html %]</a>
316 [% IF loo.tab == -1 %]
317 <em>[% loo.liblibrarian | html_entity %]</em>
319 [% loo.liblibrarian | html_entity %]
323 [% IF loo.subfield_ignored == -1 %]
324 <em>subfield ignored</em>
326 <strong>Tab:</strong>[% loo.tab | html %],
327 [% IF ( loo.kohafield ) %] | <strong>Koha field:</strong> [% loo.kohafield | html %], [% END %]
328 [% IF ( loo.repeatable ) %]Repeatable, [% ELSE %]Not repeatable,
330 [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,
332 [% IF ( loo.hidden ) %]hidden,
334 [% IF ( loo.isurl ) %]is a url,
336 [% IF ( loo.authorised_value ) %] | <strong>Auth value:</strong>[% loo.authorised_value | html %],
338 [% IF ( loo.frameworkcode ) %] | <strong>Authority:</strong>[% loo.frameworkcode | html %],
340 [% IF ( loo.value_builder ) %] | <strong>Plugin:</strong>[% loo.value_builder | html %],[% END %]
344 <a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?op=add_form&tagfield=[% tagfield | uri %]&authtypecode=[% authtypecode | uri %]#sub[% loo.tagsubfield | uri %]field" class="btn btn-default btn-xs"><i class="fa fa-pencil" aria-hidden="true"></i> Edit</a>
345 <a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?op=delete_confirm&tagfield=[% loo.tagfield | uri %]&tagsubfield=[% loo.tagsubfield | uri %]&authtypecode=[% authtypecode | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a>
352 <form action="[% script_name | html %]" method="get">
353 <fieldset class="action"><input type="hidden" name="op" value="add_form" />
354 <input type="hidden" name="tagfield" value="[% edit_tagfield | html %]" />
355 <input type="hidden" name="authtypecode" value="[% edit_authtypecode | html %]" />
356 <input type="submit" value="Edit subfields" />
357 <a class="cancel" href="auth_tag_structure.pl?searchfield=[% tagfield | uri %]&authtypecode=[% authtypecode | uri %]">Cancel</a></fieldset>
363 </div> <!-- /.col-sm-10.col-sm-push-2 -->
365 <div class="col-sm-2 col-sm-pull-10">
367 [% INCLUDE 'admin-menu.inc' %]
369 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
370 </div> <!-- /.row -->
372 [% MACRO jsinclude BLOCK %]
373 [% INCLUDE 'datatables.inc' %]
374 [% Asset.js("js/admin-menu.js") | $raw %]
376 $(document).ready(function() {
377 $("#table_authsubfieldstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
379 { 'sortable': false, 'targets': [ 'NoSort' ] }
385 var tabs = $('#subfieldtabs').tabs();
387 tabs.find( ".ui-tabs-nav" ).sortable({
389 start: function (e, ui) {
390 current_index = $(ui.item[0]).index();
392 stop: function (e, ui) {
393 var new_index = $(ui.item[0]).index();
394 if (current_index < new_index) new_index++;
395 var subfield_code = $(ui.item[0]).attr('id').replace( /^tab_subfield_/, '');
396 var content = $('#sub' + subfield_code + 'field');
397 var panels = $("#subfieldtabs > div");
398 if ( new_index < $(panels).size() ){
399 $(content).insertBefore($("#subfieldtabs > div")[new_index]);
401 $(content).insertAfter($("#subfieldtabs > div")[new_index-1]);
403 tabs.tabs("refresh");
410 [% INCLUDE 'intranet-bottom.inc' %]