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