Bug 31986: Add page-section to various administration pages
[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 [% WRAPPER 'header.inc' %]
20     [% INCLUDE 'prefs-admin-search.inc' %]
21 [% END %]
22
23 [% WRAPPER 'sub-header.inc' %]
24 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
25     <ol>
26         <li>
27             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
28         </li>
29         <li>
30             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
31         </li>
32
33         [% IF op == 'add_form' %]
34             <li>
35                 <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a>
36             </li>
37             <li>
38                 <a href="#" aria-current="page">
39                     [% IF authority_type.authtypecode.defined %]
40                         <span>Modify authority type</span>
41                     [% ELSE %]
42                         <span>New authority type</span>
43                     [% END %]
44                 </a>
45             </li>
46
47         [% ELSIF op == 'delete_confirm' %]
48             <li>
49                 <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a>
50             </li>
51             <li>
52                 <a href="#" aria-current="page">
53                     Confirm deletion of authority type
54                 </a>
55             </li>
56
57         [% ELSE %]
58             <li>
59                 <a href="#" aria-current="page">Authority types</a>
60             </li>
61         [% END %]
62     </ol>
63 </nav>
64 [% END %]
65
66 <div class="main container-fluid">
67     <div class="row">
68         <div class="col-sm-10 col-sm-push-2">
69             <main>
70
71 [% FOR m IN messages %]
72     <div class="dialog [% m.type | html %]">
73         [% SWITCH m.code %]
74         [% CASE 'error_on_update' %]
75             <span>An error occurred when updating this authority type. Perhaps it already exists.</span>
76         [% CASE 'error_on_insert' %]
77             <span>An error occurred when adding this authority type. The authority type code might already exist.</span>
78         [% CASE 'error_on_delete' %]
79             <span>An error occurred when deleting this authority type. Check the logs.</span>
80         [% CASE 'success_on_update' %]
81             <span>Authority type updated successfully.</span>
82         [% CASE 'success_on_insert' %]
83             <span>Authority type added successfully.</span>
84         [% CASE 'success_on_delete' %]
85             <span>Authority type deleted successfully.</span>
86         [% CASE %]
87             [% m.code | html %]
88         [% END %]
89     </div>
90 [% END %]
91
92
93
94 [% IF op == 'add_form' %]
95     <form action="/cgi-bin/koha/admin/authtypes.pl" name="Aform" method="post" class="validated">
96         <fieldset class="rows">
97             <legend>
98                 <h1>
99                 [% IF authority_type.authtypecode.defined %]
100                     Modify authority type
101                 [% ELSE %]
102                     New authority type
103                 [% END %]
104                 </h1>
105             </legend>
106             <ol>
107                 <li>
108                     [% IF authority_type.authtypecode.defined %]
109                             <span class="label">Authority type</span>
110                             <input type="hidden" name="op" value="add_validate" />
111                             <input type="hidden" name="checked" value="0" />
112                             <input type="hidden" name="authtypecode" value="[% authority_type.authtypecode | html %]" />[% authority_type.authtypecode | html %]
113                     [% ELSE %]
114                             <div class="hint">10 characters maximum</div>
115                             <label for="authtypecode" class="required">Authority type: </label>
116                             <input id="authtypecode" type="text" class="required focus" required="required" name="authtypecode" size="20" maxlength="10" />
117                             <span class="required">Required</span>
118                     [% END %]
119                 </li>
120                 <li>
121                     <label for="authtypetext" class="required">Description: </label>
122                     <input type="text" id="authtypetext" name="authtypetext" size="40" maxlength="80" value="[% authority_type.authtypetext | html %]" class="required" required="required" />
123                     <span class="required">Required</span>
124                 </li>
125                 <li>
126                     <label for="summary">Summary: </label>
127                     <textarea id="summary" name="summary" cols="55" rows="7">[% authority_type.summary | html %]</textarea>
128                 </li>
129                 <li>
130                     <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>
131                     <label for="auth_tag_to_report">Authority field to copy: </label>
132                     <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 %]" />
133                     <input type="hidden" name="op" value="add_validate" />
134                     [% IF authority_type.authtypecode.defined %]
135                         <input type="hidden" name="is_a_modif" value="1" />
136                     [% END %]
137                 </li>
138             </ol>
139         </fieldset>
140         <fieldset class="action">
141             <input type="submit" value="Submit" />
142             <a class="cancel" href="/cgi-bin/koha/admin/authtypes.pl">Cancel</a>
143         </fieldset>
144     </form>
145 [% END %]
146
147 [% IF op == 'delete_confirm' %]
148     <div class="dialog alert">
149         [% IF authorities_using_it %]
150             <h1>This authority type cannot be deleted</h1>
151             <p>This record is used <strong>[% authorities_using_it | html %]</strong> times</p>
152             <a class="cancel" href="/cgi-bin/koha/admin/authtypes.pl">Back to the list</a>
153         [% ELSE %]
154             <h1>Confirm deletion of authority structure definition for <span class="ex">'[% authority_type.authtypetext | html %]' ([% authority_type.authtypecode | html %])</span></h1>
155             <form action="/cgi-bin/koha/admin/authtypes.pl" method="post">
156                 <input type="hidden" name="op" value="delete_confirmed" />
157                 <input type="hidden" name="authtypecode" value="[% authority_type.authtypecode | html %]" />
158                 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
159             </form>
160             <form action="/cgi-bin/koha/admin/authtypes.pl" method="get">
161                 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
162             </form>
163         [% END %]
164     </div>
165 [% END %]
166
167 [% IF op == 'list' %]
168     <div id="toolbar" class="btn-toolbar">
169         <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>
170     </div>
171
172     <h1>Authority types</h1>
173     <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>
174
175     <div class="page-section">
176         <table id="authtypes">
177             <thead>
178             <tr>
179                 <th>Code</th>
180                 <th>Description</th>
181                 <th>Summary</th>
182                 <th>Auth field copied</th>
183                 <th>&nbsp;</th>
184             </tr>
185             </thead>
186             <tbody>
187             [% FOREACH authority_type IN authority_types %]
188                 <tr>
189                     <td>[% authority_type.authtypecode | html %]</td>
190                     <td>[% authority_type.authtypetext | html %]</td>
191                     <td>[% authority_type.summary | html %]</td>
192                     <td>[% authority_type.auth_tag_to_report | html %]</td>
193                     <td>
194                     <div class="btn-group dropup">
195                         <a class="btn btn-default btn-xs dropdown-toggle" id="authtypeactions[% authority_type.authtypecode | html %]" role="button" data-toggle="dropdown" href="#">
196                         Actions <b class="caret"></b></a>
197                         <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="authtypeactions[% authority_type.authtypecode | html %]">
198                         <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>
199                         <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>
200                         [% 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 %]
201                         <!-- Button to trigger modal -->
202                         <li><a href="#" data-toggle="modal" data-target="#exportModal_[% authority_type.authtypecode | html %][% loop.count | html %]" title="Export authority type (fields, subfields) to a spreadsheet file (.csv, .ods)"><i class="fa fa-upload"></i> Export</a></li>
203                         <!-- Button to trigger modal -->
204                         <li><a href="#" data-toggle="modal" data-target="#importModal_[% authority_type.authtypecode | html %][% loop.count | html %]" title="Import authority type (fields, subfields) from a spreadsheet file (.csv, .ods)"><i class="fa fa-download"></i> Import</a></li>
205                         </ul>
206                     </div>
207
208                     <!-- Modal for export -->
209                     <div class="modal" id="exportModal_[% authority_type.authtypecode | html %][% loop.count | html %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% authority_type.authtypecode | html %][% loop.count | html %]" aria-hidden="true">
210                         <div class="modal-dialog">
211                             <div class="modal-content">
212                                 <div class="modal-header">
213                                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
214                                     <h3 id="exportLabelexportModal_[% authority_type.authtypecode | html %][% loop.count | html %]">Export [% authority_type.authtypetext | html %] authority type</h3>
215                                 </div>
216                                 <form action="/cgi-bin/koha/admin/import_export_authtype.pl" name="form_[% authority_type.authtypecode | html %]" method="get" target="_blank" class="form_export">
217                                     <div class="modal-body">
218                                         <fieldset>
219                                             <input type="hidden" name="authtypecode" value="[% authority_type.authtypecode | html %]" />
220                                             <p><label for="csv_type_export_[% authority_type.authtypecode | html %][% loop.count | html %]"><input type="radio" name="type_export_[% authority_type.authtypecode | html %]" value="csv" id="csv_type_export_[% authority_type.authtypecode | html %][% loop.count | html %]" checked="checked" /> Export to CSV spreadsheet</label></p>
221                                             <p><label for="ods_type_export_[% authority_type.authtypecode | html %][% loop.count | html %]"><input type="radio" name="type_export_[% authority_type.authtypecode | html %]" value="ods" id="ods_type_export_[% authority_type.authtypecode | html %][% loop.count | html %]" /> Export to OpenDocument spreadsheet format</label></p>
222                                         </fieldset>
223                                     </div>
224                                     <div class="modal-footer">
225                                         <button type="submit" class="btn btn-default">Export</button>
226                                         <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
227                                     </div>
228                                 </form>
229                             </div>
230                         </div>
231                     </div>
232
233                     <!-- Modal for import -->
234                     <div class="modal" id="importModal_[% authority_type.authtypecode | html %][% loop.count | html %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% authority_type.authtypecode | html %][% loop.count | html %]" aria-hidden="true">
235                         <div class="modal-dialog">
236                             <div class="modal-content">
237                                 <div class="modal-header">
238                                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
239                                     <h3 id="importLabelexportModal_[% authority_type.authtypecode | html %][% loop.count | html %]">Import [% authority_type.authtypecode | html %] authority type (fields and subfields) from a spreadsheet file (.csv, .ods)</h3>
240                                 </div>
241                                 <form action="/cgi-bin/koha/admin/import_export_authtype.pl" name="form_i_[% authority_type.authtypecode | html %]" id="form_i_[% authority_type.authtypecode | html %]" method="post" enctype="multipart/form-data" class="form_import">
242                                     <div class="modal-body">
243                                         <input type="hidden" name="authtypecode" value="[% authority_type.authtypecode | html %]" />
244                                         <input type="hidden" name="action" value="import" />
245                                         <p><label for="file_import_[% authority_type.authtypecode | html %]">Upload file:</label> <input type="file" name="file_import_[% authority_type.authtypecode | html %]" id="file_import_[% authority_type.authtypecode | html %]" class="input_import" /></p>
246                                         <div id="importing_[% authority_type.authtypecode | html %]" style="display:none" class="importing"><img src="[% interface | html %]/[% theme | html %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
247                                     </div>
248                                     <div class="modal-footer">
249                                         <button type="submit" class="btn btn-default">Import</button>
250                                         <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Close</button>
251                                     </div>
252                                 </form>
253                             </div>
254                         </div>
255                     </div>
256
257                     </td>
258                 </tr>
259             [% END %]
260             <tbody>
261         </table>
262     </div> <!-- /.page-section -->
263 [% END %]
264
265             </main>
266         </div> <!-- /.col-sm-10.col-sm-push-2 -->
267
268         <div class="col-sm-2 col-sm-pull-10">
269             <aside>
270                 [% INCLUDE 'admin-menu.inc' %]
271             </aside>
272         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
273      </div> <!-- /.row -->
274
275 [% MACRO jsinclude BLOCK %]
276     [% INCLUDE 'datatables.inc' %]
277     [% Asset.js("js/admin-menu.js") | $raw %]
278     [% Asset.js("js/authtype.js") | $raw %]
279 [% END %]
280 [% INCLUDE 'intranet-bottom.inc' %]