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