Bug 30808: Add a dedications tab to the about page
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / marctagstructure.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE AuthorisedValues %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>
7 [% IF ( add_form ) %]
8     [% IF heading_add_tag_p %]
9         Add tag [% searchfield | html %]
10     [% ELSE %]
11         Modify tag [% searchfield | html %]
12     [% END %] &rsaquo; [% END %]
13
14 [% IF ( delete_confirm ) %]
15     Confirm deletion of tag '[% searchfield | html %]' &rsaquo; [% END %]
16
17 [% IF ( delete_confirmed ) %]
18     Data deleted &rsaquo; [% END %]
19 MARC frameworks &rsaquo; Administration &rsaquo; Koha
20 </title>
21 [% INCLUDE 'doc-head-close.inc' %]
22 </head>
23
24 <body id="admin_marctagstructure" class="admin">
25 [% WRAPPER 'header.inc' %]
26     [% INCLUDE 'prefs-admin-search.inc' %]
27 [% END %]
28
29 [% WRAPPER 'sub-header.inc' %]
30 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
31     <ol>
32         <li>
33             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
34         </li>
35         <li>
36             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
37         </li>
38         <li>
39             <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
40         </li>
41
42         [% IF ( add_form ) %]
43             <li>
44                 <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% framework.frameworkcode | uri %]">
45                     [% IF framework %]
46                         <span>[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</span>
47                     [% ELSE %]
48                         <span>Default MARC framework</span>
49                     [% END%]
50                 </a>
51             </li>
52             <li>
53                 <a href="#" aria-current="page">
54                     [% IF heading_add_tag_p %]
55                         <span>Add tag [% searchfield | html %]</span>
56                     [% ELSE %]
57                         <span>Modify tag [% searchfield | html %]</span>
58                     [% END %]
59                 </a>
60             </li>
61
62         [% ELSIF ( else ) %]
63             <li>
64                 <a href="#" aria-current="page">
65                     [% IF framework %]
66                         <span>[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</span>
67                     [% ELSE %]
68                         <span>Default MARC framework</span>
69                     [% END %]
70                 </a>
71             </li>
72
73         [% ELSIF ( delete_confirm ) %]
74             <li>
75                 <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% framework.frameworkcode | uri %]">
76                     [% IF framework %]
77                         <span>[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</span>
78                     [% ELSE %]
79                         <span>Default MARC framework</span>
80                     [% END %]
81                 </a>
82             </li>
83             <li>
84                 <a href="#" aria-current="page">
85                     Confirm deletion of tag [% searchfield | html %]
86                 </a>
87             </li>
88
89         [% ELSIF ( delete_confirmed ) %]
90             <li>
91                 <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% framework.frameworkcode | uri %]">
92                     [% IF framework %]
93                         <span>[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</span>
94                     [% ELSE %]
95                         <span>Default MARC framework</span>
96                     [% END %]
97                 </a>
98             </li>
99             <li>
100                 <a href="#" aria-current="page">
101                     Data deleted
102                 </a>
103             </li>
104         [% END %]
105     </ol>
106 </nav>
107 [% END %]
108
109 <div class="main container-fluid">
110     <div class="row">
111         <div class="col-sm-10 col-sm-push-2">
112             <main>
113
114 [% IF ( else ) %]
115 <div id="toolbar" class="btn-toolbar">
116     <a class="btn btn-default" id="addtag" href="/cgi-bin/koha/admin/marctagstructure.pl?op=add_form&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-plus"></i> New tag</a>
117 </div>[% END %]
118
119 [% IF framework %]
120     <h1>MARC Framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</h1>
121 [% ELSE %]
122     <h1>MARC Framework for default MARC framework</h1>
123 [% END %]
124
125 [% IF ( add_form ) %]
126
127     <form action="[% script_name | html %]" name="Aform" method="post" class="validated">
128
129       <fieldset class="rows">
130             <legend>
131                 [% IF heading_add_tag_p %]
132                     <span>Add tag</span>
133                 [% ELSE %]
134                     <span>Modify tag</span> <input type="hidden" name="modif" value="1" />[% searchfield | html %]
135                 [% END %]
136             </legend>
137             <input type="hidden" name="op" value="add_validate" />
138             <input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
139         <ol>
140             <li>
141                 [% IF ( heading_modify_tag_p ) %]
142                     <input type="hidden" name="tagfield" value="[% searchfield | html %]" />
143                     <span class="label">Tag:</span>
144                     [% searchfield | html %]
145                 [% ELSE %]
146                     <label for="tagfield" class="required">Tag: </label>
147                     <input id="tagfield" type="text" name="tagfield" value="[% searchfield | html %]" maxlength="3" size="3" required="required" class="required" />
148                     <span class="required">Required</span>
149                 [% END %]
150             </li>
151     <li><label for="liblibrarian">Label for lib: </label><input type="text" id="liblibrarian" name="liblibrarian" value="[% liblibrarian | html %]" size="40" maxlength="100" /></li>
152     <li><label for="libopac">Label for opac: </label><input type="text" id="libopac" name="libopac" value="[% libopac | html %]" size="40" maxlength="100" /></li>
153     <li><label for="repeatable">Repeatable: </label>
154         [% IF ( repeatable ) %]
155             <input type="checkbox" name="repeatable" id="repeatable" value="1" checked="checked" />
156         [% ELSE %]
157             <input type="checkbox" name="repeatable" id="repeatable" value="1" />
158         [% END %]
159     </li>
160     <li><label for="mandatory">Mandatory: </label>
161         [% IF ( mandatory ) %]
162             <input type="checkbox" name="mandatory" id="mandatory" value="1" checked="checked" />
163         [% ELSE %]
164             <input type="checkbox" name="mandatory" id="mandatory" value="1" />
165         [% END %]
166     </li>
167     <li><label for="important">Important: </label>
168         [% IF ( important ) %]
169             <input type="checkbox" name="important" id="important" value="1" checked="checked" />
170         [% ELSE %]
171             <input type="checkbox" name="important" id="important" value="1" />
172         [% END %]
173     </li>
174     <li><label for="ind1_defaultvalue">First indicator default value: </label>
175         <input id="ind1_defaultvalue" type="text" name="ind1_defaultvalue" value="[% ind1_defaultvalue | html %]" maxlength="1" size="1" />
176     </li>
177     <li><label for="ind2_defaultvalue">Second indicator default value: </label>
178         <input id="ind2_defaultvalue" type="text" name="ind2_defaultvalue" value="[% ind2_defaultvalue | html %]" maxlength="1" size="1" />
179     </li>
180     <li><label for="authorised_value">Authorized value: </label>
181         <select name="authorised_value" id="authorised_value">
182             <option value=""></option>
183             [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value ) %]
184         </select>
185         (if you select a value here, the indicators will be limited to the authorized value list)</li>
186 </ol></fieldset> 
187     <fieldset class="action">
188         <input type="submit" class="btn btn-primary" value="Save changes" />
189         <a class="cancel" href="[% script_name | url %]?frameworkcode=[% framework.frameworkcode | uri %]">Cancel</a>
190     </fieldset>
191     </form>
192 [% END %]
193
194
195 [% IF ( delete_confirm ) %]
196     <div class="dialog alert">
197         <h3>Confirm deletion of tag <span class="ex">'[% searchfield | html %]'</span>?</h3>
198         <p>Tag: [% searchfield | html %]</p>
199         <p>Description: [% liblibrarian | html %]</p>
200         <form action="[% script_name | html %]" method="post">
201             <input type="hidden" name="op" value="delete_confirmed" />
202             <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
203             <input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
204             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this tag</button>
205         </form>
206         <form action="[% script_name | html %]" method="get"><input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
207             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
208         </form>
209     </div>
210 [% END %]
211
212 [% IF ( delete_confirmed ) %]
213
214     <div class="dialog message"><h3>Tag deleted</h3>
215     <form action="[% script_name | html %]" method="post"><input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
216         <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
217     </form></div>
218 [% END %]
219 [% IF ( framework_create ) %]
220
221     <form action="[% script_name | html %]" method="post">
222         <input type="hidden" name="op" value="framework_create_confirm" />
223         <input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
224         Create framework for [% framework.frameworkcode | html %] ([% framework.frameworktext | html %]) using
225         <select name="existingframeworkcode">
226             <option value="">Default</option>
227         [% FOREACH fw IN existing_frameworks%]
228             <option value="[% fw.frameworkcode | html %]">[% fw.frameworktext | html %]</option>
229         [% END %]
230         </select>
231         <input type="submit" class="btn btn-primary" value="OK" />
232     </form>
233 [% END %]
234
235
236 [% IF ( else ) %]
237 <form name="f" action="[% script_name | html %]" method="post">
238 <fieldset style="padding:.5em;">
239         <label for="tag_search"><strong>Search for tag:</strong> </label>
240         <input type="text" name="searchfield" id="tag_search" size="4" value="[% searchfield | html %]" />
241
242 <label for="frameworkcode"><strong>In framework:</strong> </label>
243         <select id="frameworkcode" name="frameworkcode">
244             <option value="">Default</option>
245             [% FOREACH f IN frameworks %]
246             [% IF f.frameworkcode == framework.frameworkcode %]
247                 <option value="[% f.frameworkcode | html %]" selected="selected">[% f.frameworktext | html %]</option>
248                 [% ELSE %]
249                 <option value="[% f.frameworkcode | html %]">[% f.frameworktext | html %]</option>
250                 [% END %]
251             [% END %]
252         </select>
253     <input type="submit" class="btn btn-primary" value="Search" />
254 <p>        <label for="select_display">Display only used tags/subfields</label>
255         [% IF ( select_display ) %]
256             <input type="checkbox" name="select_display" id="select_display" value="True" checked="checked" />
257         [% ELSE %]
258             <input type="checkbox" name="select_display" id="select_display" value="True" />
259         [% END %]</p>
260 </fieldset>
261 </form>
262
263 <div class="page-section">
264     <table id="table_marctagstructure">
265     <thead>
266         <tr>
267         <th>Tag</th>
268         <th>Lib</th>
269         <th>Repeatable</th>
270         <th>Mandatory</th>
271         <th>Important</th>
272         <th>Auth value</th>
273         <th>Indicator 1</th>
274         <th>Indicator 2</th>
275         <th>&nbsp;</th>
276         </tr>
277     </thead>
278     <tbody>
279     [% FOREACH loo IN loop %]
280         <tr>
281             <td>[% loo.tagfield | html %]</td>
282             <td>
283                 [% loo.liblibrarian | html %]
284             [% IF ( select_display ) %]
285                 [% FOREACH subfield IN loo.subfields %]
286                     <p>
287                         <span>Tab:[% subfield.tab | html %]</span> | $[% subfield.tagsubfield | html %]
288                         [% subfield.liblibrarian | html %] [% IF ( subfield.kohafield ) %][% subfield.kohafield | html %][% END %][% IF ( subfield.repeatable ) %], <span>repeatable</span>[% END %][% IF ( subfield.mandatory ) %], <span>Mandatory</span>[% END %][% IF ( subfield.seealso ) %], <span>See [% subfield.seealso | html %]</span>[% END %][% IF ( subfield.authorised_value ) %], [% subfield.authorised_value | html %][% END %][% IF ( subfield.authtypecode ) %], [% subfield.authtypecode | html %][% END %][% IF ( subfield.value_builder ) %], [% subfield.value_builder | html %][% END %]
289                     </p>
290                 [% END %]
291             [% END %]
292             </td>
293             <td>[% IF ( loo.repeatable ) %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %]</td>
294             <td>[% IF ( loo.mandatory ) %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %]</td>
295             <td>[% IF ( loo.important ) %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %]</td>
296             <td>[% loo.authorised_value | html %]</td>
297             <td>[% loo.ind1_defaultvalue | html %]</td>
298             <td>[% loo.ind2_defaultvalue | html %]</td>
299             <td>
300                 <div class="btn-group dropup">
301                     <a class="btn btn-default btn-xs dropdown-toggle" id="marctagactions[% loo.tagfield | html %]" role="button" data-toggle="dropdown" href="#">
302                         Actions <b class="caret"></b></a>
303                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="marctagactions[% loo.tagfield | html %]">
304                         <li><a href="?op=add_form&amp;searchfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-pencil"></i> Edit tag</a></li>
305                         <li><a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-eye"></i> View subfields</a></li>
306                         <li><a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-pencil"></i> Edit subfields</a></li>
307                         <li><a href="?op=delete_confirm&amp;searchfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-trash"></i> Delete</a></li>
308                     </ul>
309                 </div>
310             </td>
311         </tr>
312     [% END %]
313     </tbody>
314     </table>
315     </div> <!-- /.page-section -->
316 [% END %]
317
318             </main>
319         </div> <!-- /.col-sm-10.col-sm-push-2 -->
320
321         <div class="col-sm-2 col-sm-pull-10">
322             <aside>
323                 [% INCLUDE 'admin-menu.inc' %]
324             </aside>
325         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
326      </div> <!-- /.row -->
327
328 [% MACRO jsinclude BLOCK %]
329     [% INCLUDE 'datatables.inc' %]
330     [% Asset.js("js/admin-menu.js") | $raw %]
331     <script>
332         $(document).ready(function() {
333             $("#table_marctagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
334                 "aoColumnDefs": [
335                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
336                 ],
337                 "sPaginationType": "full"
338             }));
339             $("#select_display").on("change",function(){
340                 var checked = $(this).prop("checked") ? 1: 0;
341                 Cookies.set("marctagstructure_selectdisplay", checked, { sameSite: 'Lax' });
342                 this.form.submit();
343             });
344         });
345     </script>
346 [% END %]
347 [% INCLUDE 'intranet-bottom.inc' %]