4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Administration › Authority MARC subfield structure</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' %]
12 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> ›
13 <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a> ›
14 [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | uri%]">[% authtypecode | html %] framework</a> ›
15 [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a> ›
17 [% IF ( else ) %]Authority MARC subfield structure for [% tagfield | html %]
18 [% ELSE %]<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> ›
20 [% IF ( delete_confirm ) %]Confirm deletion of subfield [% tagsubfield | html %]?[% END %]
22 [% IF ( use_heading_flags_p ) %]
23 [% IF ( heading_edit_subfields_p ) %]Edit MARC subfields constraints[% END %]
24 [% ELSE %][% action | html %][% END %]
28 <div class="main container-fluid">
30 <div class="col-sm-10 col-sm-push-2">
35 <h1>[% IF ( use_heading_flags_p ) %]
36 [% IF ( heading_edit_subfields_p ) %]Edit MARC subfields constraints for field [% tagfield | html %] authority [% authtypecode | html %][% END %]
37 [% ELSE %][% action | html %][% END %]</h1>
38 <form action="[% script_name | html %]" name="Aform" method="post">
39 <input type="hidden" name="op" value="add_validate" />
40 <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
41 <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
42 <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>
43 <div id="subfieldtabs" class="toptabs numbered">
45 [% FOREACH loo IN loop %]
46 <li id="tab_subfield_[% loo.tagsubfield | html %]">
47 [% IF ( loo.new_subfield ) %]
48 <a href="#sub[% loo.tagsubfield | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">New</a>
50 <a href="#sub[% loo.tagsubfield | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">[% loo.tagsubfield | html %]</a>
56 [% FOREACH loo IN loop %]
57 <div id="sub[% loo.tagsubfield | html %]field">
58 <fieldset class="rows"><ol>
60 [% IF ( loo.new_subfield ) %]
62 <label for="tagsubfieldinput[% loo.row | html %]">Subfield code: </label>
63 <input type="text" name="tagsubfield" value="[% loo.tagsubfield | html %]" size="1" id="tagsubfield" maxlength="1" />
67 <input type="hidden" name="tagsubfield" value="[% loo.tagsubfield | html %]" />
71 <label for="repeatable[% loo.row | html %]">Repeatable: </label>
72 [% IF loo.repeatable %]
73 <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
75 <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
79 <label for="mandatory[% loo.row | html %]">Mandatory: </label>
80 [% IF loo.mandatory %]
81 <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
83 <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
86 <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>
87 <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>
88 <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
89 <select name="tab" size="1" id="tab[% loo.row | html %]">
90 [%- IF ( loo.tab == -1 ) -%]
91 <option value="-1" selected="selected">ignore</option>
93 <option value="-1">ignore</option>
95 [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%]
96 [%- IF ( loo.tab == t && t.length>0 ) -%]
97 <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
98 [%- ELSIF ( loo.tab == t ) -%]
99 <option value="[%- t | html -%]" selected="selected"> </option>
101 <option value="[%- t | html -%]">[%- t | html -%]</option>
105 (ignore means that the subfield does not display in the record editor)
109 <legend>Display</legend>
111 <li><label for="ohidden[% loo.row | html %]">Select to display or not:</label>
112 <select name="ohidden" size="1" id="ohidden[% loo.row | html %]">
113 [%- IF ( loo.hidden == 0 ) -%]
114 <option value= "0" selected="selected">Show all</option>
115 <option value="1">Hide all</option>
117 [%# All other non-zero values mean: Hide %]
118 <option value= "0">Show all</option>
119 <option value="1" selected="selected">Hide all</option>
127 <fieldset class="rows">
128 <legend>Advanced constraints:</legend>
131 <label for="isurl[% loo.row | html %]">Is a URL:</label>
133 <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
135 <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
137 (if checked, it means that the subfield is a URL and can be clicked)
140 <label for="defaultvalue[% loo.row | html %]">Default value:</label>
141 <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
147 <fieldset><legend>Help input</legend>
150 <label for="kohafield[% loo.row | html %]">Koha field:</label>
151 <select name="kohafield" id="kohafield[% loo.row | html %]" size="1">
152 [%- FOREACH value IN loo.kohafields %]
153 [% IF ( value == loo.kohafield && value.length>0 ) -%]
154 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
155 [%- ELSIF ( value == loo.kohafield ) -%]
156 <option value="[% value | html %]" selected="selected"> </option>
157 [%- ELSIF ( value.length==0 ) -%]
158 <option value="[% value | html %]"> </option>
160 <option value="[% value | html %]">[% value | html %]</option>
166 <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
167 <select name="authorised_value" id="authorised_value[% loo.row | html %]" size="1">
168 [%- FOREACH value IN loo.authorised_values %]
169 [% IF ( value == loo.authorised_value && value.length>0 ) -%]
170 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
171 [%- ELSIF ( value == loo.authorised_value ) -%]
172 <option value="[% value | html %]" selected> </option>
173 [%- ELSIF ( value.length==0 ) -%]
174 <option value="[% value | html %]"> </option>
176 <option value="[% value | html %]">[% value | html %]</option>
182 <label for="frameworkcode[% loo.row | html %]">Thesaurus:</label>
183 <select name="frameworkcode" id="frameworkcode[% loo.row | html %]" size="1">
184 [%- FOREACH value IN loo.frameworkcodes %]
185 [% IF ( value == loo.frameworkcode && value.length>0 ) -%]
186 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
187 [%- ELSIF ( value == loo.frameworkcode ) -%]
188 <option value="[% value | html %]" selected="selected"> </option>
189 [%- ELSIF ( value.length==0 ) -%]
190 <option value="[% value | html %]"> </option>
192 <option value="[% value | html %]">[% value | html %]</option>
198 <label for="value_builder[% loo.row | html %]">Plugin:</label>
199 <select name="value_builder" id="value_builder[% loo.row | html %]" size="1">
200 [%- FOREACH value IN loo.value_builders %]
201 [% IF ( value == loo.value_builder && value.length>0 ) -%]
202 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
203 [%- ELSIF ( value == loo.value_builder ) -%]
204 <option value="[% value | html %]" selected="selected"> </option>
205 [%- ELSIF ( value.length==0 ) -%]
206 <option value="[% value | html %]"> </option>
208 <option value="[% value | html %]">[% value | html %]</option>
216 </ol></fieldset><br class="clear" />
223 [% IF ( delete_confirm ) %]
225 <div class="dialog alert">
226 <h3>Delete subfield <span class="ex">'[% ass.tagsubfield | html %]'?</span></h3>
227 <form action="[% delete_link | html %]" method="post">
228 <input type="hidden" name="op" value="delete_confirmed" />
230 <tr><th scope="row">Subfield:</th> <td>[% ass.tagsubfield | html %]</td></tr>
231 <tr><th scope="row">Description:</th> <td>[% ass.liblibrarian | html_entity %]</td></tr>
233 <input type="hidden" name="tagfield" value="[% ass.tagfield | html %]" />
234 <input type="hidden" name="tagsubfield" value="[% ass.tagsubfield | html %]" />
235 <input type="hidden" name="authtypecode" value="[% ass.authtypecode | html %]" />
236 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this subfield</button>
239 <form action="[% delete_link | html %]" method="get">
240 <input type="hidden" name="tagfield" value="[% ass.tagfield | html %]" />
241 <input type="hidden" name="tagsubfield" value="[% ass.tagsubfield | html %]" />
242 <input type="hidden" name="authtypecode" value="[% ass.authtypecode | html %]" />
243 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
249 <h1>Authority MARC subfield structure admin for [% tagfield | html %] (authority: [% authtypecode | html %])</h1>
250 <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>
251 <p>The column 'Koha field' shows that the subfield is linked with a Koha field.</p>
253 <table id="table_authsubfieldstructure">
259 <th class="NoSort"> </th>
263 [% FOREACH loo IN loop %]
266 <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>
269 [% IF loo.tab == -1 %]
270 <em>[% loo.liblibrarian | html_entity %]</em>
272 [% loo.liblibrarian | html_entity %]
276 [% IF loo.subfield_ignored == -1 %]
277 <em>subfield ignored</em>
279 <strong>Tab:</strong>[% loo.tab | html %],
280 [% IF ( loo.kohafield ) %] | <strong>Koha field:</strong> [% loo.kohafield | html %], [% END %]
281 [% IF ( loo.repeatable ) %]Repeatable, [% ELSE %]Not repeatable,
283 [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,
285 [% IF ( loo.hidden ) %]hidden,
287 [% IF ( loo.isurl ) %]is a url,
289 [% IF ( loo.authorised_value ) %] | <strong>Auth value:</strong>[% loo.authorised_value | html %],
291 [% IF ( loo.frameworkcode ) %] | <strong>Authority:</strong>[% loo.frameworkcode | html %],
293 [% IF ( loo.value_builder ) %] | <strong>Plugin:</strong>[% loo.value_builder | html %],[% END %]
297 <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>
298 <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>
305 <form action="[% script_name | html %]" method="get">
306 <fieldset class="action"><input type="hidden" name="op" value="add_form" />
307 <input type="hidden" name="tagfield" value="[% edit_tagfield | html %]" />
308 <input type="hidden" name="authtypecode" value="[% edit_authtypecode | html %]" />
309 <input type="submit" value="Edit subfields" />
310 <a class="cancel" href="auth_tag_structure.pl?searchfield=[% tagfield | uri %]&authtypecode=[% authtypecode | uri %]">Cancel</a></fieldset>
316 </div> <!-- /.col-sm-10.col-sm-push-2 -->
318 <div class="col-sm-2 col-sm-pull-10">
320 [% INCLUDE 'admin-menu.inc' %]
322 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
323 </div> <!-- /.row -->
325 [% MACRO jsinclude BLOCK %]
326 [% INCLUDE 'datatables.inc' %]
327 [% Asset.js("js/admin-menu.js") | $raw %]
329 $(document).ready(function() {
330 $("#table_authsubfieldstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
332 { 'sortable': false, 'targets': [ 'NoSort' ] }
338 var tabs = $('#subfieldtabs').tabs();
340 tabs.find( ".ui-tabs-nav" ).sortable({
342 start: function (e, ui) {
343 current_index = $(ui.item[0]).index();
345 stop: function (e, ui) {
346 var new_index = $(ui.item[0]).index();
347 if (current_index < new_index) new_index++;
348 var subfield_code = $(ui.item[0]).attr('id').replace( /^tab_subfield_/, '');
349 var content = $('#sub' + subfield_code + 'field');
350 var panels = $("#subfieldtabs > div");
351 if ( new_index < $(panels).size() ){
352 $(content).insertBefore($("#subfieldtabs > div")[new_index]);
354 $(content).insertAfter($("#subfieldtabs > div")[new_index-1]);
356 tabs.tabs("refresh");
363 [% INCLUDE 'intranet-bottom.inc' %]