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