Koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/showdiffmarc.tt
Owen Leonard 2d9eb6202f Bug 11876 [Follow-up] Add a diff view to staged MARC Records
This follow up makes some corrections to the previously added files and
adds some functionality to the diff: A Javascript diff plugin highlights
the differences between the records in the two columns.

Corrections made: Converted tab indentation to spaces, corrected GPL
statement.

File organization: Moved showdiffmarc.pl and .tt to /tools/ to match the
location of the page with which it functions,
tools/manage-marc-import.pl. Corrected permissions on showdiffmarc.pl
accordingly.

Updates to the template: Added standard includes inclucing header menu
and breadcrumbs; converted custom layout to YUI Grid standard.

To test, follow the test plan previously defined:

- Stage a MARC record batch which contains at least one record match for
  something already in your catalog.
- Locate the staged MARC record batch in Tools -> Manage staged records
  and click to view the contents.
- Find the record which matched an existing record and click the "View"
  link in the Diff column.
- The compare screen should include the header menu and breadcrumbs. The
  differences between your staged file and the existing record should be
  higlighted.
- You should be able to return to the MARC batch you were previously
  viewing by following the link in the breadcrumbs or the link at the
  bottom of the page.
- Confirm that the "About" page includes information about the new
  JavaScript plugin on the Licenses tab.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-31 14:25:11 -03:00

55 lines
2.2 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Manage staged MARC records &rsaquo; Compare matched records</title>
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript" src="[% interface %]/lib/jsdiff/jsdiff.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var diff1 = $("#col1 pre").text();
var diff2 = $("#col2 pre").text();
var diffs = diffString(diff1,diff2);
$("#col1 pre,#col2 pre").html(diffs);
});
</script>
<style type="text/css">
ins { background-color: #e6ffe6; }
del { background-color: #ffe6e6; }
#col1 ins, #col2 del { display: none; }
pre { padding: 10px; overflow: scroll; }
</style>
</head>
<body id="tools_compare-marc-import" class="tools">
[% INCLUDE 'header.inc' %]
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/tools/manage-marc-import.pl">Manage staged MARC records</a> &rsaquo; <a href="/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=[% batchid %]">Batch [% batchid %]</a> &rsaquo; Compare matched records
</div>
<div id="doc3">
<div class="yui-g">
<div id="col1" class="yui-u first">
<h1>Original</h1>
[% IF ( ERROR_FORMATTED1 ) %]
<div class="dialog alert">
<p>The biblionumber <em>[% BIBLIONUMBER %]</em> doesn't match any existing record.</p>
</div>
[% ELSE %]
<h2>[% BIBLIOTITLE %]</h2>
<pre>[% MARC_FORMATTED1 %]</pre>
[% END %]
</div>
<div id="col2" class="yui-u">
<h1>Imported</h1>
[% IF ( ERROR_FORMATTED2 ) %]
<div class="dialog alert">
<p>The import id number <em>[% IMPORTID %]</em> doesn't match any existing record.</p>
</div>
[% ELSE %]
<h2>[% IMPORTTITLE %]</h2>
<pre>[% MARC_FORMATTED2 %] </pre>
[% END %]
</div>
</div>
<p><a href="/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=[% batchid %]">Return to staged MARC batch [% batchid %]</a></p>
[% INCLUDE 'intranet-bottom.inc' %]