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