Bug 27846: (follow-up) Indentation corrections
[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 <nav aria-label="Breadcrumb" class="breadcrumb">
20     <ol>
21         <li>
22             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
23         </li>
24         <li>
25             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
26         </li>
27
28         [% IF op == 'add_form' %]
29             <li>
30                 <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a>
31             </li>
32             <li>
33                 <a href="#" aria-current="page">
34                     [% IF authority_type.authtypecode.defined %]
35                         Modify
36                     [% ELSE %]
37                         New
38                     [% END %] Authority type
39                 </a>
40             </li>
41
42         [% ELSIF op == 'delete_confirm' %]
43             <li>
44                 <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a>
45             </li>
46             <li>
47                 <a href="#" aria-current="page">
48                     Confirm deletion of authority type
49                 </a>
50             </li>
51
52         [% ELSE %]
53             <li>
54                 <a href="#" aria-current="page">Authority types</a>
55             </li>
56         [% END %]
57     </ol>
58 </nav>
59
60 <div class="main container-fluid">
61     <div class="row">
62         <div class="col-sm-10 col-sm-push-2">
63             <main>
64
65 [% FOR m IN messages %]
66     <div class="dialog [% m.type | html %]">
67         [% SWITCH m.code %]
68         [% CASE 'error_on_update' %]
69             An error occurred when updating this authority type. Perhaps it already exists.
70         [% CASE 'error_on_insert' %]
71             An error occurred when adding this authority type. The authority type code might already exist.
72         [% CASE 'error_on_delete' %]
73             An error occurred when deleting this authority type. Check the logs.
74         [% CASE 'success_on_update' %]
75             Authority type updated successfully.
76         [% CASE 'success_on_insert' %]
77             Authority type added successfully.
78         [% CASE 'success_on_delete' %]
79             Authority type deleted successfully.
80         [% CASE %]
81             [% m.code | html %]
82         [% END %]
83     </div>
84 [% END %]
85
86
87
88 [% IF op == 'add_form' %]
89     <form action="/cgi-bin/koha/admin/authtypes.pl" name="Aform" method="post" class="validated">
90         <fieldset class="rows">
91             <legend>
92                 [% IF authority_type.authtypecode.defined %]
93                     Modify authority type
94                 [% ELSE %]
95                     New authority type
96                 [% END %]
97             </legend>
98             <ol>
99                 <li>
100                     [% IF authority_type.authtypecode.defined %]
101                             <span class="label">Authority type</span>
102                             <input type="hidden" name="op" value="add_validate" />
103                             <input type="hidden" name="checked" value="0" />
104                             <input type="hidden" name="authtypecode" value="[% authority_type.authtypecode | html %]" />[% authority_type.authtypecode | html %]
105                     [% ELSE %]
106                             <label for="authtypecode" class="required">Authority type: </label>
107                             <input id="authtypecode" type="text" class="required" required="required" name="authtypecode" size="10" maxlength="10" />
108                             <span class="required">Required</span>
109                     [% END %]
110                 </li>
111                 <li>
112                     <label for="authtypetext" class="required">Description: </label>
113                     <input type="text" id="authtypetext" name="authtypetext" size="40" maxlength="80" value="[% authority_type.authtypetext | html %]" class="required" required="required" />
114                     <span class="required">Required</span>
115                 </li>
116                 <li>
117                     <label for="summary">Summary: </label>
118                     <textarea id="summary" name="summary" cols="55" rows="7">[% authority_type.summary | html %]</textarea>
119                 </li>
120                 <li>
121                     <div class="hint">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</div>
122                     <label for="auth_tag_to_report">Authority field to copy: </label>
123                     <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 %]" />
124                     <input type="hidden" name="op" value="add_validate" />
125                     [% IF authority_type.authtypecode.defined %]
126                         <input type="hidden" name="is_a_modif" value="1" />
127                     [% END %]
128                 </li>
129             </ol>
130         </fieldset>
131         <fieldset class="action">
132             <input type="submit" value="Submit" />
133             <a class="cancel" href="/cgi-bin/koha/admin/authtypes.pl">Cancel</a>
134         </fieldset>
135     </form>
136 [% END %]
137
138 [% IF op == 'delete_confirm' %]
139     <div class="dialog alert">
140         [% IF authorities_using_it %]
141             <h3>This authority type cannot be deleted</h3>
142             <p>This record is used <strong>[% authorities_using_it | html %]</strong> times</p>
143             <a class="cancel" href="/cgi-bin/koha/admin/authtypes.pl">Back to the list</a>
144         [% ELSE %]
145             <h3>Confirm deletion of authority structure definition for <span class="ex">'[% authority_type.authtypetext | html %]' ([% authority_type.authtypecode | html %])</span></h3>
146             <form action="/cgi-bin/koha/admin/authtypes.pl" method="post">
147                 <input type="hidden" name="op" value="delete_confirmed" />
148                 <input type="hidden" name="authtypecode" value="[% authority_type.authtypecode | html %]" />
149                 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
150             </form>
151             <form action="/cgi-bin/koha/admin/authtypes.pl" method="get">
152                 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
153             </form>
154         [% END %]
155     </div>
156 [% END %]
157
158 [% IF op == 'list' %]
159     <div id="toolbar" class="btn-toolbar">
160         <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>
161     </div>
162
163     <h1>Authority types</h1>
164     <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>
165     <table id="authtypes">
166         <thead>
167         <tr>
168             <th>Code</th>
169             <th>Description</th>
170             <th>Summary</th>
171             <th>Auth field copied</th>
172             <th>&nbsp;</th>
173         </tr>
174         </thead>
175         <tbody>
176         [% FOREACH authority_type IN authority_types %]
177             <tr>
178                 <td>[% authority_type.authtypecode | html %]</td>
179                 <td>[% authority_type.authtypetext | html %]</td>
180                 <td>[% authority_type.summary | html %]</td>
181                 <td>[% authority_type.auth_tag_to_report | html %]</td>
182                 <td>
183                   <div class="btn-group dropup">
184                     <a class="btn btn-default btn-xs dropdown-toggle" id="authtypeactions[% authority_type.authtypecode | html %]" role="button" data-toggle="dropdown" href="#">
185                       Actions <b class="caret"></b></a>
186                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="authtypeactions[% authority_type.authtypecode | html %]">
187                       <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>
188                       <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>
189                       [% 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 %]
190                     </ul>
191                   </div>
192                 </td>
193             </tr>
194         [% END %]
195         <tbody>
196     </table>
197 [% END %]
198
199             </main>
200         </div> <!-- /.col-sm-10.col-sm-push-2 -->
201
202         <div class="col-sm-2 col-sm-pull-10">
203             <aside>
204                 [% INCLUDE 'admin-menu.inc' %]
205             </aside>
206         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
207      </div> <!-- /.row -->
208
209 [% MACRO jsinclude BLOCK %]
210     [% INCLUDE 'datatables.inc' %]
211     [% Asset.js("js/admin-menu.js") | $raw %]
212     <script>
213         $(document).ready(function() {
214             $("#authtypes").dataTable($.extend(true, {}, dataTablesDefaults, {
215                 "aoColumnDefs": [
216                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
217                 ],
218                 "sPaginationType": "full"
219             }));
220             $("#authtypecode").on("blur",function(){
221                 toUC(this);
222             });
223         });
224     </script>
225 [% END %]
226 [% INCLUDE 'intranet-bottom.inc' %]