Koha/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt
Galen Charlton 4a2aa0e768 bug 5202: (follow-up) adjust for the move of the merge record Javascript
This patch applies to change from bug 10650 to the new
authority record merge feature.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-10 21:50:08 +00:00

154 lines
6.2 KiB
Text

[% PROCESS 'merge-record.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Cataloging &rsaquo; Merging records</title>
[% INCLUDE 'greybox.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript" src="[% themelang %]/js/merge-record.js"></script>
[% INCLUDE 'merge-record-strings.inc' %]
<style type="text/css">
div.record ul, div.record li { float:none; display:block; }
div#result { margin-top: 1em; }
/* We use this style "against" the li ui-tabs-nav style automatically applied */
</style>
<script type="text/javascript">
//<![CDATA[
// When submiting the form
function mergeformsubmit() {
$("ul#ulrecord1").remove();
$("ul#ulrecord2").remove();
}
$(document).ready(function(){
// Getting marc structure via ajax
tagslib = [];
$.getJSON("/cgi-bin/koha/authorities/merge_ajax.pl", {frameworkcode : "[% framework %]" }, function(json) {
tagslib = json;
});
$('.preview-merge-reference').click(function (ev) {
ev.preventDefault();
newin=window.open($(this).attr('href'),'merge_reference', 'width=1000,height=600,toolbar=false,scrollbars=yes');
});
// Creating tabs
$("#tabs").tabs();
});
function changeFramework(fw) {
$("#Frameworks").val(fw);
}
//]]>
</script>
</head>
<body id="auth_merge" class="cat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'authorities-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a> &rsaquo; Merging records</div>
<div id="doc" class="yui-t7">
<div id="bd">
<div id="yui-main">
<h1>Merging records</h1>
[% IF ( result ) %]
[% IF ( errors ) %]
[% FOREACH error IN errors %]
<div class="dialog alert">
[% IF error.code == 'CANNOT_MOVE' %]
The following items could not be moved from the old record to the new one: [% error.value %]
[% ELSIF error.code == 'FRAMEWORK_NOT_SELECTED' %]
No framework has been selected. Please select a framework for merging.
[% ELSE %]
[% error %]
[% END %]
<br />Therefore, the record to be merged has not been deleted.</div>
[% END %]
[% ELSE %]
<script type="text/javascript">window.location.href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid1 %]"</script>
<p>The merging was successful. <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid1 %]">Click here to see the merged record.</a></p>
[% END %]
[% ELSE %]
[% IF ( choosereference ) %]
<p>Please choose which record will be the reference for the merge. The record chosen as reference will be kept, and the other will be deleted.</p>
<form id="mergeform" action="/cgi-bin/koha/authorities/merge.pl" method="post">
<fieldset class="rows">
<legend>Merge reference</legend>
<ol>
<li class="radio"><input type="radio" value="[% recordid1 %]" checked="checked" id="mergereference1" name="mergereference" onclick="changeFramework('[% frameworkcode1 %]')" /><label for="mergereference1">[% title1 %] [% FOREACH subtitl1 IN subtitle1 %] [% subtitl1.subfield %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid1 %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid1 %][% IF frameworklabel1 %] &mdash; [% frameworklabel1 %][% END %]</a>)</label></li>
<li class="radio"><input type="radio" value="[% recordid2 %]" id="mergereference2" name="mergereference" onclick="changeFramework('[% frameworkcode2 %]')" /><label for="mergereference2">[% title2 %] [% FOREACH subtitl2 IN subtitle2 %] [% subtitl2.subfield %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid2 %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid2 %][% IF frameworklabel2 %] &mdash; [% frameworklabel2 %][% END %]</a>)</label></li>
[% IF frameworkselect %]
<li><label for="frameworkcode">Using framework:</label>
<select name="frameworkcode" id="frameworkcode">
<option value="Default">Default</option>
[% FOREACH frameworkcodeloo IN frameworkselect %]
[% IF ( frameworkcodeloo.selected ) %]
<option value="[% frameworkcodeloo.value %]" selected="selected">
[% ELSE %]
<option value="[% frameworkcodeloo.value %]">
[% END %]
[% frameworkcodeloo.frameworktext %]
</option>
[% END %]
</select></li>
[% END %]
</ol>
<input type="hidden" name="authid" value="[% recordid1 %]" />
<input type="hidden" name="authid" value="[% recordid2 %]" />
<fieldset class="action"><input type="submit" value="Next" /></fieldset>
</fieldset>
</form>
[% ELSE %]
[% IF ( errors ) %]
<div class="dialog alert">
[% FOREACH error IN errors %]
<p>
[% IF error.code == 'WRONG_COUNT' %]
Number of records provided for merging: [% error.value %]. Currently only 2 records can be merged at a time.
[% ELSE %]
[% error %]
[% END %]
</p>
[% END %]
</div>
[% ELSE %]
<form id="mergeform" action="/cgi-bin/koha/authorities/merge.pl" method="post" onsubmit="return mergeformsubmit()">
<div class="yui-g">
<div class="yui-u first">
[% PROCESS mergesource %]
</div>
<div class="yui-u">
[% PROCESS mergetarget %]
</div> <!-- .yui-u -->
<input type="hidden" name="recordid1" value="[% recordid1 %]" />
<input type="hidden" name="recordid2" value="[% recordid2 %]" />
<input type="hidden" name="mergereference" value="[% mergereference %]" />
<input type="hidden" name="frameworkcode" value="[% framework %]" />
<fieldset class="action"><input type="submit" name="merge" value="Merge" /></fieldset>
</div>
</form>
[% END %]
[% END %]
[% END %]
</div>
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]