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