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