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