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 %]
21 [% IF ( delete_confirmed ) %]Data deleted[% END %]
23 [% IF ( use_heading_flags_p ) %]
24 [% IF ( heading_edit_subfields_p ) %]Edit MARC subfields constraints[% END %]
25 [% ELSE %][% action | html %][% END %]
29 <div class="main container-fluid">
31 <div class="col-sm-10 col-sm-push-2">
36 <h1>[% IF ( use_heading_flags_p ) %]
37 [% IF ( heading_edit_subfields_p ) %]Edit MARC subfields constraints for field [% tagfield | html %] authority [% authtypecode | html %][% END %]
38 [% ELSE %][% action | html %][% END %]</h1>
39 <form action="[% script_name | html %]" name="Aform" method="post">
40 <input type="hidden" name="op" value="add_validate" />
41 <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
42 <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
43 <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>
44 <div id="subfieldtabs" class="toptabs numbered">
46 [% FOREACH loo IN loop %]
47 <li id="tab_subfield_[% loo.tagsubfield | html %]">
48 [% IF ( loo.new_subfield ) %]
49 <a href="#sub[% loo.tagsubfield | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">New</a>
51 <a href="#sub[% loo.tagsubfield | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">[% loo.tagsubfield | html %]</a>
57 [% FOREACH loo IN loop %]
58 <div id="sub[% loo.tagsubfield | html %]field">
59 <fieldset class="rows"><ol>
61 [% IF ( loo.new_subfield ) %]
63 <label for="tagsubfieldinput[% loo.row | html %]">Subfield code: </label>
64 <input type="text" name="tagsubfield" value="[% loo.tagsubfield | html %]" size="1" id="tagsubfield" maxlength="1" />
68 <input type="hidden" name="tagsubfield" value="[% loo.tagsubfield | html %]" />
72 <label for="repeatable[% loo.row | html %]">Repeatable: </label>
73 [% IF loo.repeatable %]
74 <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
76 <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
80 <label for="mandatory[% loo.row | html %]">Mandatory: </label>
81 [% IF loo.mandatory %]
82 <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
84 <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
87 <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>
88 <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>
89 <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
90 <select name="tab" size="1" id="tab[% loo.row | html %]">
91 [%- IF ( loo.tab == -1 ) -%]
92 <option value="-1" selected="selected">ignore</option>
94 <option value="-1">ignore</option>
96 [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%]
97 [%- IF ( loo.tab == t && t.length>0 ) -%]
98 <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
99 [%- ELSIF ( loo.tab == t ) -%]
100 <option value="[%- t | html -%]" selected="selected"> </option>
102 <option value="[%- t | html -%]">[%- t | html -%]</option>
106 (ignore means that the subfield does not display in the record editor)
110 <legend>Display</legend>
112 <li><label for="ohidden[% loo.row | html %]">Select to display or not:</label>
113 <select name="ohidden" size="1" id="ohidden[% loo.row | html %]">
114 [%- IF ( loo.ohidden == 0 ) -%]
115 <option value= "0" selected="selected">Show all</option>
116 <option value="1">Hide all</option>
118 [%# All other non-zero values mean: Hide %]
119 <option value= "0">Show all</option>
120 <option value="1" selected="selected">Hide all</option>
128 <fieldset class="rows">
129 <legend>Advanced constraints:</legend>
132 <label for="isurl[% loo.row | html %]">Is a URL:</label>
134 <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
136 <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
138 (if checked, it means that the subfield is a URL and can be clicked)
141 <label for="defaultvalue[% loo.row | html %]">Default value:</label>
142 <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
148 <fieldset><legend>Help input</legend>
151 <label for="kohafield[% loo.row | html %]">Koha field:</label>
152 <select name="kohafield" id="kohafield[% loo.row | html %]" size="1">
153 [%- FOREACH value IN loo.kohafields %]
154 [% IF ( value == loo.kohafield && value.length>0 ) -%]
155 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
156 [%- ELSIF ( value == loo.kohafield ) -%]
157 <option value="[% value | html %]" selected="selected"> </option>
158 [%- ELSIF ( value.length==0 ) -%]
159 <option value="[% value | html %]"> </option>
161 <option value="[% value | html %]">[% value | html %]</option>
167 <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
168 <select name="authorised_value" id="authorised_value[% loo.row | html %]" size="1">
169 [%- FOREACH value IN loo.authorised_values %]
170 [% IF ( value == loo.authorised_value && value.length>0 ) -%]
171 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
172 [%- ELSIF ( value == loo.authorised_value ) -%]
173 <option value="[% value | html %]" selected> </option>
174 [%- ELSIF ( value.length==0 ) -%]
175 <option value="[% value | html %]"> </option>
177 <option value="[% value | html %]">[% value | html %]</option>
183 <label for="frameworkcode[% loo.row | html %]">Thesaurus:</label>
184 <select name="frameworkcode" id="frameworkcode[% loo.row | html %]" size="1">
185 [%- FOREACH value IN loo.frameworkcodes %]
186 [% IF ( value == loo.frameworkcode && value.length>0 ) -%]
187 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
188 [%- ELSIF ( value == loo.frameworkcode ) -%]
189 <option value="[% value | html %]" selected="selected"> </option>
190 [%- ELSIF ( value.length==0 ) -%]
191 <option value="[% value | html %]"> </option>
193 <option value="[% value | html %]">[% value | html %]</option>
199 <label for="value_builder[% loo.row | html %]">Plugin:</label>
200 <select name="value_builder" id="value_builder[% loo.row | html %]" size="1">
201 [%- FOREACH value IN loo.value_builders %]
202 [% IF ( value == loo.value_builder && value.length>0 ) -%]
203 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
204 [%- ELSIF ( value == loo.value_builder ) -%]
205 <option value="[% value | html %]" selected="selected"> </option>
206 [%- ELSIF ( value.length==0 ) -%]
207 <option value="[% value | html %]"> </option>
209 <option value="[% value | html %]">[% value | html %]</option>
217 </ol></fieldset><br class="clear" />
224 [% IF ( delete_confirm ) %]
226 <div class="dialog alert">
227 <h3>Delete subfield <span class="ex">'[% tagsubfield | html %]'?</span></h3>
228 <form action="[% delete_link | html %]" method="post">
229 <input type="hidden" name="op" value="delete_confirmed" />
231 <tr><th scope="row">Subfield:</th> <td>[% tagsubfield | html %]</td></tr>
232 <tr><th scope="row">Description:</th> <td>[% liblibrarian | html_entity %]</td></tr>
234 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
235 <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
236 <input type="hidden" name="tagsubfield" value="[% tagsubfield | html %]" />
237 <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
238 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this subfield</button>
241 <form action="[% delete_link | html %]" method="get">
242 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
243 <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
244 <input type="hidden" name="tagsubfield" value="[% tagsubfield | html %]" />
245 <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
246 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
251 [% IF ( delete_confirmed ) %]
253 <div class="dialog message"> <h3>Data deleted</h3>
254 <form action="[% script_name | html %]" method="post">
255 <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
256 <input type="submit" class="approve" value="OK" />
262 <h1>Authority MARC subfield structure admin for [% tagfield | html %] (authority: [% authtypecode | html %])</h1>
263 <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>
264 <p>The column 'Koha field' shows that the subfield is linked with a Koha field.</p>
266 <table id="table_authsubfieldstructure">
272 <th class="NoSort"> </th>
276 [% FOREACH loo IN loop %]
279 <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>
282 [% IF ( loo.subfield_ignored ) %]
283 <em>[% loo.liblibrarian | html_entity %]</em>
285 [% loo.liblibrarian | html_entity %]
289 [% IF ( loo.subfield_ignored ) %]
290 <em>subfield ignored</em>
292 <strong>Tab:</strong>[% loo.tab | html %],
293 [% IF ( loo.kohafield ) %] | <strong>Koha field:</strong> [% loo.kohafield | html %], [% END %]
294 [% IF ( loo.repeatable ) %]Repeatable, [% ELSE %]Not repeatable,
296 [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,
298 [% IF ( loo.hidden ) %]hidden,
300 [% IF ( loo.isurl ) %]is a url,
302 [% IF ( loo.authorised_value ) %] | <strong>Auth value:</strong>[% loo.authorised_value | html %],
304 [% IF ( loo.frameworkcode ) %] | <strong>Authority:</strong>[% loo.frameworkcode | html %],
306 [% IF ( loo.value_builder ) %] | <strong>Plugin:</strong>[% loo.value_builder | html %],[% END %]
310 <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>
311 <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>
318 <form action="[% script_name | html %]" method="get">
319 <fieldset class="action"><input type="hidden" name="op" value="add_form" />
320 <input type="hidden" name="tagfield" value="[% edit_tagfield | html %]" />
321 <input type="hidden" name="authtypecode" value="[% edit_authtypecode | html %]" />
322 <input type="submit" value="Edit subfields" />
323 <a class="cancel" href="auth_tag_structure.pl?searchfield=[% tagfield | uri %]&authtypecode=[% authtypecode | uri %]">Cancel</a></fieldset>
326 [% IF ( previous ) %]
327 <input type="image" src="[% interface | html %]/[% theme | html %]/images/1leftarrow.png" title="previous" alt="previous" />
332 <input type="image" src="[% interface | html %]/[% theme | html %]/images/1rightarrow.png" title="next" alt="next" />
339 </div> <!-- /.col-sm-10.col-sm-push-2 -->
341 <div class="col-sm-2 col-sm-pull-10">
343 [% INCLUDE 'admin-menu.inc' %]
345 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
346 </div> <!-- /.row -->
348 [% MACRO jsinclude BLOCK %]
349 [% INCLUDE 'datatables.inc' %]
350 [% Asset.js("js/admin-menu.js") | $raw %]
352 $(document).ready(function() {
353 $("#table_authsubfieldstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
355 { 'sortable': false, 'targets': [ 'NoSort' ] }
361 var tabs = $('#subfieldtabs').tabs();
363 tabs.find( ".ui-tabs-nav" ).sortable({
365 start: function (e, ui) {
366 current_index = $(ui.item[0]).index();
368 stop: function (e, ui) {
369 var new_index = $(ui.item[0]).index();
370 if (current_index < new_index) new_index++;
371 var subfield_code = $(ui.item[0]).attr('id').replace( /^tab_subfield_/, '');
372 var content = $('#sub' + subfield_code + 'field');
373 var panels = $("#subfieldtabs > div");
374 if ( new_index < $(panels).size() ){
375 $(content).insertBefore($("#subfieldtabs > div")[new_index]);
377 $(content).insertAfter($("#subfieldtabs > div")[new_index-1]);
379 tabs.tabs("refresh");
386 [% INCLUDE 'intranet-bottom.inc' %]