Bug 23753: Add missing humanMsg library to pages using background job JavaScript
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / manage-marc-import.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Tools &rsaquo; Manage staged MARC records
6     [% IF ( import_batch_id ) %]
7         &rsaquo; Batch [% import_batch_id | html %]
8     [% END %]
9 </title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% Asset.css("css/humanmsg.css") | $raw %]
12 <style>
13     #jobpanel,#jobstatus,#jobfailed { display : none; }
14     span.change-status { font-style:italic; color:#666; display:none; }
15 </style>
16 </head>
17
18 <body id="tools_manage-marc-import" class="tools">
19     [% INCLUDE 'header.inc' %]
20     [% INCLUDE 'cat-search.inc' %]
21
22     <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
23         [% IF ( import_batch_id ) %]
24             &rsaquo;
25             <a href="[% script_name | url %]">Manage staged MARC records</a>
26             &rsaquo; Batch [% import_batch_id | html %]
27         [% ELSE %]
28             &rsaquo; Manage staged MARC records
29         [% END %]
30     </div>
31
32     <div class="main container-fluid">
33         <div class="row">
34             <div class="col-sm-10 col-sm-push-2">
35                 <main>
36                     <h1>Manage staged MARC records
37                         [% IF ( import_batch_id ) %]
38                             &rsaquo; Batch [% import_batch_id | html %]
39                         [% END %]
40                     </h1>
41
42                     [% IF ( label_batch_msg ) %]
43                         [% IF ( alert ) %]
44                             <div class="alert">
45                         [% ELSE %]
46                             <div class="dialog message">
47                         [% END %]
48                             <b><p>[% label_batch_msg | html %]</p></b>
49                         </div>
50                     [% END %]
51
52                     [% IF ( did_clean ) %]
53                         <div class="dialog message">Cleaned import batch #[% import_batch_id | html %]</div>
54                     [% END %]
55
56                     [% IF ( did_delete ) %]
57                         <div class="dialog message">Import batch deleted successfully</div>
58                     [% END %]
59
60                     [% UNLESS ( batch_list ) %]
61                         [% UNLESS ( batch_info ) %]
62                             <div class="dialog message">
63                                 <p>No records have been staged.</p>
64                                 <p><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.</p>
65                             </div>
66                         [% END %]
67                     [% END %]
68
69                     [% IF ( batch_info ) %]
70                         [% IF ( can_commit ) %]
71                             <form action="[% script_name | html %]" method="post">
72                                 <input type="hidden" name="op" value="redo-matching" />
73                                 <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
74                                 <input type="hidden" name="current_matcher_id" value="[% current_matcher_id | html %]" />
75                         [% END %]
76
77                         [% IF ( rematch_attempted ) %]
78                             [% IF ( rematch_failed ) %]
79                                 <div class="dialog alert">Failed to apply different matching rule</div>
80                             [% ELSE %]
81                                 <div class="dialog message">Applied different matching rule. Number of records matched now
82                                     [% num_with_matches | html %]
83                                 </div>
84                             [% END %]
85                         [% END %]
86
87                         [% IF ( changed_overlay_action ) %]
88                             <div class="dialog message">Changed action if matching record found</div>
89                         [% END %]
90
91                         [% IF ( changed_nomatch_action ) %]
92                             <div class="dialog message">Changed action if no match found</div>
93                         [% END %]
94
95                         [% IF ( changed_item_action ) %]
96                             <div class="dialog message">Changed item processing option</div>
97                         [% END %]
98
99                         <fieldset class="rows" id="staged-record-matching-rules">
100                             <ol>
101                                 <li><span class="label">File name:</span> [% file_name | html %]</li>
102                                 <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments | html %][% ELSE %](none)[% END %]</li>
103                                 <li><span class="label">Type:</span> [% IF ( record_type == 'auth' ) %]Authority records[% ELSE %]Bibliographic records[% END %]</li>
104                                 <li><span class="label">Staged:</span> [% upload_timestamp | html %]</li>
105                                 <li><span class="label">Status:</span>
106                                     [% IF ( import_status == 'cleaned' ) %]
107                                         Cleaned
108                                     [% ELSIF ( import_status == 'imported' ) %]
109                                         Imported
110                                     [% ELSIF ( import_status == 'importing' ) %]
111                                         Importing
112                                     [% ELSIF ( import_status == 'reverted' ) %]
113                                         Reverted
114                                     [% ELSIF ( import_status == 'reverting' ) %]
115                                         Reverting
116                                     [% ELSIF ( import_status == 'staged' ) %]
117                                         Staged
118                                     [% ELSE %]
119                                         [% import_status | html %]
120                                     [% END %]
121                                 </li>
122                                 <li>
123                                     [% IF ( can_commit ) %]
124                                         <label for="new_matcher_id">Matching rule applied:</label>
125                                         <select name="new_matcher_id" id="new_matcher_id">
126                                             <option value="">Do not look for matching records</option>
127                                             [% FOREACH available_matcher IN available_matchers %]
128                                                 [% IF ( available_matcher.selected ) %]
129                                                     <option value="[% available_matcher.matcher_id | html %]" selected="selected">
130                                                         [% available_matcher.code | html %] ([% available_matcher.description | html %])
131                                                     </option>
132                                                 [% ELSE %]
133                                                     <option value="[% available_matcher.matcher_id | html %]">
134                                                         [% available_matcher.code | html %] ([% available_matcher.description | html %])
135                                                     </option>
136                                                 [% END %]
137                                             [% END %]
138                                         </select>
139                                         <span class="change-status">Changed. <a href="#" class="reset" id="reset_new_matcher_id">Reset</a></span>
140                                     [% ELSE %]
141                                         <span class="label">Matching rule applied</span>
142                                         [% IF ( current_matcher_id ) %]
143                                             [% current_matcher_code | html %] ([% current_matcher_description | html %])
144                                         [% ELSE %]
145                                             No matching rule in effect
146                                         [% END %]
147                                     [% END %]
148                                 </li>
149                                 <li>
150                                     [% IF ( can_commit ) %]
151                                         <label for="overlay_action">Action if matching record found:</label>
152                                         [% INCLUDE 'tools-overlay-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_overlay_action">Reset</a></span>
153                                     [% ELSE %]
154                                         <span class="label">Action if matching record found:</span>
155                                         [% IF ( overlay_action == 'replace' ) %]
156                                             Replace existing record with incoming record
157                                         [% ELSIF ( overlay_action == 'create_new' ) %]
158                                             Add incoming record
159                                         [% ELSIF ( overlay_action == 'ignore' ) %]
160                                             Ignore incoming record (its items may still be processed)
161                                         [% ELSE %]
162                                             [% overlay_action | html %]
163                                         [% END %]
164                                     [% END %]
165                                 </li>
166                                 <li>
167                                     [% IF ( can_commit ) %]
168                                         <label for="nomatch_action">Action if no match found:</label>
169                                         [% INCLUDE 'tools-nomatch-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_nomatch_action">Reset</a></span>
170                                     [% ELSE %]
171                                         <span class="label">Action if no match found:</span>
172                                         [% IF ( nomatch_action == 'create_new' ) %]
173                                             Add incoming record
174                                         [% ELSIF ( nomatch_action == 'ignore' ) %]
175                                             Ignore incoming record (its items may still be processed)
176                                         [% ELSE %]
177                                             [% nomatch_action | html %]
178                                         [% END %]
179                                     [% END %]
180                                 </li>
181                                 [% IF ( record_type == 'biblio' ) %]
182                                     <li>
183                                         [% IF ( can_commit ) %]
184                                             <label for="item_action">Item processing:</label>
185                                             [% INCLUDE 'tools-item-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_item_action">Reset</a></span>
186                                         [% ELSE %]
187                                             <span class="label">Item processing:</span>
188                                             [% IF ( item_action == 'always_add' ) %]
189                                                 Always add items
190                                             [% ELSIF ( item_action == 'add_only_for_matches' ) %]
191                                                 Add items only if matching bib was found
192                                             [% ELSIF ( item_action == 'add_only_for_new' ) %]
193                                                 Add items only if no matching bib was found
194                                             [% ELSIF ( item_action == 'ignore' ) %]
195                                                 Ignore items
196                                             [% ELSE %]
197                                                 [% item_action | html %]
198                                             [% END %]
199                                         [% END %]
200                                     </li>
201                                 [% END %]
202                             </ol>
203                             [% IF ( can_commit ) %]
204                                     <fieldset class="action"><input type="submit" value="Apply different matching rules" class="button" /></fieldset>
205                                 </form>
206                             [% END %]
207                         </fieldset> <!-- /#staged-record-matching-rules -->
208
209                         <div>
210                             [% IF ( can_commit ) %]
211                                 <form action="[% script_name | html %]" method="post" id="import_batch_form">
212                                     <input type="hidden" name="op" value="commit-batch" />
213                                     <input type="hidden" name="runinbackground" value="" />
214                                     <input type="hidden" name="completedJobID" value="" />
215                                     <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
216                                     <fieldset class="action">
217                                         [% IF ( record_type != 'auth' ) %]
218                                             Add new bibliographic records into this framework:
219                                             <select name="framework" id="frameworks">
220                                                 <option value="">Default</option>
221                                                 [% FOREACH framework IN frameworks %]
222                                                     <option value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option>
223                                                 [% END %]
224                                             </select>
225                                         [% END %]
226                                         <br />
227                                         <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" />
228                                     </fieldset>
229                                 </form> <!-- /#import_batch_form -->
230                                 <div id="jobpanel">
231                                     <div id="jobstatus" class="progress_panel">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
232                                     <div id="jobfailed"></div>
233                                 </div>
234                             [% END # /IF can_commit %]
235                             [% IF ( can_revert ) %]
236                                 <form action="[% script_name | html %]" method="post" id="revert_batch_form">
237                                     <input type="hidden" name="op" value="revert-batch" />
238                                     <input type="hidden" name="runinbackground" value="" />
239                                     <input type="hidden" name="completedJobID" value="" />
240                                     <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
241                                     <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" /></fieldset>
242                                 </form>
243                                 <div id="jobpanel">
244                                     <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
245                                     <div id="jobfailed"></div>
246                                 </div>
247                             [% END # /IF can_revert %]
248                         </div>
249
250                         [% IF ( did_commit ) %]
251                             <div class="dialog message">Completed import of records</div>
252                             <table>
253                                 <tr>
254                                     <td>Number of records added</td>
255                                     <td>[% num_added | html %]</td>
256                                 </tr>
257                                 <tr>
258                                     <td>Number of records updated</td>
259                                     <td>[% num_updated | html %]</td>
260                                 </tr>
261                                 <tr>
262                                     <td>Number of records ignored</td>
263                                     <td>[% num_ignored | html %]</td>
264                                 </tr>
265                                 [% IF ( record_type == 'biblio' ) %]
266                                     <tr>
267                                         <td>Number of items added</td>
268                                         <td>[% num_items_added | html %]</td>
269                                     </tr>
270                                     <tr>
271                                         <td>Number of items replaced</td>
272                                         <td>[% num_items_replaced | html %]</td>
273                                     </tr>
274                                     <tr>
275                                         <td>Number of items ignored because of duplicate barcode</td>
276                                         <td>[% num_items_errored | html %]</td>
277                                     </tr>
278                                 [% END %]
279                             </table>
280                         [% END #/ IF did_commit %]
281
282                         [% IF ( did_revert ) %]
283                             <div class="dialog message">Success: Import reversed</div>
284                             <table>
285                                 <tr>
286                                     <td>Number of records deleted</td>
287                                     <td>[% num_deleted | html %]</td>
288                                 </tr>
289                                 [% IF ( record_type == 'biblio' ) %]
290                                     <tr>
291                                         <td>Number of items deleted</td>
292                                         <td>[% num_items_deleted | html %]</td>
293                                     </tr>
294                                     <tr>
295                                         <td>Number of records not deleted due to items on loan</td>
296                                         <td>[% num_errors | html %]</td>
297                                     </tr>
298                                 [% END %]
299                                 <tr>
300                                     <td>Number of records changed back</td>
301                                     <td>[% num_reverted | html %]</td>
302                                 </tr>
303                                 <tr>
304                                     <td>Number of records ignored</td>
305                                     <td>[% num_ignored | html %]</td>
306                                 </tr>
307                             </table>
308                         [% END  # /IF did_revert%]
309
310                     [% END # /IF batch_info %]
311
312                     <br style="clear:both;" />
313
314                     [% IF ( batch_list ) %]
315                         [% IF ( pages ) %]
316                             [% PROCESS pagination %]
317                         [% END %]
318
319                         <table>
320                             <tr>
321                                 <th>#</th>
322                                 <th>File name</th>
323                                 <th>Comments</th>
324                                 <th>Type</th>
325                                 <th>Status</th>
326                                 <th>Staged</th>
327                                 <th># Records</th>
328                                 <th># Items</th>
329                                 <th>Action</th>
330                             </tr>
331                             [% FOREACH batch_lis IN batch_list %]
332                                 <tr>
333                                     <td>[% batch_lis.import_batch_id | html %]</td>
334                                     <td><a href="[% batch_lis.script_name | url %]?import_batch_id=[% batch_lis.import_batch_id | uri %]">[% batch_lis.file_name | html %]</a></td>
335                                     <td>[% batch_lis.comments | html %]</td>
336                                     <td>[% IF ( batch_lis.record_type == 'auth' ) %]Authority[% ELSE %]Bibliographic[% END %]</td>
337                                     <td>
338                                         [% IF ( batch_lis.import_status == 'cleaned' ) %]
339                                             Cleaned
340                                         [% ELSIF ( batch_lis.import_status == 'imported' ) %]
341                                             Imported
342                                         [% ELSIF ( batch_lis.import_status == 'importing' ) %]
343                                             Importing
344                                         [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
345                                             Reverted
346                                         [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
347                                             Reverting
348                                         [% ELSIF ( batch_lis.import_status == 'staged' ) %]
349                                             Staged
350                                         [% ELSE %]
351                                             [% batch_lis.import_status | html %]
352                                         [% END %]
353                                     </td>
354                                     <td>[% batch_lis.upload_timestamp | html %]</td>
355                                     <td>[% batch_lis.num_records | html %]</td>
356                                     <td>[% batch_lis.num_items | html %][% IF ( batch_lis.num_items ) %] <a href="[% batch_lis.script_name | url %]?import_batch_id=[% batch_lis.import_batch_id | uri %]&amp;op=create_labels">(Create label batch)</a>[% END %]</td>
357                                     <td class="actions">
358                                         [% IF ( batch_lis.can_clean ) %]
359                                             <form method="post" action="[% batch_lis.script_name | html %]" name="clean_batch_[% batch_lis.import_batch_id | html %]" id="clean_batch_[% batch_lis.import_batch_id | html %]" class="batch_form batch_clean">
360                                                 <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id | html %]" />
361                                                 <input type="hidden" name="op" value="clean-batch" />
362                                                 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-eraser"></i> Clean</button>
363                                             </form>
364                                         [% ELSIF ( batch_lis.import_status == 'cleaned' ) %]
365                                             <form method="post" action="/cgi-bin/koha/tools/manage-marc-import.pl" name="delete_batch_[% batch_lis.import_batch_id | html %]" id="delete_batch_[% batch_lis.import_batch_id | html %]" class="batch_form batch_delete">
366                                                 <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id | html %]" />
367                                                 <input type="hidden" name="op" value="delete-batch" />
368                                                 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</button>
369                                             </form>
370                                         [% END %]
371                                     </td>
372                                 </tr>
373                             [% END # /FOREACH batch_lis %]
374                         </table>
375
376                         [% IF ( pages ) %]
377                             [% PROCESS pagination %]
378                         [% END %]
379                     [% END # /IF batch_lis %]
380
381                     [% IF import_batch_id %]
382                         <table id="records-table">
383                             <thead>
384                                 <tr>
385                                     <th>#</th>
386                                     <th>Citation</th>
387                                     <th>Status</th>
388                                     <th>Match type</th>
389                                     <th>Match details</th>
390                                     <th><abbr title="Differences between the original bibliographic record and the imported">Diff</abbr></th>
391                                     <th>Record</th>
392                                 </tr>
393                             </thead>
394                         </table>
395
396                         <div id="marcPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
397                             <div class="modal-dialog modal-wide">
398                                 <div class="modal-content">
399                                     <div class="modal-header">
400                                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
401                                         <h3 id="marcPreviewLabel">MARC preview</h3>
402                                     </div>
403                                     <div class="modal-body">
404                                         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
405                                     </div>
406                                     <div class="modal-footer">
407                                         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
408                                     </div>
409                                 </div>
410                             </div>
411                         </div> <!-- /#marcPreview -->
412                     [% END # /IF import_batch_id %]
413                 </main>
414
415             </div> <!-- /.col-sm-10.col-sm-push-2 -->
416             <div class="col-sm-2 col-sm-pull-10">
417                 <aside>
418                     [% INCLUDE 'tools-menu.inc' %]
419                 </aside>
420             </div> <!-- .col-sm-2.col-sm-pull-10 -->
421         </div> <!-- /.row -->
422
423 [% MACRO jsinclude BLOCK %]
424     [% Asset.js("js/tools-menu.js") | $raw %]
425     [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
426     [% Asset.js("js/background-job-progressbar.js") | $raw %]
427     [% INCLUDE 'datatables.inc' %]
428     <script>
429         $(document).ready(function() {
430             $("#staged-record-matching-rules select").change(function() {
431                 var str = $(this).attr("id");
432                 $("#reset_" + str).parent().show();
433             });
434             $("a.reset").click(function() {
435                 var str = $(this).attr("id");
436                 str = str.replace("reset_", "")
437                 $("#" + str + " option[selected='selected']").attr("selected", "selected");
438                 $(this).parent().hide();
439             });
440
441             [% IF import_batch_id %]
442                 $("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, {
443                     "bAutoWidth": false,
444                     "bFilter": false,
445                     "bProcessing": true,
446                     "bServerSide": true,
447                     "sAjaxSource": 'batch_records_ajax.pl',
448                     "sPaginationType": "full_numbers",
449                     "sDom": '<"top pager"iflp>rt<"bottom pager"flp><"clear">',
450                     "aoColumns": [
451                         { "mDataProp": "import_record_id" },
452                         { "mDataProp": "citation" },
453                         { "mDataProp": "status" },
454                         { "mDataProp": "overlay_status" },
455                         { "mDataProp": "match_citation" },
456                         { "mDataProp": "diff_url" },
457                         { "mDataProp": "matched" }
458                     ],
459                     "fnServerData": function(sSource, aoData, fnCallback) {
460                         aoData.push({ "name": "import_batch_id", "value": [% import_batch_id | html %] });
461
462                         $.ajax({
463                             'dataType': 'json',
464                             'type': 'POST',
465                             'url': sSource,
466                             'data': aoData,
467                             'success': function(json) {
468                                 fnCallback(json);
469                             }
470                         });
471                     },
472                     "fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
473                         [% IF(record_type == 'auth') %]
474                             var record_details_url = "/cgi-bin/koha/authorities/detail.pl?authid=";
475                         [% ELSE %]
476                             var record_details_url = "/cgi-bin/koha/catalogue/detail.pl?biblionumber=";
477                         [% END %]
478
479                         var additional_details = "";
480                         if( aData['author'] ){
481                             additional_details += " " + aData['author'] + " ";
482                         }
483
484                         if( aData['isbn'] ){
485                             additional_details += " (" + aData['isbn'] + ") ";
486                         }
487
488                         if( aData['issn'] ){
489                             additional_details += " (" + aData['issn'] + ") ";
490                         }
491
492                         $('td:eq(1)', nRow).html(
493                             '<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '&viewas=html" class="previewMARC">' + aData['citation'] + '</a> ' + additional_details
494                         );
495
496                         $('td:eq(2)', nRow).html(
497                             aData['status'] == 'imported' ? _("Imported") :
498                             aData['status'] == 'ignored' ? _("Ignored") :
499                             aData['status'] == 'reverted' ? _("Reverted") :
500                             aData['status'] == 'staged' ? _("Staged") :
501                             aData['status'] == 'error' ? _("Error") :
502                             aData['status']
503                         );
504
505                         $('td:eq(3)', nRow).html(
506                             aData['overlay_status'] == 'no_match' ? _("No match") :
507                             aData['overlay_status'] == 'match_applied' ? _("Match applied") :
508                             aData['overlay_status'] == 'auto_match' ? _("Match found") :
509                             aData['overlay_status']
510                         );
511
512                         if (aData['match_id']) {
513                             [% IF(record_type == 'auth') -%]
514                                 var matching_msg = _("Matches authority %s (score=%s):%s");
515                             [%- ELSE -%]
516                                 var matching_msg = _("Matches bibliographic record %s (score=%s):%s");
517                             [%- END %]
518                             $('td:eq(4)', nRow).html(
519                                 matching_msg.format(aData['match_id'], aData['score'],
520                                     '<a target="_blank" href="' + record_details_url
521                                     + aData['match_id'] + '">' + aData['match_citation'] + '</a>')
522                             );
523                         }
524                         if (aData['diff_url']) {
525                             $('td:eq(5)', nRow).html(
526                                 '<a href="' + aData['diff_url'] + '">' + _("View") + '</a>'
527                             );
528                         }
529                         $('td:eq(6)', nRow).html(
530                             '<a target="_blank" href="' + record_details_url
531                             + aData['matched'] + '">' + aData['matched'] + '</a>'
532                         );
533                     },
534                 }));
535                 $("#import_batch_form").on("submit", function() {
536                     return submitBackgroundJob(document.getElementById("import_batch_form"));
537                 });
538                 $("#revert_batch_form").on("submit", function() {
539                     return confirm(_("Are you sure you want to undo the import of this batch into the catalog?")) && submitBackgroundJob(document.getElementById("revert_batch_form"));
540                 });
541             [% END %]
542
543             $("body").on("click", ".previewMARC", function(e) {
544                 e.preventDefault();
545                 var ltitle = $(this).text();
546                 var page = $(this).attr("href");
547                 $("#marcPreviewLabel").text(ltitle);
548                 $("#marcPreview .modal-body").load(page + " table");
549                 $('#marcPreview').modal({ show: true });
550             });
551             $("#marcPreview").on("hidden.bs.modal", function() {
552                 $("#marcPreviewLabel").html("");
553                 $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> " + _("Loading") + "</div>");
554             });
555             $(".batch_form").on("submit", function() {
556                 if ($(this).hasClass("batch_delete")) {
557                     return confirm(_("Are you sure you want to permanently delete this batch?"));
558                 } else {
559                     return confirm(_("Clear all reservoir records staged in this batch?  This cannot be undone."));
560                 }
561             });
562         });
563
564     </script>
565 [% END %]
566 [% INCLUDE 'intranet-bottom.inc' %]
567 [% BLOCK pagination %]
568     <nav>
569         <ul class="pagination">
570             [% FOREACH page IN pages %]
571                 [% IF ( page.current_page && page.page_number > 1 ) %]
572                     <li><a href="[% page.script_name | url %]?offset=0" class="nav"><i class="fa fa-fw fa-angle-double-left"></i> First</a></li>
573                     <li><a href="[% page.script_name | url %]?offset=[% offset - results_per_page | uri %]"><i class="fa fa-fw fa-angle-left"></i> Previous</a></li>
574                 [% END %]
575             [% END %]
576             [% FOREACH page IN pages %]
577                 [% IF ( page.current_page ) %]
578                     [% SET current_page = page.page_number %]
579                     <li class="active"><span class="current">[% page.page_number | html %]</span></li>
580                 [% ELSE %]
581                     <li><a class="nav" href="[% page.script_name | url %]?offset=[% page.offset | uri %]">[% page.page_number | html %]</a></li>
582                 [% END %]
583             [% END %]
584             [% IF ( current_page < pages.size() ) %]
585                 <li>
586                     <a href="[% page.script_name | url %]?offset=[% offset + results_per_page | uri %]" class="nav">Next <i class="fa fa-fw fa-angle-right"></i></a>
587                 </li>
588                 <li>
589                     <a href="[% page.script_name | url %]?offset=[% ( results_per_page * ( pages.size - 1 ) ) | uri %]" class="nav">Last <i class="fa fa-fw fa-angle-double-right"></i></a>
590                 </li>
591             [% END %]
592         </ul>
593     </nav>
594 [% END %]