@@ -, +, @@ --- C4/ImportBatch.pm | 20 ++++++++++ .../prog/en/modules/tools/manage-marc-import.tt | 39 ++++++++++++++++++-- tools/batch_records_ajax.pl | 1 + 3 files changed, 57 insertions(+), 3 deletions(-) --- a/C4/ImportBatch.pm +++ a/C4/ImportBatch.pm @@ -58,6 +58,7 @@ BEGIN { GetStagedWebserviceBatches GetImportBatchRangeDesc GetNumberOfNonZ3950ImportBatches + GetImportBiblios GetImportRecordsRange GetItemNumbersFromImportBatch @@ -1017,6 +1018,25 @@ sub GetNumberOfNonZ3950ImportBatches { return $count; } +=head2 GetImportBiblios + + my $results = GetImportBiblios($importid); + +=cut + +sub GetImportBiblios { + my ($import_record_id) = @_; + + my $dbh = C4::Context->dbh; + my $query = "SELECT * FROM import_biblios WHERE import_record_id = ?"; + my $sth = $dbh->prepare_cached($query); + $sth->execute($import_record_id); + my $results = $sth->fetchall_arrayref({}); + $sth->finish(); + return $results; + +} + =head2 GetImportRecordsRange my $results = GetImportRecordsRange($batch_id, $offset, $results_per_group); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt @@ -1,3 +1,30 @@ +[% BLOCK final_match_link %] + [% IF ( record.record_type == 'biblio' ) %] + [% record.final_match_id %] + [% ELSIF ( record.record_type == 'auth' ) %] + [% record.final_match_id %] + [% END %] +[% END %] +[% BLOCK match_link %] + [% IF ( record_lis.match_id ) %] + + + [% IF ( record.record_type == 'biblio' ) %] + Matches biblio [% record_lis.match_id %] (score = [% record_lis.match_score %]): [% record_lis.match_citation %] + [% ELSIF ( record.record_type == 'auth' ) %] + Matches authority [% record_lis.match_id %] (score = [% record_lis.match_score %]): [% record_lis.match_citation %] | + Merge + + [% END %] + + [% ELSIF ( record.record_type == 'auth') %] + + + Search for a record to merge in a new window + + [% END %] +[% END %] + [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Manage staged MARC records [% IF ( import_batch_id ) %] @@ -39,7 +66,8 @@ $(document).ready(function(){ { "mDataProp": "status" }, { "mDataProp": "overlay_status" }, { "mDataProp": "match_citation" }, - { "mDataProp": "matched" }, + { "mDataProp": "diff_url" }, + { "mDataProp": "matched" } ], "fnServerData": function ( sSource, aoData, fnCallback ) { aoData.push( { "name": "import_batch_id", "value": [% import_batch_id %] } ); @@ -93,8 +121,12 @@ $(document).ready(function(){ + aData['match_id'] + '">' + aData['match_citation'] + '</a>') ); } - - $('td:eq(5)', nRow).html( + if (aData['diff_url']){ + $('td:eq(5)', nRow).html( + '<a rel="gb_page_center[960,600]" href="'+aData['diff_url']+'">View</a>' + ); + } + $('td:eq(6)', nRow).html( '<a target="_blank" href="' + record_details_url + aData['matched'] + '">' + aData['matched'] + '</a>' ); @@ -444,6 +476,7 @@ Page <th>Status</th> <th>Match type</th> <th>Match details</th> + <th><abbr title="Differences between the original biblio and the imported" lang="en">Diff</abbr></th> <th>Record</th> </tr> </thead> --- a/tools/batch_records_ajax.pl +++ a/tools/batch_records_ajax.pl @@ -107,6 +107,7 @@ foreach my $record (@$records) { || q{}, score => $#$match > -1 ? $match->[0]->{'score'} : 0, match_id => $match_id, + diff_url => $match_id ? "/cgi-bin/koha/tools/showdiffmarc.pl?importid=$record->{import_record_id}&id=$match_id" : undef }; } --