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