X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=koha-tmpl%2Fopac-tmpl%2Fprog%2Fen%2Fmodules%2Fopac-results.tt;h=30682c4bb5a67ababe5bebb06840909fdd3425d0;hb=6f2949f272fb38267b85da610f6a61b97b7ce649;hp=c76f162a9d644546f997c98da5cb8e021fec8b59;hpb=65be03846d064dd6d9e7159550a269a352054b65;p=koha.git diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt index c76f162a9d..30682c4bb5 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -1,3 +1,6 @@ +[% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnList ) %] +[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %] + [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › [% IF ( searchdesc ) %] @@ -6,7 +9,7 @@ You did not specify any search criteria. [% END %] [% INCLUDE 'doc-head-close.inc' %] - + [% IF ( OpacStarRatings == 'all' ) %] [% END %] @@ -38,9 +41,9 @@ function holdBiblioNums(numList) { // numList: biblio numbers separated by "/" $("#hold_form_biblios").attr("value", numList); $("#hold_form").submit(); -}[% END %] +}[% END %][% END %] -[% IF ( TagsEnabled ) %] +[% IF ( TagsInputEnabled && loggedinusername ) %] function tagSelected() { var checkedBoxes = $(".searchresults :checkbox:checked"); if ($(checkedBoxes).size() == 0) { @@ -56,6 +59,8 @@ function tagCanceled() { $("#tagsel_form").hide(); $("#tagsel_tag").show(); $("#sort_by").show(); + $("#tagsel_new").val(""); + $("#tagsel_status, .tagstatus").empty().hide(); } function tagAdded() { @@ -67,6 +72,7 @@ function tagAdded() { var tag = $("#tagsel_new").val(); if (!tag || (tag == "")) { + alert(MSG_NO_TAG_SPECIFIED); return false; } @@ -78,7 +84,7 @@ function tagAdded() { KOHA.Tags.add_multitags_button(bibs, tag); return false; -}[% END %][% END %] +}[% END %] [% IF ( OpacHighlightedWords ) %] var q_array = new Array(); // holds search terms if available @@ -103,6 +109,39 @@ $(document).ready(function(){ }); [% END %] + [% IF ( IDreamBooksResults ) %] + $('.idbresult').each(function() { + var isbn = $(this).children('a').text().replace(/\s*/,''); + var element = this; + + if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) { + // Use Microsoft XDR for IE version 8 or above + var xdr = new XDomainRequest(); + xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e"); + xdr.onload = function() { + json = 'json = '+xdr.responseText; // the string now looks like.. json = { ... }; + eval(json); // json is now a regular JSON object + if(json.total_results > 0 && json.book.rating > 0){ + $(element).children('a').html(""+json.book.title+" by "+json.book.author+""+json.book.rating+"%"); + $(element).show(); + } else { + $(element).remove(); + } + } + xdr.send(); + } else { + $.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){ + if(json.total_results > 0 && json.book.rating > 0){ + $(element).children('a').html(""+json.book.title+" by "+json.book.author+""+json.book.rating+"%"); + $(element).show(); + } else { + $(element).remove(); + } + }); + } + }); + [% END %] + [% IF ( opacbookbag ) %]$(".addtocart").show();[% END %] [% IF ( opacbookbag ) %] @@ -123,7 +162,7 @@ $(document).ready(function(){ [% END %] param1 += "<\/select> "; [% ELSE %] - var param1 = "Add to cart<\/a>"; + var param1 = "" + _("Add to cart") + "<\/a>"; [% END %] [% ELSE %] var param1 = "
[% IF ( DidYouMean ) %] - +
Not what you expected? Check for suggestions
[% END %] - [% INCLUDE 'page-numbers.inc' %]
+
[% INCLUDE 'page-numbers.inc' %]
[% IF ( koha_spsuggest ) %] Did you mean:
@@ -441,10 +478,12 @@ $(document).ready(function(){ [% END %] [% END %] - [% IF ( SEARCH_RESULT.AuthorisedValueImages ) %] + [% IF ( AuthorisedValueImages ) %] [% FOREACH authorised_value_image IN SEARCH_RESULT.authorised_value_images %] - [% authorised_value_image.label %] + [% IF ( authorised_value_image.imageurl ) %] + [% authorised_value_image.label %] + [% END %] [% END %] [% END %] @@ -542,18 +581,15 @@ $(document).ready(function(){ [% END %] [% IF ( LibraryThingForLibrariesID ) %]
[% END %] - [% IF ( opacuserlogin ) %][% IF ( TagsEnabled ) %] - [% IF ( TagsShowOnList ) %] + [% IF ( TagsShowEnabled ) %] [% IF ( SEARCH_RESULT.TagLoop.size ) %]
Tags: - [% END %] - [% IF ( SEARCH_RESULT.TagLoop.size ) %] -
[% END %] +
[% END %] - [% END %][% END %] + [% END %] [% IF ( SEARCH_RESULT.searchhighlightblob ) %]Match: [% SEARCH_RESULT.searchhighlightblob %][% END %] @@ -598,14 +634,18 @@ $(document).ready(function(){ [% END %] [% END %] - [% IF ( TagsInputOnList ) %] + [% IF ( TagsInputEnabled ) %] [% IF ( loggedinusername ) %] - Add tag - - Cancel + Add tag + + Tag status here. + [% ELSIF ( loop.first ) %]Log in to add tags. [% END %] [% END %] @@ -643,6 +683,14 @@ $(document).ready(function(){ [% IF OpenLibraryCovers %][% IF SEARCH_RESULT.normalized_isbn %][% ELSE %]No cover image available[% END %][% END %] [% IF ( BakerTaylorEnabled ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]See Baker & Taylor[% ELSE %]No cover image available[% END %][% END %] + [% IF ( IDreamBooksResults ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %] + [% END %][% END %] [% END %] @@ -654,7 +702,7 @@ $(document).ready(function(){ [% END %] - [% INCLUDE 'page-numbers.inc' %] +
[% INCLUDE 'page-numbers.inc' %]
[% ELSE %] [% END %]