Bug 16812: Revise JS script for z3950_search.tts and remove onclick events
Modify JS script to all templates for z3950_search.tt and reduce the redundant code This patch propose: -z3950_auth_search.tt has various onclick events used in links. Also fix: acqui/z3950_search.tt and cataloguing/z3950_search.tt -Trigger onclick events via JQuery .on() -Make a separate .js and .inc file -Reduce the number of line and redundant code -Also add Font Awesome Icons to "Select/Clear all" and "Clear search form" links To test: 1-Apply bug 16600 on top 2-Apply patch 3-Go to Authorities > click New from Z39.50 4-Fill some fields and click in "Clear search form" link 5-Search under "Dalton" or another author that launch too many headings 6-Clic in some heading and notice the dialog open, test: "Preview MARC", ISBD (when showed), "Import" and close the dialog "X". Use the "Import" from table too. 7-Use the "next/previous page" button, change "Go to page" to number in and out of the range presented, also test whit a letter, etc. Go to Cataloging > New from Z39.50/SRU Repeat steps 3 to 6. But this time with bib records. Go to Adquisition > Open or Create a basket and choose to "Add to basket" button. A modal appear, chose the option "Order from external source" Repeat steps 3 to 6. But this thime with bib records. NOTE: The icon trash for "Clear search form" has been selected according with module "Advanced search" there is an icon trash with link "Clear fields" that has the same fuctionality. For some reason the image loading-small.gif does not charge all times when the code is get out of the template. (Fixed with this new patch) DataTable it is specific for each template Sponsored-by: Universidad de El Salvador Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
3fe6abc9d5
commit
f240a91640
5 changed files with 158 additions and 186 deletions
28
koha-tmpl/intranet-tmpl/prog/en/includes/z3950_search.inc
Normal file
28
koha-tmpl/intranet-tmpl/prog/en/includes/z3950_search.inc
Normal file
|
@ -0,0 +1,28 @@
|
|||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
var MSG_CHOOSE_Z3950 = _("Please choose at least one external target");
|
||||
|
||||
[% IF ( total_pages ) %]
|
||||
var interface = "[% interface %]";
|
||||
var theme = "[% theme %]";
|
||||
var MSG_LOADING = _("Loading");
|
||||
|
||||
function validate_goto_page(){
|
||||
var page = $('#goto_page').val();
|
||||
if(isNaN(page)) {
|
||||
alert(_("The page entered is not a number."));
|
||||
return false;
|
||||
}
|
||||
else if(page < 1 || page > [% total_pages %] ) {
|
||||
alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
[% END %]
|
||||
|
||||
//]]>
|
||||
</script>
|
|
@ -17,25 +17,6 @@
|
|||
"aaSorting": [[ 1, "asc" ]],
|
||||
"bPaginate": false
|
||||
} ) );
|
||||
|
||||
$("#CheckAll").click(function(){
|
||||
$(".checkboxed").checkCheckboxes();
|
||||
return false;
|
||||
});
|
||||
$("#CheckNone").click(function(){
|
||||
$(".checkboxed").unCheckCheckboxes();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#closemenu").click(function(e){
|
||||
$(".linktools").hide();
|
||||
$("tr").removeClass("selected");
|
||||
});
|
||||
$("#resetZ3950Search").click(function(e) {
|
||||
e.preventDefault();
|
||||
$("form[name='f']").find("input[type=text]").val("");
|
||||
});
|
||||
|
||||
/* Inline edit/delete links */
|
||||
$("td").click(function(event){
|
||||
var $tgt = $(event.target);
|
||||
|
@ -52,39 +33,13 @@
|
|||
$(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
|
||||
}
|
||||
});
|
||||
$(".previewData").on("click", function(e){
|
||||
e.preventDefault();
|
||||
var ltitle = $(this).text();
|
||||
var page = $(this).attr("href");
|
||||
$("#dataPreviewLabel").text(ltitle);
|
||||
$("#dataPreview .modal-body").load(page + " div");
|
||||
$('#dataPreview').modal({show:true});
|
||||
});
|
||||
$("#dataPreview").on("hidden", function(){
|
||||
$("#dataPreviewLabel").html("");
|
||||
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
|
||||
});
|
||||
});
|
||||
|
||||
[% IF ( total_pages ) %]
|
||||
function validate_goto_page(){
|
||||
var page = $('#goto_page').val();
|
||||
if(isNaN(page)) {
|
||||
alert(_("The page entered is not a number."));
|
||||
return false;
|
||||
}
|
||||
else if(page < 1 || page > [% total_pages %] ) {
|
||||
alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
[% END %]
|
||||
});
|
||||
|
||||
//]]>
|
||||
</script>
|
||||
[% INCLUDE 'z3950_search.inc' %]
|
||||
<script type="text/javascript" src="[% interface %]/[% theme %]/js/z3950_search.js"></script>
|
||||
<style type="text/css">
|
||||
.linktools { background-color:#FFF;border-top:1px solid #DDD; border-left: 1px solid #DDD; border-right: 1px solid #666; border-bottom:1px solid #666;display: none; white-space: nowrap;}
|
||||
.linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
|
||||
|
@ -128,15 +83,15 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
[% END %]
|
||||
</select>
|
||||
</li>
|
||||
<li><a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a></li>
|
||||
</ol>
|
||||
<p><a id="resetZ3950Search" href="#">Clear search form</a></p>
|
||||
</fieldset>
|
||||
<input type="hidden" name="biblionumber" value="[% biblionumber %]" />
|
||||
<input type="hidden" name="basketno" value="[% basketno %]" />
|
||||
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
|
||||
</div>
|
||||
<div class="yui-u second">
|
||||
<h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#">Select all</a></span><span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></span></h2>
|
||||
<h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></span></h2>
|
||||
<div id="z3950_search_targets_acq">
|
||||
[% FOREACH serverloo IN serverloop %]
|
||||
<p>
|
||||
|
@ -153,7 +108,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a></fieldset>
|
||||
<fieldset class="action"><input type="submit" class="submit" value="Search" /> <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a></fieldset>
|
||||
</form>
|
||||
|
||||
|
||||
|
@ -233,13 +188,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
[% END %]
|
||||
|
||||
[% IF ( show_prevbutton ) %]
|
||||
<input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
|
||||
<input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page %]" />
|
||||
[% END %]
|
||||
Page [% current_page %] / [% total_pages %]
|
||||
[% IF ( show_nextbutton ) %]
|
||||
<input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
|
||||
<input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page %]" />
|
||||
[% END %]
|
||||
<br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" />
|
||||
<br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" value="Go" />
|
||||
</form>
|
||||
|
||||
[% ELSE %]
|
||||
|
|
|
@ -6,26 +6,9 @@
|
|||
[% INCLUDE 'datatables.inc' %]
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function Import(Breeding,AuthType,authid) {
|
||||
opener.document.location="../authorities/authorities.pl?breedingid="+Breeding+"&authtypecode="+AuthType+"&authid="+authid;
|
||||
window.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
function closemenu(){
|
||||
$(".linktools").hide();
|
||||
$("tr").removeClass("selected");
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#CheckAll").click(function(){
|
||||
$(".checkboxed").checkCheckboxes();
|
||||
return false;
|
||||
});
|
||||
$("#CheckNone").click(function(){
|
||||
$(".checkboxed").unCheckCheckboxes();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
|
||||
"sDom": 't',
|
||||
"aoColumnDefs": [
|
||||
|
@ -50,50 +33,13 @@ $(document).ready(function(){
|
|||
$(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
|
||||
}
|
||||
});
|
||||
$("form[name='f']").submit(function(){
|
||||
if ($('input[type=checkbox]').filter(':checked').length == 0) {
|
||||
alert(_("Please choose at least one Z39.50 target"));
|
||||
return false;
|
||||
} else
|
||||
return true;
|
||||
});
|
||||
$("#resetZ3950Search").click(function(e) {
|
||||
e.preventDefault();
|
||||
$("form[name='f']").find("input[type=text]").val("");
|
||||
});
|
||||
$(".previewMARC").on("click", function(e){
|
||||
e.preventDefault();
|
||||
var ltitle = $(this).text();
|
||||
var page = $(this).attr("href");
|
||||
$("#marcPreviewLabel").text(ltitle);
|
||||
$("#marcPreview .modal-body").load(page + " pre");
|
||||
$('#marcPreview').modal({show:true});
|
||||
});
|
||||
$("#marcPreview").on("hidden", function(){
|
||||
$("#marcPreviewLabel").html("");
|
||||
$("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
|
||||
});
|
||||
});
|
||||
|
||||
[% IF ( total_pages ) %]
|
||||
function validate_goto_page(){
|
||||
var page = $('#goto_page').val();
|
||||
if(isNaN(page)) {
|
||||
alert(_("The page entered is not a number."));
|
||||
return false;
|
||||
}
|
||||
else if(page < 1 || page > [% total_pages %] ) {
|
||||
alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
[% END %]
|
||||
});
|
||||
|
||||
//]]>
|
||||
</script>
|
||||
[% INCLUDE 'z3950_search.inc' %]
|
||||
<script type="text/javascript" src="[% interface %]/[% theme %]/js/z3950_search.js"></script>
|
||||
<style type="text/css">
|
||||
.linktools { background-color:#FFF;border-top:1px solid #DDD; border-left: 1px solid #DDD; border-right: 1px solid #666; border-bottom:1px solid #666;display: none; white-space: nowrap;}
|
||||
.linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
|
||||
|
@ -139,12 +85,12 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
<li><label for="subjectsubdiv">Subject sub-division: </label> <input type="text" id="subjectsubdiv" name="subjectsubdiv" value="" /></li>
|
||||
<li><label for="title">Title (any): </label> <input type="text" id="title" name="title" value="[% title | html %]" /></li>
|
||||
<li><label for="uniformtitle">Title (uniform): </label> <input type="text" id="uniformtitle" name="uniformtitle" value="[% uniformtitle | html %]" /></li>
|
||||
<li><a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a></li>
|
||||
</ol>
|
||||
<p><a id="resetZ3950Search" href="#">Clear search form</a></p>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="yui-g">
|
||||
<h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#">Select all</a></span><span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></span></h2>
|
||||
<h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></span></h2>
|
||||
<div id="z3950_search_targets_auth">
|
||||
[% FOREACH serverloo IN serverloop %]
|
||||
<p>
|
||||
|
@ -158,7 +104,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
[% END %]
|
||||
</div>
|
||||
</div>
|
||||
<fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset>
|
||||
<fieldset class="action"><input type="submit" class="submit" value="Search"/> <a class="cancel close" href="#">Cancel</a></fieldset>
|
||||
</form>
|
||||
[% ELSE %]
|
||||
<h2>Results for Authority Records</h2>
|
||||
|
@ -174,11 +120,11 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
<tbody>[% FOREACH breeding_loo IN breeding_loop %]
|
||||
[% IF ( breeding_loo.breedingid ) %]
|
||||
<tr id="row[% breeding_loo.breedingid %]">
|
||||
<td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewMARC">Preview MARC</a> <a href="#" onclick="Import([% breeding_loo.breedingid %],'[% breeding_loo.heading_code %]','[% breeding_loo.authid %]'); return false">Import</a><a href="#" onclick="closemenu();return false;" title="Close this menu"> X </a></div> </td>
|
||||
<td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewMARC">Preview MARC</a> <a href="#" class="import_record" data-breedingid="[% breeding_loo.breedingid %]" data-heading_code="[% breeding_loo.heading_code %]" data-authid="[% breeding_loo.authid %]">Import</a><a href="#" id="close_menu" title="Close this menu"> X </a></div> </td>
|
||||
<td>[% breeding_loo.heading %]</td>
|
||||
<td>[% breeding_loo.heading_code %]</td>
|
||||
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewMARC">MARC</a></td>
|
||||
<td><a href="#" onclick="Import([% breeding_loo.breedingid %],'[% breeding_loo.heading_code %]','[% breeding_loo.authid %]'); return false">Import</a></td>
|
||||
<td><a href="#" class="import_record" data-breedingid="[% breeding_loo.breedingid %]" data-heading_code="[% breeding_loo.heading_code %]" data-authid="[% breeding_loo.authid %]">Import</a></td>
|
||||
</tr>
|
||||
[% END %]
|
||||
[% END %]</tbody>
|
||||
|
@ -215,13 +161,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
[% END %]
|
||||
|
||||
[% IF ( show_prevbutton ) %]
|
||||
<input type="button" name="changepage_prev" value="Previous page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
|
||||
<input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page %]" />
|
||||
[% END %]
|
||||
Page [% current_page %] / [% total_pages %]
|
||||
[% IF ( show_nextbutton ) %]
|
||||
<input type="button" name="changepage_next" value="Next page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
|
||||
<input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page %]" />
|
||||
[% END %]
|
||||
<br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" />
|
||||
<br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" value="Go" />
|
||||
</form>
|
||||
|
||||
<p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_auth_search.pl"><input type="hidden" name="authid" value="[% authid %]" /><input type="submit" value="Try another search"/></form></p>
|
||||
|
|
|
@ -6,26 +6,9 @@
|
|||
[% INCLUDE 'datatables.inc' %]
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function Import(GetThisOne,biblionumber) {
|
||||
opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+biblionumber+"&z3950=1&frameworkcode=[% frameworkcode %]&breedingid="+GetThisOne;
|
||||
window.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
function closemenu(){
|
||||
$(".linktools").hide();
|
||||
$("tr").removeClass("selected");
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#CheckAll").click(function(){
|
||||
$(".checkboxed").checkCheckboxes();
|
||||
return false;
|
||||
});
|
||||
$("#CheckNone").click(function(){
|
||||
$(".checkboxed").unCheckCheckboxes();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
|
||||
"sDom": 't',
|
||||
"aoColumnDefs": [
|
||||
|
@ -51,51 +34,13 @@ $(document).ready(function(){
|
|||
$(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
|
||||
}
|
||||
});
|
||||
$("form[name='f']").submit(function(){
|
||||
if ($('input[type=checkbox]').filter(':checked').length == 0) {
|
||||
alert(_("Please choose at least one external target"));
|
||||
return false;
|
||||
} else
|
||||
return true;
|
||||
});
|
||||
$("#resetZ3950Search").click(function(e) {
|
||||
e.preventDefault();
|
||||
$("form[name='f']").find("input[type=text]").val("");
|
||||
});
|
||||
$(".previewData").on("click", function(e){
|
||||
e.preventDefault();
|
||||
var ltitle = $(this).text();
|
||||
var page = $(this).attr("href");
|
||||
$("#dataPreviewLabel").text(ltitle);
|
||||
$("#dataPreview .modal-body").load(page + " div");
|
||||
$('#dataPreview').modal({show:true});
|
||||
});
|
||||
$("#dataPreview").on("hidden", function(){
|
||||
$("#dataPreviewLabel").html("");
|
||||
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
[% IF ( total_pages ) %]
|
||||
function validate_goto_page(){
|
||||
var page = $('#goto_page').val();
|
||||
if(isNaN(page)) {
|
||||
alert(_("The page entered is not a number."));
|
||||
return false;
|
||||
}
|
||||
else if(page < 1 || page > [% total_pages %] ) {
|
||||
alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
[% END %]
|
||||
|
||||
//]]>
|
||||
</script>
|
||||
[% INCLUDE 'z3950_search.inc' %]
|
||||
<script type="text/javascript" src="[% interface %]/[% theme %]/js/z3950_search.js"></script>
|
||||
<style type="text/css">
|
||||
.linktools { background-color:#FFF;border-top:1px solid #DDD; border-left: 1px solid #DDD; border-right: 1px solid #666; border-bottom:1px solid #666;display: none; white-space: nowrap;}
|
||||
.linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
|
||||
|
@ -135,13 +80,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
<li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
|
||||
<li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
|
||||
<li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li>
|
||||
<li><a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a></li>
|
||||
</ol>
|
||||
<p><a id="resetZ3950Search" href="#">Clear search form</a></p>
|
||||
<input type="hidden" name="biblionumber" value="[% biblionumber %]" />
|
||||
<input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
|
||||
</div>
|
||||
<div class="yui-g">
|
||||
<h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#">Select all</a></span><span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></span></h2>
|
||||
<h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></span></h2>
|
||||
<div id="z3950_search_targets">
|
||||
[% FOREACH serverloo IN serverloop %]
|
||||
<p>
|
||||
|
@ -156,7 +101,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
[% END %]
|
||||
</div>
|
||||
</div>
|
||||
<fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset>
|
||||
<fieldset class="action"><input type="submit" class="submit" value="Search" /> <a class="cancel close" href="#">Cancel</a></fieldset>
|
||||
</form>
|
||||
|
||||
|
||||
|
@ -206,7 +151,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
[% IF ( breeding_loo.breedingid ) %]
|
||||
|
||||
<tr id="row[% breeding_loo.breedingid %]">
|
||||
<td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewData">Preview MARC</a> <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid %]" class="previewData">Preview card</a> <a href="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a><a href="#" onclick="closemenu();return false;" title="Close this menu"> X </a></div> </td>
|
||||
<td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewData">Preview MARC</a> <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid %]" class="previewData">Preview card</a> <a href="#" class="import_record" data-breedingid="[% breeding_loo.breedingid %]" data-biblionumber="[% breeding_loo.biblionumber %]" data-frameworkcode="[% frameworkcode %]">Import</a><a href="#" id="close_menu" title="Close this menu"> X </a></div> </td>
|
||||
<td>[% breeding_loo.title |html %]</td>
|
||||
<td>[% breeding_loo.author %]</td>
|
||||
<td>[% breeding_loo.date %]</td>
|
||||
|
@ -215,7 +160,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
<td>[% breeding_loo.lccn %]</td>
|
||||
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewData">MARC</a></td>
|
||||
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid %]" class="previewData">Card</a></td>
|
||||
<td><a href="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a></td>
|
||||
<td><a href="#" class="import_record" data-breedingid="[% breeding_loo.breedingid %]" data-biblionumber="[% breeding_loo.biblionumber %]" data-frameworkcode="[% frameworkcode %]">Import</a></td>
|
||||
</tr>
|
||||
[% END %]
|
||||
[% END %]</tbody>
|
||||
|
@ -253,13 +198,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
[% END %]
|
||||
|
||||
[% IF ( show_prevbutton ) %]
|
||||
<input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
|
||||
<input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page %]" />
|
||||
[% END %]
|
||||
Page [% current_page %] / [% total_pages %]
|
||||
[% IF ( show_nextbutton ) %]
|
||||
<input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
|
||||
<input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page %]" />
|
||||
[% END %]
|
||||
<br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" />
|
||||
<br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" value="Go" />
|
||||
</form>
|
||||
|
||||
[% ELSE %]
|
||||
|
|
98
koha-tmpl/intranet-tmpl/prog/js/z3950_search.js
Normal file
98
koha-tmpl/intranet-tmpl/prog/js/z3950_search.js
Normal file
|
@ -0,0 +1,98 @@
|
|||
//z3950_search.js for Authorities, Bib records and Acquisitions module
|
||||
function Import(Breeding, recordid, AuthType, FrameworkCode) {
|
||||
|
||||
if ( AuthType == false ) {
|
||||
opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+recordid+"&z3950=1&frameworkcode="+FrameworkCode+"&breedingid="+Breeding;
|
||||
} else {
|
||||
opener.document.location="../authorities/authorities.pl?breedingid="+Breeding+"&authtypecode="+AuthType+"&authid="+recordid;
|
||||
}
|
||||
window.close();
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
$( document ).ready( function() {
|
||||
|
||||
$( "#CheckAll" ).click( function() {
|
||||
$( ".checkboxed" ).checkCheckboxes();
|
||||
return false;
|
||||
});
|
||||
$( "#CheckNone" ).click( function() {
|
||||
$( ".checkboxed" ).unCheckCheckboxes();
|
||||
return false;
|
||||
});
|
||||
$( "#close_menu" ).on( "click", function(e) {
|
||||
e.preventDefault();
|
||||
$( ".linktools" ).hide();
|
||||
$( "tr" ).removeClass( "selected" );
|
||||
return false;
|
||||
});
|
||||
$( ".submit" ).on( "click", function() {
|
||||
$( "body" ).css( "cursor", "wait" );
|
||||
});
|
||||
$( "[name='changepage_prev']" ).on( "click", function() {
|
||||
var data_current_page_prev = $( this ).data( "currentpage" );
|
||||
$( '#current_page' ).val( data_current_page_prev - 1 );
|
||||
$( '#page_form' ).submit();
|
||||
});
|
||||
$( "[name='changepage_next']" ).on( "click", function() {
|
||||
var data_current_page_next = $( this ).data( "currentpage" );
|
||||
$( '#current_page' ).val( data_current_page_next + 1 );
|
||||
$( '#page_form' ).submit();
|
||||
});
|
||||
$( "[name='changepage_goto']" ).on( "click", function() {
|
||||
return validate_goto_page();
|
||||
});
|
||||
$( "#resetZ3950Search" ).click( function(e) {
|
||||
e.preventDefault();
|
||||
$( "form[name='f']" ).find( "input[type=text]" ).val( "" );
|
||||
});
|
||||
$( "form[name='f']" ).submit( function() {
|
||||
if ( $( 'input[type=checkbox]' ).filter( ':checked' ).length == 0 ) {
|
||||
alert( MSG_CHOOSE_Z3950 );
|
||||
$( "body" ).css( "cursor", "default" );
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
$( ".previewMARC" ).on( "click", function(e) {
|
||||
e.preventDefault();
|
||||
var ltitle = $( this ).text();
|
||||
var page = $( this ).attr( "href" );
|
||||
$( "#marcPreviewLabel" ).text( ltitle );
|
||||
$( "#marcPreview .modal-body" ).load( page + " pre" );
|
||||
$( '#marcPreview' ).modal( {show:true} );
|
||||
});
|
||||
$( "#marcPreview" ).on( "hidden", function() {
|
||||
$( "#marcPreviewLabel" ).html( "" );
|
||||
$( "#marcPreview .modal-body" ).html( "<div id='loading'><img src='" + interface + "/" + theme + "/img/loading-small.gif' alt='' /> " + MSG_LOADING + "</div>" );
|
||||
});
|
||||
$( ".previewData" ).on( "click", function(e) {
|
||||
e.preventDefault();
|
||||
var ltitle = $( this ).text();
|
||||
var page = $( this ).attr( "href" );
|
||||
$( "#dataPreviewLabel" ).text( ltitle );
|
||||
$( "#dataPreview .modal-body" ).load( page + " div" );
|
||||
$( '#dataPreview' ).modal( {show:true} );
|
||||
});
|
||||
$( "#dataPreview" ).on( "hidden", function() {
|
||||
$( "#dataPreviewLabel" ).html( "" );
|
||||
$( "#dataPreview .modal-body" ).html( "<div id='loading'><img src='" + interface + "/" + theme + "/img/loading-small.gif' alt='' /> " + MSG_LOADING + "</div>" );
|
||||
});
|
||||
$( ".import_record" ).on( "click", function(e) {
|
||||
e.preventDefault();
|
||||
var data_breedingid = $( this ).data( "breedingid" );
|
||||
var data_headingcode = $( this ).data( "heading_code" );
|
||||
var data_authid = $( this ).data( "authid" );
|
||||
var data_biblionumber = $( this ).data( "biblionumber" );
|
||||
var data_frameworkcode = $( this ).data( "frameworkcode" );
|
||||
if ( data_headingcode == undefined ) {
|
||||
Import( data_breedingid, data_biblionumber, false , data_frameworkcode );
|
||||
} else {
|
||||
Import( data_breedingid, data_authid, data_headingcode );
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in a new issue