Lines 1-3
Link Here
|
|
|
1 |
[% SET footerjs = 1 %] |
1 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
<title>Koha › Tools › Manage staged MARC records |
3 |
<title>Koha › Tools › Manage staged MARC records |
3 |
[% IF ( import_batch_id ) %] |
4 |
[% IF ( import_batch_id ) %] |
Lines 5-138
Link Here
|
5 |
[% END %] |
6 |
[% END %] |
6 |
</title> |
7 |
</title> |
7 |
[% INCLUDE 'doc-head-close.inc' %] |
8 |
[% INCLUDE 'doc-head-close.inc' %] |
8 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script> |
|
|
9 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
9 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
10 |
[% INCLUDE 'datatables.inc' %] |
|
|
11 |
<script type="text/javascript"> |
12 |
//<![CDATA[ |
13 |
$(document).ready(function(){ |
14 |
$("#staged-record-matching-rules select").change(function(){ |
15 |
var str = $(this).attr("id"); |
16 |
$("#reset_"+str).parent().show(); |
17 |
}); |
18 |
$("a.reset").click(function(){ |
19 |
var str = $(this).attr("id"); |
20 |
str = str.replace("reset_","") |
21 |
$("#"+str+" option[selected='selected']").attr("selected","selected"); |
22 |
$(this).parent().hide(); |
23 |
}); |
24 |
|
25 |
[% IF import_batch_id %] |
26 |
$("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, { |
27 |
"bAutoWidth": false, |
28 |
"bFilter": false, |
29 |
"bProcessing": true, |
30 |
"bServerSide": true, |
31 |
"sAjaxSource": 'batch_records_ajax.pl', |
32 |
"sPaginationType": "full_numbers", |
33 |
"sDom": '<"top pager"iflp>rt<"bottom pager"flp><"clear">', |
34 |
"aoColumns": [ |
35 |
{ "mDataProp": "import_record_id" }, |
36 |
{ "mDataProp": "citation" }, |
37 |
{ "mDataProp": "status" }, |
38 |
{ "mDataProp": "overlay_status" }, |
39 |
{ "mDataProp": "match_citation" }, |
40 |
{ "mDataProp": "diff_url" }, |
41 |
{ "mDataProp": "matched" } |
42 |
], |
43 |
"fnServerData": function ( sSource, aoData, fnCallback ) { |
44 |
aoData.push( { "name": "import_batch_id", "value": [% import_batch_id %] } ); |
45 |
|
46 |
$.ajax({ |
47 |
'dataType': 'json', |
48 |
'type': 'POST', |
49 |
'url': sSource, |
50 |
'data': aoData, |
51 |
'success': function(json){ |
52 |
fnCallback(json); |
53 |
} |
54 |
}); |
55 |
}, |
56 |
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { |
57 |
[% IF ( record_type == 'auth' ) %] |
58 |
var record_details_url = "/cgi-bin/koha/authorities/detail.pl?authid="; |
59 |
[% ELSE %] |
60 |
var record_details_url = "/cgi-bin/koha/catalogue/detail.pl?biblionumber="; |
61 |
[% END %] |
62 |
|
63 |
$('td:eq(1)', nRow).html( |
64 |
'<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '&viewas=html" class="previewMARC">' + aData['citation'] + '</a>' |
65 |
); |
66 |
|
67 |
$('td:eq(2)', nRow).html( |
68 |
aData['status'] == 'imported' ? _("Imported") : |
69 |
aData['status'] == 'ignored' ? _("Ignored") : |
70 |
aData['status'] == 'reverted' ? _("Reverted") : |
71 |
aData['status'] == 'staged' ? _("Staged") : |
72 |
aData['status'] == 'error' ? _("Error") : |
73 |
aData['status'] |
74 |
); |
75 |
|
76 |
$('td:eq(3)', nRow).html( |
77 |
aData['overlay_status'] == 'no_match' ? _("No match") : |
78 |
aData['overlay_status'] == 'match_applied' ? _("Match applied") : |
79 |
aData['overlay_status'] == 'auto_match' ? _("Match found") : |
80 |
aData['overlay_status'] |
81 |
); |
82 |
|
83 |
if ( aData['match_id'] ) { |
84 |
[% IF ( record_type == 'auth' ) -%] |
85 |
var matching_msg = _("Matches authority %s (score=%s):%s"); |
86 |
[%- ELSE -%] |
87 |
var matching_msg = _("Matches biblio %s (score=%s):%s"); |
88 |
[%- END %] |
89 |
$('td:eq(4)', nRow).html( |
90 |
matching_msg.format(aData['match_id'], aData['score'], |
91 |
'<a target="_blank" href="' + record_details_url |
92 |
+ aData['match_id'] + '">' + aData['match_citation'] + '</a>') |
93 |
); |
94 |
} |
95 |
if (aData['diff_url']){ |
96 |
$('td:eq(5)', nRow).html( |
97 |
'<a href="'+aData['diff_url']+'">View</a>' |
98 |
); |
99 |
} |
100 |
$('td:eq(6)', nRow).html( |
101 |
'<a target="_blank" href="' + record_details_url |
102 |
+ aData['matched'] + '">' + aData['matched'] + '</a>' |
103 |
); |
104 |
}, |
105 |
})); |
106 |
$("#import_batch_form").on("submit",function(){ |
107 |
return submitBackgroundJob( document.getElementById("import_batch_form") ); |
108 |
}); |
109 |
$("#revert_batch_form").on("submit",function(){ |
110 |
return confirm( _("Are you sure you want to undo the import of this batch into the catalog?") ) && submitBackgroundJob( document.getElementById("revert_batch_form") ); |
111 |
}); |
112 |
[% END %] |
113 |
$("body").on("click",".previewMARC", function(e){ |
114 |
e.preventDefault(); |
115 |
var ltitle = $(this).text(); |
116 |
var page = $(this).attr("href"); |
117 |
$("#marcPreviewLabel").text(ltitle); |
118 |
$("#marcPreview .modal-body").load(page + " table"); |
119 |
$('#marcPreview').modal({show:true}); |
120 |
}); |
121 |
$("#marcPreview").on("hidden", function(){ |
122 |
$("#marcPreviewLabel").html(""); |
123 |
$("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
124 |
}); |
125 |
$(".batch_form").on("submit",function(){ |
126 |
if( $(this).hasClass("batch_delete") ){ |
127 |
return confirm( _("Are you sure you want to permanently delete this batch?") ); |
128 |
} else { |
129 |
return confirm( _("Clear all reservoir records staged in this batch? This cannot be undone.") ); |
130 |
} |
131 |
}); |
132 |
}); |
133 |
|
134 |
//]]> |
135 |
</script> |
136 |
<style type="text/css"> |
10 |
<style type="text/css"> |
137 |
#jobpanel,#jobstatus,#jobfailed { display : none; } |
11 |
#jobpanel,#jobstatus,#jobfailed { display : none; } |
138 |
</style> |
12 |
</style> |
Lines 505-508
Page
Link Here
|
505 |
[% INCLUDE 'tools-menu.inc' %] |
379 |
[% INCLUDE 'tools-menu.inc' %] |
506 |
</div> |
380 |
</div> |
507 |
</div> |
381 |
</div> |
|
|
382 |
|
383 |
[% MACRO jsinclude BLOCK %] |
384 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script> |
385 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script> |
386 |
[% INCLUDE 'datatables.inc' %] |
387 |
<script type="text/javascript"> |
388 |
$(document).ready(function(){ |
389 |
$("#staged-record-matching-rules select").change(function(){ |
390 |
var str = $(this).attr("id"); |
391 |
$("#reset_"+str).parent().show(); |
392 |
}); |
393 |
$("a.reset").click(function(){ |
394 |
var str = $(this).attr("id"); |
395 |
str = str.replace("reset_","") |
396 |
$("#"+str+" option[selected='selected']").attr("selected","selected"); |
397 |
$(this).parent().hide(); |
398 |
}); |
399 |
|
400 |
[% IF import_batch_id %] |
401 |
$("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, { |
402 |
"bAutoWidth": false, |
403 |
"bFilter": false, |
404 |
"bProcessing": true, |
405 |
"bServerSide": true, |
406 |
"sAjaxSource": 'batch_records_ajax.pl', |
407 |
"sPaginationType": "full_numbers", |
408 |
"sDom": '<"top pager"iflp>rt<"bottom pager"flp><"clear">', |
409 |
"aoColumns": [ |
410 |
{ "mDataProp": "import_record_id" }, |
411 |
{ "mDataProp": "citation" }, |
412 |
{ "mDataProp": "status" }, |
413 |
{ "mDataProp": "overlay_status" }, |
414 |
{ "mDataProp": "match_citation" }, |
415 |
{ "mDataProp": "diff_url" }, |
416 |
{ "mDataProp": "matched" } |
417 |
], |
418 |
"fnServerData": function ( sSource, aoData, fnCallback ) { |
419 |
aoData.push( { "name": "import_batch_id", "value": [% import_batch_id %] } ); |
420 |
|
421 |
$.ajax({ |
422 |
'dataType': 'json', |
423 |
'type': 'POST', |
424 |
'url': sSource, |
425 |
'data': aoData, |
426 |
'success': function(json){ |
427 |
fnCallback(json); |
428 |
} |
429 |
}); |
430 |
}, |
431 |
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { |
432 |
[% IF ( record_type == 'auth' ) %] |
433 |
var record_details_url = "/cgi-bin/koha/authorities/detail.pl?authid="; |
434 |
[% ELSE %] |
435 |
var record_details_url = "/cgi-bin/koha/catalogue/detail.pl?biblionumber="; |
436 |
[% END %] |
437 |
|
438 |
$('td:eq(1)', nRow).html( |
439 |
'<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '&viewas=html" class="previewMARC">' + aData['citation'] + '</a>' |
440 |
); |
441 |
|
442 |
$('td:eq(2)', nRow).html( |
443 |
aData['status'] == 'imported' ? _("Imported") : |
444 |
aData['status'] == 'ignored' ? _("Ignored") : |
445 |
aData['status'] == 'reverted' ? _("Reverted") : |
446 |
aData['status'] == 'staged' ? _("Staged") : |
447 |
aData['status'] == 'error' ? _("Error") : |
448 |
aData['status'] |
449 |
); |
450 |
|
451 |
$('td:eq(3)', nRow).html( |
452 |
aData['overlay_status'] == 'no_match' ? _("No match") : |
453 |
aData['overlay_status'] == 'match_applied' ? _("Match applied") : |
454 |
aData['overlay_status'] == 'auto_match' ? _("Match found") : |
455 |
aData['overlay_status'] |
456 |
); |
457 |
|
458 |
if ( aData['match_id'] ) { |
459 |
[% IF ( record_type == 'auth' ) -%] |
460 |
var matching_msg = _("Matches authority %s (score=%s):%s"); |
461 |
[%- ELSE -%] |
462 |
var matching_msg = _("Matches biblio %s (score=%s):%s"); |
463 |
[%- END %] |
464 |
$('td:eq(4)', nRow).html( |
465 |
matching_msg.format(aData['match_id'], aData['score'], |
466 |
'<a target="_blank" href="' + record_details_url |
467 |
+ aData['match_id'] + '">' + aData['match_citation'] + '</a>') |
468 |
); |
469 |
} |
470 |
if (aData['diff_url']){ |
471 |
$('td:eq(5)', nRow).html( |
472 |
'<a href="'+aData['diff_url']+'">View</a>' |
473 |
); |
474 |
} |
475 |
$('td:eq(6)', nRow).html( |
476 |
'<a target="_blank" href="' + record_details_url |
477 |
+ aData['matched'] + '">' + aData['matched'] + '</a>' |
478 |
); |
479 |
}, |
480 |
})); |
481 |
$("#import_batch_form").on("submit",function(){ |
482 |
return submitBackgroundJob( document.getElementById("import_batch_form") ); |
483 |
}); |
484 |
$("#revert_batch_form").on("submit",function(){ |
485 |
return confirm( _("Are you sure you want to undo the import of this batch into the catalog?") ) && submitBackgroundJob( document.getElementById("revert_batch_form") ); |
486 |
}); |
487 |
[% END %] |
488 |
$("body").on("click",".previewMARC", function(e){ |
489 |
e.preventDefault(); |
490 |
var ltitle = $(this).text(); |
491 |
var page = $(this).attr("href"); |
492 |
$("#marcPreviewLabel").text(ltitle); |
493 |
$("#marcPreview .modal-body").load(page + " table"); |
494 |
$('#marcPreview').modal({show:true}); |
495 |
}); |
496 |
$("#marcPreview").on("hidden", function(){ |
497 |
$("#marcPreviewLabel").html(""); |
498 |
$("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
499 |
}); |
500 |
$(".batch_form").on("submit",function(){ |
501 |
if( $(this).hasClass("batch_delete") ){ |
502 |
return confirm( _("Are you sure you want to permanently delete this batch?") ); |
503 |
} else { |
504 |
return confirm( _("Clear all reservoir records staged in this batch? This cannot be undone.") ); |
505 |
} |
506 |
}); |
507 |
}); |
508 |
</script> |
509 |
[% END %] |
510 |
|
508 |
[% INCLUDE 'intranet-bottom.inc' %] |
511 |
[% INCLUDE 'intranet-bottom.inc' %] |