Bug 22023: Further improve responsive layout handling of staff client menu bar
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / authtypes.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Administration &rsaquo; Authority types
6 [% IF op == 'add_form' %]
7 &rsaquo; [% IF authority_type.authtypecode.defined %]Modify authority type[% ELSE %]New authority type[% END %]
8 [% ELSIF op == 'delete_confirm' %]
9 &rsaquo; Confirm deletion of authority type
10 [% END %]
11 </title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 </head>
14
15 <body id="admin_authtypes" class="admin">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'prefs-admin-search.inc' %]
18
19 <div id="breadcrumbs">
20          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21 &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
22 &rsaquo; <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a>
23 [% IF op == 'add_form' %]
24 &rsaquo; [% IF authority_type.authtypecode.defined %]Modify[% ELSE %]New[% END %] Authority type
25 [% ELSIF op == 'delete_confirm' %]
26 &rsaquo; Confirm deletion of authority type
27 [% END %]
28 </div>
29
30 <div class="main container-fluid">
31     <div class="row">
32         <div class="col-sm-10 col-sm-push-2">
33             <main>
34
35 [% FOR m IN messages %]
36     <div class="dialog [% m.type | html %]">
37         [% SWITCH m.code %]
38         [% CASE 'error_on_update' %]
39             An error occurred when updating this authority type. Perhaps it already exists.
40         [% CASE 'error_on_insert' %]
41             An error occurred when adding this authority type. The authority type code might already exist.
42         [% CASE 'error_on_delete' %]
43             An error occurred when deleting this authority type. Check the logs.
44         [% CASE 'success_on_update' %]
45             Authority type updated successfully.
46         [% CASE 'success_on_insert' %]
47             Authority type added successfully.
48         [% CASE 'success_on_delete' %]
49             Authority type deleted successfully.
50         [% CASE %]
51             [% m.code | html %]
52         [% END %]
53     </div>
54 [% END %]
55
56
57
58 [% IF op == 'add_form' %]
59     <form action="/cgi-bin/koha/admin/authtypes.pl" name="Aform" method="post" class="validated">
60         <fieldset class="rows">
61             <legend>
62                 [% IF authority_type.authtypecode.defined %]
63                     Modify authority type
64                 [% ELSE %]
65                     New authority type
66                 [% END %]
67             </legend>
68             <ol>
69                 <li>
70                     [% IF authority_type.authtypecode.defined %]
71                             <span class="label">Authority type</span>
72                             <input type="hidden" name="op" value="add_validate" />
73                             <input type="hidden" name="checked" value="0" />
74                             <input type="hidden" name="authtypecode" value="[% authority_type.authtypecode | html %]" />[% authority_type.authtypecode | html %]
75                     [% ELSE %]
76                             <label for="authtypecode" class="required">Authority type: </label>
77                             <input id="authtypecode" type="text" class="required" required="required" name="authtypecode" size="10" maxlength="10" />
78                             <span class="required">Required</span>
79                     [% END %]
80                 </li>
81                 <li>
82                     <label for="authtypetext" class="required">Description: </label>
83                     <input type="text" id="authtypetext" name="authtypetext" size="40" maxlength="80" value="[% authority_type.authtypetext | html %]" class="required" required="required" />
84                     <span class="required">Required</span>
85                 </li>
86                 <li>
87                     <label for="summary">Summary: </label>
88                     <textarea id="summary" name="summary" cols="55" rows="7">[% authority_type.summary | html %]</textarea>
89                 </li>
90                 <li>
91                     <p class="tip">Note: for 'Authority field to copy', enter the authority field that should be copied from the authority record to the bibliographic record. E.g., in MARC21, field 100 in the authority record should be copied to field 100 in the bibliographic record</p>
92                     <label for="auth_tag_to_report">Authority field to copy: </label>
93                     <input type="text" id="auth_tag_to_report" name="auth_tag_to_report" size="5" maxlength="3" value="[% authority_type.auth_tag_to_report | html %]" />
94                     <input type="hidden" name="op" value="add_validate" />
95                     [% IF authority_type.authtypecode.defined %]
96                         <input type="hidden" name="is_a_modif" value="1" />
97                     [% END %]
98                 </li>
99             </ol>
100         </fieldset>
101         <fieldset class="action">
102             <input type="submit" value="Submit" />
103             <a class="cancel" href="/cgi-bin/koha/admin/authtypes.pl">Cancel</a>
104         </fieldset>
105     </form>
106 [% END %]
107
108 [% IF op == 'delete_confirm' %]
109     <div class="dialog alert">
110         [% IF authorities_using_it %]
111             <h3>This authority type cannot be deleted</h3>
112             <p>This record is used <strong>[% authorities_using_it | html %]</strong> times</p>
113             <a class="cancel" href="/cgi-bin/koha/admin/authtypes.pl">Back to the list</a>
114         [% ELSE %]
115             <h3>Confirm deletion of authority structure definition for <span class="ex">'[% authority_type.authtypetext | html %]' ([% authority_type.authtypecode | html %])</span></h3>
116             <form action="/cgi-bin/koha/admin/authtypes.pl" method="post">
117                 <input type="hidden" name="op" value="delete_confirmed" />
118                 <input type="hidden" name="authtypecode" value="[% authority_type.authtypecode | html %]" />
119                 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
120             </form>
121             <form action="/cgi-bin/koha/admin/authtypes.pl" method="get">
122                 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
123             </form>
124         [% END %]
125     </div>
126 [% END %]
127
128 [% IF op == 'list' %]
129     <div id="toolbar" class="btn-toolbar">
130         <a id="authtype" class="btn btn-default" href="/cgi-bin/koha/admin/authtypes.pl?op=add_form"><i class="fa fa-plus"></i> New authority type</a>
131     </div>
132
133     <h1>Authority types</h1>
134     <p>Define authority types, then authority MARC structure in the same way you define itemtypes and bibliographic MARC tag structure. Authority values are managed through plugins</p>
135     <table id="authtypes">
136         <thead>
137         <tr>
138             <th>Code</th>
139             <th>Description</th>
140             <th>Summary</th>
141             <th>Auth field copied</th>
142             <th>&nbsp;</th>
143         </tr>
144         </thead>
145         <tbody>
146         [% FOREACH authority_type IN authority_types %]
147             <tr>
148                 <td>[% authority_type.authtypecode | html %]</td>
149                 <td>[% authority_type.authtypetext | html %]</td>
150                 <td>[% authority_type.summary | html %]</td>
151                 <td>[% authority_type.auth_tag_to_report | html %]</td>
152                 <td>
153                   <div class="dropdown">
154                     <a class="btn btn-default btn-xs dropdown-toggle" id="authtypeactions[% authority_type.authtypecode | html %]" role="button" data-toggle="dropdown" href="#">
155                       Actions <b class="caret"></b></a>
156                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="authtypeactions[% authority_type.authtypecode | html %]">
157                       <li><a href="auth_tag_structure.pl?authtypecode=[% authority_type.authtypecode | uri %]" class="button parameters"><i class="fa fa-eye"></i> MARC structure</a></li>
158                       <li><a href="/cgi-bin/koha/admin/authtypes.pl?op=add_form&amp;authtypecode=[% authority_type.authtypecode | uri %]"><i class="fa fa-pencil"></i> Edit</a></li>
159                       [% IF authority_type.authtypecode %]<li><a href="/cgi-bin/koha/admin/authtypes.pl?op=delete_confirm&amp;authtypecode=[% authority_type.authtypecode | uri %]"><i class="fa fa-trash"></i> Delete</a></li>[% END %]
160                     </ul>
161                   </div>
162                 </td>
163             </tr>
164         [% END %]
165         <tbody>
166     </table>
167 [% END %]
168
169             </main>
170         </div> <!-- /.col-sm-10.col-sm-push-2 -->
171
172         <div class="col-sm-2 col-sm-pull-10">
173             <aside>
174                 [% INCLUDE 'admin-menu.inc' %]
175             </aside>
176         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
177      </div> <!-- /.row -->
178
179 [% MACRO jsinclude BLOCK %]
180     [% INCLUDE 'datatables.inc' %]
181     [% Asset.js("js/admin-menu.js") | $raw %]
182     <script>
183         $(document).ready(function() {
184             $("#authtypes").dataTable($.extend(true, {}, dataTablesDefaults, {
185                 "aoColumnDefs": [
186                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
187                 ],
188                 "sPaginationType": "four_button"
189             }));
190             $("#authtypecode").on("blur",function(){
191                 toUC(this);
192             });
193         });
194     </script>
195 [% END %]
196 [% INCLUDE 'intranet-bottom.inc' %]