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