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