Bugzilla – Attachment 33052 Details for
Bug 11876
Add a diff view to staged MARC records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 11876 - Add a diff view for staged MARC records.
PASSED-QA-Bug-11876---Add-a-diff-view-for-staged-M.patch (text/plain), 6.23 KB, created by
Kyle M Hall (khall)
on 2014-10-31 12:30:25 UTC
(
hide
)
Description:
[PASSED QA] Bug 11876 - Add a diff view for staged MARC records.
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-10-31 12:30:25 UTC
Size:
6.23 KB
patch
obsolete
>From 2e5bbbcc832840633c89300700cb9e1294c87a15 Mon Sep 17 00:00:00 2001 >From: mbeaulieu <mbeaulieu@inlibro.com> >Date: Thu, 7 Aug 2014 13:10:26 -0400 >Subject: [PATCH] [PASSED QA] Bug 11876 - Add a diff view for staged MARC records. > >New patch should apply correctly. > > modified: C4/ImportBatch.pm > modified: koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Bug 11876 - Diff column is now displayed. > >If a match is found, a 'View' link appears in the Diff column. > >Old patch was not implementing datatables, and therefore was not compatible with this version of Koha. > modified: koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt > modified: tools/batch_records_ajax.pl > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >These patches have some issues but I'm going to submit a follow-up which >I think will address them all and offer some improvements as well. > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > 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(-) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index a487cc6..51a0585 100644 >--- a/C4/ImportBatch.pm >+++ b/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); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >index 2b4684a..0b10962 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >+++ b/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' ) %] >+ <a target="_blank" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record.final_match_id %]">[% record.final_match_id %]</a> >+ [% ELSIF ( record.record_type == 'auth' ) %] >+ <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record.final_match_id %]">[% record.final_match_id %]</a> >+ [% END %] >+[% END %] >+[% BLOCK match_link %] >+ [% IF ( record_lis.match_id ) %] >+ <tr> >+ <td /> >+ [% IF ( record.record_type == 'biblio' ) %] >+ <td class="highlight" colspan="5">Matches biblio [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record_lis.match_id %]">[% record_lis.match_citation %]</a></td> >+ [% ELSIF ( record.record_type == 'auth' ) %] >+ <td class="highlight" colspan="5">Matches authority [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record_lis.match_id %]">[% record_lis.match_citation %]</a> | >+ <a href="/cgi-bin/koha/authorities/merge.pl?mergereference=breeding&authid=[% record_lis.match_id %]&authid=[% record_lis.import_record_id %]">Merge</a> >+ </td> >+ [% END %] >+ </tr> >+ [% ELSIF ( record.record_type == 'auth') %] >+ <tr data-authid="[% record_lis.import_record_id %]"> >+ <td /> >+ <td class="highlight" colspan="4"><a href="#" class="merge_auth">Search for a record to merge in a new window</a></td> >+ </tr> >+ [% END %] >+[% END %] >+ > [% INCLUDE 'doc-head-open.inc' %] > <title>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> >diff --git a/tools/batch_records_ajax.pl b/tools/batch_records_ajax.pl >index bc0fe82..57d7bc0 100755 >--- a/tools/batch_records_ajax.pl >+++ b/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 > }; > } > >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11876
:
25743
|
30590
|
30591
|
30787
|
30797
|
30798
|
30799
|
30800
|
31835
|
31847
|
31871
|
31872
|
31873
|
31874
|
32987
|
32995
| 33052 |
33053
|
33054
|
33055
|
33056