Bug 34913: DataTables upgrade: Update CSS and option names
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / auth_tag_structure.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE AuthorisedValues %]
4 [% PROCESS 'i18n.inc' %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>[% FILTER collapse %]
8     [% IF ( add_form ) %]
9         [% IF ( heading_modify_tag_p ) %]
10             [% tx("Modify tag '{searchfield}'", { searchfield = searchfield }) | html %] &rsaquo;
11         [% END %]
12         [% IF ( heading_add_tag_p ) %]
13             [% t("New tag") | html %] &rsaquo;
14         [% END %]
15     [% END %]
16     [% IF ( delete_confirm ) %]
17         [% tx("Confirm deletion of tag '{searchfield}'", { searchfield = searchfield }) | html %] &rsaquo;
18     [% END %]
19     [% IF ( delete_confirmed ) %]
20         [% t("Data deleted") | html %] &rsaquo;
21     [% END %]
22     [% IF ( authtypecode ) %]
23         [% tx("'{authtypecode}' framework", { authtypecode = authtypecode }) | html %]
24     [% ELSE %]
25         [% t("Default framework") | html %]
26     [% END %] &rsaquo;
27     [% t("Authority types") | html %] &rsaquo;
28     [% t("Administration") | html %] &rsaquo;
29     [% t("Koha") | html %]
30 [% END %]</title>
31 [% INCLUDE 'doc-head-close.inc' %]
32
33 </head>
34
35 <body id="admin_auth_tag_structure" class="admin">
36 [% WRAPPER 'header.inc' %]
37     [% INCLUDE 'prefs-admin-search.inc' %]
38 [% END %]
39
40 [% WRAPPER 'sub-header.inc' %]
41     [% WRAPPER breadcrumbs %]
42         [% WRAPPER breadcrumb_item %]
43             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
44         [% END %]
45         [% WRAPPER breadcrumb_item %]
46             <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a>
47         [% END %]
48
49         [% IF ( add_form || delete_confirm || delete_confirmed ) %]
50             [% IF ( authtypecode ) %]
51                 [% WRAPPER breadcrumb_item %]
52                     <a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | uri %]">[% tx("'{authtypecode}' framework", { authtypecode = authtypecode }) | html %]</a>
53                 [% END %]
54             [% ELSE %]
55                 [% WRAPPER breadcrumb_item %]
56                     <a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
57                 [% END %]
58             [% END %]
59         [% END %]
60
61         [% IF ( add_form ) %]
62             [% IF ( use_heading_flags_p ) %]
63                 [% IF ( heading_modify_tag_p ) %]
64                     [% WRAPPER breadcrumb_item bc_active= 1 %]
65                         [% tx("Modify tag {searchfield}", { searchfield = searchfield }) | html %]
66                     [% END %]
67                 [% END %]
68
69                 [% IF ( heading_add_tag_p ) %]
70                     [% WRAPPER breadcrumb_item bc_active= 1 %]
71                         <span>New tag</span>
72                     [% END %]
73                 [% END %]
74
75             [% ELSE %]
76                 [% WRAPPER breadcrumb_item bc_active= 1 %]
77                     [% action | html %]
78                 [% END %]
79             [% END %]
80
81         [% ELSE %]
82             [% IF ( delete_confirm ) %]
83                 [% WRAPPER breadcrumb_item bc_active= 1 %]
84                     [% tx("Confirm deletion of tag '{searchfield}'", { searchfield = searchfield }) | html %]
85                 [% END %]
86             [% ELSE %]
87                 [% IF ( delete_confirmed ) %]
88                     [% WRAPPER breadcrumb_item bc_active= 1 %]
89                         <span>Data deleted</span>
90                     [% END %]
91                 [% ELSE %]
92                     [% IF ( authtypecode ) %]
93                         [% WRAPPER breadcrumb_item bc_active= 1 %]
94                             [% tx("{authtypecode} framework", { authtypecode = authtypecode }) | html %]
95                         [% END %]
96                     [% ELSE %]
97                         [% WRAPPER breadcrumb_item bc_active= 1 %]
98                             <span>Default framework</span>
99                         [% END %]
100                     [% END %]
101                 [% END %]
102
103             [% END %]
104         [% END %]
105     [% END #/ WRAPPER breadcrumbs %]
106 [% END #/ WRAPPER sub-header.inc %]
107
108 <div class="main container-fluid">
109     <div class="row">
110         <div class="col-sm-10 col-sm-push-2">
111             <main>
112
113                 [% IF ( else ) %]
114                     <div id="toolbar" class="btn-toolbar">
115                         <div class="btn-group"><a class="btn btn-default" id="newtag" href="/cgi-bin/koha/admin/auth_tag_structure.pl?op=add_form&amp;authtypecode=[% authtypecode | uri %]"><i class="fa fa-plus"></i> New tag</a></div>
116                         <a class="btn btn-default" id="edit_authtype" href="/cgi-bin/koha/admin/authtypes.pl?op=add_form&authtypecode=[% authtypecode | uri %]"><i class="fa fa-pencil"></i> Edit authority type</a>
117                     </div>
118                 [% END %]
119
120 <h1>
121     [% IF ( authtypecode ) %]
122         [% tx("Authority MARC framework for '{authtypecode}'", { authtypecode = authtypecode }) | html %]
123     [% ELSE %]
124         [% t("Default authority MARC framework") | html %]
125     [% END %]
126 </h1>
127
128
129 [% IF ( add_form ) %]
130
131     <h2>
132         [% IF ( heading_modify_tag_p ) %]
133             [% tx("Modify tag '{searchfield}'", { searchfield = searchfield }) | html %]
134         [% END %]
135         [% IF ( heading_add_tag_p ) %]
136             <span>New tag</span>
137         [% END %]
138     </h2>
139     <form action="[% script_name | html %]" name="Aform" method="post" class="validated">
140         <input type="hidden" name="op" value="add_validate" />
141         [% IF ( heading_modify_tag_p ) %]<input type="hidden" name="modif" value="1" />[% END %]
142         <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
143         <fieldset class="rows">
144             <ol>
145                 [% IF ( heading_modify_tag_p ) %]
146                     <li>
147                         <span class="label">Tag: </span>
148                         <input type="hidden" name="tagfield" value="[% searchfield | html %]" />
149                         [% searchfield | html %]
150                     </li>
151                 [% ELSE %]
152                     <li>
153                         <label for="tagfield" class="required">Tag: </label><input type="text" id="tagfield" name="tagfield" size="5" maxlength="3" required="required" class="required" />
154                         <span class="required">Required</span>
155                     </li>
156                 [% END %]
157
158         <li><label for="liblibrarian">Description in staff interface: </label><input type="text" name="liblibrarian" id="liblibrarian" value="[% liblibrarian | html %]" size="40" maxlength="100" /></li>
159         <li><label for="libopac">Description in OPAC: </label><input type="text" name="libopac" id="libopac" value="[% libopac | html %]" size="40" maxlength="100" /></li>
160         <li><label for="repeatable">Repeatable: </label>
161             [% IF ( repeatable ) %]
162                 <input type="checkbox" name="repeatable" id="repeatable" value="1" checked="checked" />
163             [% ELSE %]
164                 <input type="checkbox" name="repeatable" id="repeatable" value="1" />
165             [% END %]
166         </li>
167         <li><label for="mandatory">Mandatory: </label>
168             [% IF ( mandatory ) %]
169                 <input type="checkbox" name="mandatory" id="mandatory" value="1" checked="checked" />
170             [% ELSE %]
171                 <input type="checkbox" name="mandatory" id="mandatory" value="1" />
172             [% END %]
173         </li>
174         <li><label for="authorised_value">Authorized value: </label>
175             <select name="authorised_value" id="authorised_value">
176                 <option value=""></option>
177                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value ) %]
178             </select>
179             <div class="hint">If you select a value here, the indicators will be limited to the authorized value list</div>
180         </li>
181         </ol>
182         </fieldset>
183         <fieldset class="action">
184             <input type="submit" class="btn btn-primary" value="Submit" />
185             <a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | uri %]" class="cancel">Cancel</a>
186         </fieldset>
187     </form>
188 [% END %]
189
190
191 [% IF ( delete_confirm ) %]
192     <div class="dialog alert">
193         <h3>[% tx("Confirm deletion of tag '{searchfield}'", { searchfield = searchfield }) | html %]</h3>
194         <form action="[% script_name | html %]" method="post">
195             <table>
196                 <tr><th scope="row">Tag: </th><td>[% searchfield | html %] [% liblibrarian | html %]</td></tr>
197             </table>
198             <input type="hidden" name="op" value="delete_confirmed" />
199             <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
200             <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
201             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
202         </form>
203         <form action="[% script_name | html %]" method="get">
204             <button type="submit" class="deny"><i class="fa fa-fw fa-times"></i> No, do not delete</button>
205         </form>
206     </div>
207 [% END %]
208
209 [% IF ( delete_confirmed ) %]
210
211   <div class="dialog message">  <h3>Data deleted</h3>
212     <form action="[% script_name | html %]" method="post">
213     <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
214     <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
215     <input type="submit" value="OK" class="btn btn-primary" />
216     </form></div>
217 [% END %]
218 [% IF ( authtype_create ) %]
219
220     <form action="[% script_name | html %]" method="post">
221         <input type="hidden" name="op" value="authtype_create_confirm" />
222         <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
223         Create authority framework for [% authtypecode | html %] using
224         <select name="existingauthtypecode">
225         [% FOREACH existingauthtypeloo IN existingauthtypeloop %]
226             [% IF existingauthtypeloo.value == "" %]
227               <option value="" selected="selected">[% existingauthtypeloo.authtypetext | html %]</option>
228             [% ELSE %]
229               <option value="[% existingauthtypeloo.value | html %]">[% existingauthtypeloo.authtypetext | html %]</option>
230             [% END %]
231         [% END %]
232         </select>
233         <input type="submit" value="OK" class="btn btn-primary" />
234     </form>
235 [% END %]
236
237
238 [% IF ( else ) %]
239
240 <form action="[% script_name | html %]" method="post">
241     <fieldset>
242         <label for="searchfield"><strong>Search for tag:</strong></label>
243         <input type="text" id="searchfield" name="searchfield" size="4" value="[% searchfield | html %]" />
244         <label for="authtypecode"><strong>In framework:</strong> </label>
245         <select id="authtypecode" name="authtypecode">
246             [% FOREACH authority_type IN authority_types%]
247                 [% IF authority_type.authtypecode == authtypecode%]
248                     <option value="[% authority_type.authtypecode | html %]" selected="selected">[% authority_type.authtypetext | html %]</option>
249                 [% ELSE %]
250                     <option value="[% authority_type.authtypecode | html %]">[% authority_type.authtypetext | html %]</option>
251                 [% END %]
252             [% END %]
253         </select>
254         <input type="submit" class="btn btn-primary" value="Search" />
255     </fieldset>
256 </form>
257
258 <div id="pagertable_authtagstructure">
259 </div>
260
261 <div class="page-section">
262 <table id="table_authtagstructure">
263     <thead>
264         <tr>
265             <th>Tag</th>
266             <th>Tag description</th>
267             <th>Repeatable</th>
268             <th>Mandatory</th>
269             <th>Authorized<br />value</th>
270             <th>&nbsp;</th>
271         </tr>
272     </thead>
273     <tbody>
274         [% FOREACH loo IN loop %]
275         <tr>
276             <td><strong>[% loo.tagfield | html %]</strong></td>
277             <td>[% loo.liblibrarian | html %]</td>
278             <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
279             <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
280             <td>[% loo.authorised_value | html %]</td>
281             <td>
282                 <div class="btn-group dropup">
283                     <a class="btn btn-default btn-xs dropdown-toggle" id="authtagactions[% loo.tagfield | html %]" role="button" data-toggle="dropdown" href="#">
284                         Actions <b class="caret"></b></a>
285                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="authtagactions[% loo.tagfield | html %]">
286                         <li><a href="auth_subfields_structure.pl?tagfield=[% loo.tagfield | uri %]&amp;authtypecode=[% authtypecode | uri %]"><i class="fa-solid fa-eye"></i> Subfields</a></li>
287                         <li><a href="?op=add_form&amp;searchfield=[% loo.tagfield | uri %]&amp;authtypecode=[% authtypecode | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a></li>
288                         <li><a href="?op=delete_confirm&amp;searchfield=[% loo.tagfield | uri %]&amp;authtypecode=[% authtypecode | uri %]"><i class="fa fa-trash-can"></i> Delete</a></li>
289                     </ul>
290                 </div>
291             </td>
292         </tr>
293         [% END %]
294     </tbody>
295     </table>
296 </div> <!-- /.page-section -->
297 [% END %]
298
299             </main>
300         </div> <!-- /.col-sm-10.col-sm-push-2 -->
301
302         <div class="col-sm-2 col-sm-pull-10">
303             <aside>
304                 [% INCLUDE 'admin-menu.inc' %]
305             </aside>
306         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
307      </div> <!-- /.row -->
308
309 [% MACRO jsinclude BLOCK %]
310     [% INCLUDE 'datatables.inc' %]
311     [% Asset.js("js/admin-menu.js") | $raw %]
312     <script>
313         $(document).ready(function() {
314             $("#table_authtagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
315                 "columnDefs": [
316                     { "targets": [ -1 ], "orderable": false, "searchable":  false },
317                 ],
318                 "pagingType": "full"
319             }));
320         });
321     </script>
322 [% END %]
323 [% INCLUDE 'intranet-bottom.inc' %]