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