Bug 27936: Clarify AllowItemsOnHoldCheckoutSIP syspref help text
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / auth_subfields_structure.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Administration &rsaquo; Authority MARC subfield structure</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
8
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> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;
13   <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a> &rsaquo;
14   [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | uri%]">[% authtypecode | html %] framework</a> &rsaquo;
15   [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a> &rsaquo;
16   [% END %]
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 %]&amp;tagsubfield=[% tagsubfield | uri %]&amp;authtypecode=[% authtypecode |uri %]">Authority MARC subfield structure for [% tagfield | html %]</a> &rsaquo;
19   [% END %]
20   [% IF ( delete_confirm ) %]Confirm deletion of subfield [% tagsubfield | html %]?[% END %]
21   [% IF ( add_form ) %]
22   [% IF ( use_heading_flags_p ) %]
23   [% IF ( heading_edit_subfields_p ) %]Edit MARC subfields constraints[% END %]
24   [% ELSE %][% action | html %][% END %]
25   [% END %]
26 </div>
27
28 <div class="main container-fluid">
29     <div class="row">
30         <div class="col-sm-10 col-sm-push-2">
31             <main>
32
33 [% IF ( add_form ) %]
34
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 %]&amp;authtypecode=[% authtypecode | uri %]">Cancel</a></fieldset>
43         <div id="subfieldtabs" class="toptabs numbered">
44             <ul>
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>
49                         [% ELSE %]
50                             <a href="#sub[% loo.tagsubfield | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">[% loo.tagsubfield | html %]</a>
51                         [% END %]
52                     </li>
53                 [% END %]
54             </ul>
55
56         [% FOREACH loo IN loop %]
57         <div id="sub[% loo.tagsubfield | html %]field">
58             <fieldset class="rows"><ol>
59
60                 [% IF ( loo.new_subfield ) %]
61                     <li>
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" />
64                     </li>
65                 [% ELSE %]
66                     <li>
67                         <input type="hidden" name="tagsubfield" value="[% loo.tagsubfield | html %]" />
68                     </li>
69                 [% END %]
70                 <li>
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" />
74                     [% ELSE %]
75                         <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
76                     [% END %]
77                 </li>
78                 <li>
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" />
82                     [% ELSE %]
83                         <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
84                     [% END %]
85                 </li>
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>
92                         [%- ELSE -%]
93                         <option value="-1">ignore</option>
94                         [%- END -%]
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">&nbsp;</option>
100                         [%- ELSE -%]
101                         <option value="[%- t | html -%]">[%- t | html -%]</option>
102                         [%- END -%]
103                     [%- END -%]
104                     </select>
105                     (ignore means that the subfield does not display in the record editor)
106                 </li>
107                 <li>
108                     <fieldset>
109                         <legend>Display</legend>
110                         <ol>
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>
116                                     [%- ELSE -%]
117                                     [%# All other non-zero values mean: Hide %]
118                                     <option value= "0">Show all</option>
119                                     <option value="1" selected="selected">Hide all</option>
120                                     [%- END -%]
121                                 </select>
122                             </li>
123                         </ol>
124                     </fieldset>
125                 </li>
126                 <li>
127                     <fieldset class="rows">
128                         <legend>Advanced constraints:</legend>
129                         <ol>
130                             <li>
131                                 <label for="isurl[% loo.row | html %]">Is a URL:</label>
132                                 [% IF loo.isurl %]
133                                     <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
134                                 [% ELSE %]
135                                     <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
136                                 [% END %]
137                                 (if checked, it means that the subfield is a URL and can be clicked)
138                             </li>
139                             <li>
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 %]" />
142                             </li>
143                         </ol>
144                     </fieldset>
145                 </li>
146                 <li>
147                     <fieldset><legend>Help input</legend>    
148                         <ol>
149                             <li>
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">&nbsp;</option>
157                                     [%- ELSIF ( value.length==0 ) -%]
158                                     <option value="[% value | html %]">&nbsp;</option>
159                                     [%- ELSE -%]
160                                     <option value="[% value | html %]">[% value | html %]</option>
161                                     [%- END -%]
162                                 [%- END %]
163                                 </select>
164                             </li>
165                             <li>
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>&nbsp;</option>
173                                     [%- ELSIF ( value.length==0 ) -%]
174                                     <option value="[% value | html %]">&nbsp;</option>
175                                     [%- ELSE -%]
176                                     <option value="[% value | html %]">[% value | html %]</option>
177                                     [%- END -%]
178                                 [%- END %]
179                                 </select>
180                             </li>
181                             <li>
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">&nbsp;</option>
189                                     [%- ELSIF ( value.length==0 ) -%]
190                                     <option value="[% value | html %]">&nbsp;</option>
191                                     [%- ELSE -%]
192                                     <option value="[% value | html %]">[% value | html %]</option>
193                                     [%- END -%]
194                                 [%- END %]
195                                 </select>
196                             </li>
197                             <li>
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">&nbsp;</option>
205                                     [%- ELSIF ( value.length==0 ) -%]
206                                     <option value="[% value | html %]">&nbsp;</option>
207                                     [%- ELSE -%]
208                                     <option value="[% value | html %]">[% value | html %]</option>
209                                     [%- END -%]
210                                 [%- END %]
211                                 </select>
212                             </li>
213                         </ol>
214                     </fieldset>
215                 </li>
216             </ol></fieldset><br class="clear" />
217         </div>
218         [% END %]
219         </div>
220     </form>
221 [% END %]
222
223 [% IF ( delete_confirm ) %]
224
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" />
229             <table>
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>
232             </table>
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>
237         </form>
238
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>
244         </form>
245     </form></div>
246 [% END %]
247
248 [% IF ( else ) %]
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>
252
253 <table id="table_authsubfieldstructure">
254     <thead>
255         <tr>
256             <th>Subfield</th>
257             <th>Text</th>
258             <th>Constraints</th>
259             <th class="NoSort">&nbsp;</th>
260         </tr>
261     </thead>
262     <tbody>
263     [% FOREACH loo IN loop %]
264     <tr>
265         <td>
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>
267         </td>
268         <td>
269             [% IF loo.tab == -1 %]
270                     <em>[% loo.liblibrarian | html_entity %]</em>
271             [% ELSE %]
272                     [% loo.liblibrarian | html_entity %]
273             [% END %]
274         </td>
275         <td>
276             [% IF loo.subfield_ignored == -1 %]
277                     <em>subfield ignored</em>
278             [% ELSE %]
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,
282                 [% END %]
283                         [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,
284                 [% END %]
285                         [% IF ( loo.hidden ) %]hidden,
286                 [% END %]
287                         [% IF ( loo.isurl ) %]is a url,
288                 [% END %]
289                         [% IF ( loo.authorised_value ) %] | <strong>Auth value:</strong>[% loo.authorised_value | html %],
290                 [% END %]
291                         [% IF ( loo.frameworkcode ) %] | <strong>Authority:</strong>[% loo.frameworkcode | html %],
292                 [% END %]
293                 [% IF ( loo.value_builder ) %] | <strong>Plugin:</strong>[% loo.value_builder | html %],[% END %]
294             [% END %]
295         </td>
296         <td class="actions">
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&amp;tagfield=[% loo.tagfield | uri %]&amp;tagsubfield=[% loo.tagsubfield | uri %]&amp;authtypecode=[% authtypecode | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a>
299         </td>
300     </tr>
301     [% END %]
302     </tbody>
303 </table>
304
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 %]&amp;authtypecode=[% authtypecode | uri %]">Cancel</a></fieldset>
311     </form>
312
313 [% END %]
314
315             </main>
316         </div> <!-- /.col-sm-10.col-sm-push-2 -->
317
318         <div class="col-sm-2 col-sm-pull-10">
319             <aside>
320                 [% INCLUDE 'admin-menu.inc' %]
321             </aside>
322         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
323      </div> <!-- /.row -->
324
325 [% MACRO jsinclude BLOCK %]
326     [% INCLUDE 'datatables.inc' %]
327     [% Asset.js("js/admin-menu.js") | $raw %]
328     <script>
329         $(document).ready(function() {
330             $("#table_authsubfieldstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
331                 "columnDefs": [
332                     { 'sortable': false, 'targets': [ 'NoSort' ] }
333                 ],
334                 aaSorting: [],
335                 paginate: false
336             }));
337
338             var tabs = $('#subfieldtabs').tabs();
339             var current_index;
340             tabs.find( ".ui-tabs-nav" ).sortable({
341                 axis: "x",
342                 start: function (e, ui) {
343                     current_index = $(ui.item[0]).index();
344                 },
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]);
353                     } else {
354                         $(content).insertAfter($("#subfieldtabs > div")[new_index-1]);
355                     }
356                     tabs.tabs("refresh");
357                 }
358             });
359
360         });
361     </script>
362 [% END %]
363 [% INCLUDE 'intranet-bottom.inc' %]