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