Koha/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt
Nick Clemens 3ea58cbe49 Bug 11905 - when editing item, cursor is positioning in search box and not to item
cataloging-search.inc had embedded js to set focus into the search box.
This patch removes that js from the cataloging-search.inc and adds it into
addbooks.tt and merge.tt to set focus on those pages and allow focus to be set
to the edit items form on additem.tt

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-30 11:57:31 -03:00

151 lines
5.7 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/cataloguing/merge_ajax.pl", {frameworkcode : "[% framework %]" }, function(json) {
tagslib = json;
//Set focus to cataloging search
$("input[name=q]:eq(0)").focus();
});
// Creating tabs
$("#tabs").tabs();
});
function changeFramework(fw) {
$("#Frameworks").val(fw);
}
//]]>
</script>
</head>
<body id="cat_merge" class="cat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cataloging-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</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 %]
[% 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/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script>
<p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">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/cataloguing/merge.pl" method="post">
<fieldset class="rows">
<legend>Merge reference</legend>
<ol>
<li class="radio"><input type="radio" value="[% biblio1 %]" 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/catalogue/showmarc.pl?id=[% biblio1 %]" title="MARC" rel="gb_page_center[600,500]">[% biblio1 %]</a>)</label></li>
<li class="radio"><input type="radio" value="[% biblio2 %]" id="mergereference2" name="mergereference" onclick="changeFramework('[% frameworkcode2 %]')" /><label for="mergereference2">[% title2 %] [% FOREACH subtitl2 IN subtitle2 %] [% subtitl2.subfield %][% END %] (<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblio2 %]" title="MARC" rel="gb_page_center[600,500]">[% biblio2 %]</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="biblionumber" value="[% biblio1 %]" />
<input type="hidden" name="biblionumber" value="[% biblio2 %]" />
<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/cataloguing/merge.pl" method="post" onsubmit="return mergeformsubmit()">
<div class="yui-g">
<div class="yui-u first">
[% PROCESS mergesource recordid1=biblio1 recordid2=biblio2 %]
</div>
<div class="yui-u">
[% PROCESS mergetarget %]
</div> <!-- .yui-u -->
<input type="hidden" name="biblio1" value="[% biblio1 %]" />
<input type="hidden" name="biblio2" value="[% biblio2 %]" />
<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' %]