Lines 3-11
Link Here
|
3 |
[% USE Koha %] |
3 |
[% USE Koha %] |
4 |
[% USE KohaPlugins %] |
4 |
[% USE KohaPlugins %] |
5 |
[% USE To %] |
5 |
[% USE To %] |
6 |
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %] |
6 |
[% SET LoginEnabled = ( Koha.Preference('opacuserlogin') == 1 ) %] |
7 |
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %] |
7 |
[% IF ( Koha.Preference('TagsEnabled') ) %] |
8 |
[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %] |
8 |
[% SET TagsShowEnabled = ( ( Koha.Preference('TagsEnabled') == 1 ) && ( Koha.Preference('TagsShowOnList') > 0 ) ) %] |
|
|
9 |
[% SET TagsInputEnabled = LoginEnabled && TagsShowEnabled && ( Koha.Preference('TagsInputOnList') > 0 ) %] |
10 |
[% END %] |
11 |
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %] |
12 |
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %] |
13 |
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %] |
14 |
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled %] |
15 |
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %] |
16 |
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %] |
9 |
|
17 |
|
10 |
[% IF firstPage %] |
18 |
[% IF firstPage %] |
11 |
[% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %] |
19 |
[% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %] |
Lines 192-285
Link Here
|
192 |
[% END # /UNLESS tag %] |
200 |
[% END # /UNLESS tag %] |
193 |
</div> <!-- / #toolbar --> |
201 |
</div> <!-- / #toolbar --> |
194 |
|
202 |
|
195 |
<div class="selections-toolbar toolbar noprint"> |
203 |
[% INCLUDE 'result-batch-controls.inc' results=1 %] |
196 |
[% IF ( OpacHighlightedWords ) %] |
|
|
197 |
<div class="highlight_controls noprint"> |
198 |
<a href="#" class="btn btn-link btn-sm highlight_toggle" id="highlight_toggle_off"><i class="fa-fw fa-solid fa-pencil" aria-hidden="true"></i> Unhighlight</a> |
199 |
<a href="#" class="btn btn-link btn-sm highlight_toggle" id="highlight_toggle_on"><i class="fa-fw fa-solid fa-pencil" aria-hidden="true"></i> Highlight</a> |
200 |
</div> |
201 |
[% END %] |
202 |
|
203 |
<div class="check_control"> |
204 |
<!-- checkall, clearall are now needed for placehold --> |
205 |
<span class="clearall"> |
206 |
<a id="CheckAll" class="btn btn-link btn-sm" href="#">Select all</a> |
207 |
</span> |
208 |
<span class="checkall"> |
209 |
<a id="CheckNone" class="btn btn-link btn-sm" href="#">Clear all</a> |
210 |
</span> |
211 |
</div> |
212 |
|
213 |
<div class="links"> |
214 |
[% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'opacuserlogin' ) == 1 && Koha.Preference('virtualshelves') ) || loggedinusername ) %] |
215 |
<span class="selections">Select titles to:</span> |
216 |
[% END %] |
217 |
[% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'opacuserlogin' ) == 1 && Koha.Preference('virtualshelves') ) ) %] |
218 |
<span class="addto"> |
219 |
<select class="disabled form-control form-control-sm" name="addto" id="addto"> |
220 |
<option>Add to...</option> |
221 |
[% IF Koha.Preference( 'opacbookbag' ) == 1 %] |
222 |
<option value="addtocart">Cart</option> |
223 |
[% END %] |
224 |
[% IF Koha.Preference('virtualshelves') && Koha.Preference('opacuserlogin') == 1 %] |
225 |
[% IF loggedinusername AND add_to_some_private_shelves.count %] |
226 |
<optgroup label="Your lists:"> |
227 |
[% SET number_of_private_shelves = 0 %] |
228 |
[% FOREACH s IN add_to_some_private_shelves %] |
229 |
[% IF shelfnumber != s.shelfnumber %] |
230 |
<option id="s[% s.shelfnumber | html %]" value="addtolist">[% s.shelfname | html %]</option> |
231 |
[% SET number_of_private_shelves = number_of_private_shelves + 1 %] |
232 |
[% IF number_of_private_shelves == 10 %][% LAST %][% END %] |
233 |
[% END %] |
234 |
[% END %] |
235 |
</optgroup> |
236 |
[% END %] |
237 |
[% IF add_to_some_public_shelves.count %] |
238 |
<optgroup label="Public lists:"> |
239 |
[% SET number_of_public_shelves = 0 %] |
240 |
[% FOREACH s IN add_to_some_public_shelves %] |
241 |
[% IF shelfnumber != s.shelfnumber %] |
242 |
<option id="s[% s.shelfnumber | html %]" value="addtolist">[% s.shelfname | html %]</option> |
243 |
[% SET number_of_public_shelves = number_of_public_shelves + 1 %] |
244 |
[% IF number_of_public_shelves == 10 %][% LAST %][% END %] |
245 |
[% END %] |
246 |
[% END %] |
247 |
</optgroup> |
248 |
[% END %] |
249 |
[% IF ( add_to_some_private_shelves and add_to_some_private_shelves.count > 10 ) or ( add_to_some_public_shelves and add_to_some_public_shelves.count > 10 ) %] |
250 |
<option value="morelists">[ More lists ]</option> |
251 |
[% END %] |
252 |
<option value="newlist">[ New list ]</option> |
253 |
[% END # /IF virtualshelves and opacuserlogin %] |
254 |
</select> |
255 |
<input type="submit" class="btn btn-sm btn-primary" value="Save" /> |
256 |
</span> |
257 |
[% END # /IF opacbookbag || virtualshelves %] |
258 |
|
259 |
[% IF ( ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) && ( Koha.Preference( 'opacuserlogin' ) == 1 ) && DisplayMultiPlaceHold ) %] |
260 |
<button class="btn btn-link btn-sm hold disabled" type="button"> |
261 |
<i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold |
262 |
</button> |
263 |
[% END %] |
264 |
|
265 |
[% IF ( TagsInputEnabled && loggedinusername ) %] |
266 |
<span id="tagsel_span"> |
267 |
<button id="tagsel_tag" class="btn btn-link btn-sm disabled" type="submit" style="display:none"><i class="fa fa-fw fa-tag" aria-hidden="true"></i> Tag</button> |
268 |
</span> |
269 |
[% END %] |
270 |
</div> <!-- / .links --> |
271 |
[% IF ( TagsInputEnabled && loggedinusername ) %] |
272 |
<div id="tagsel_form" style="display:none"> |
273 |
<label for="tagsel_new">New tag:</label> |
274 |
<input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" /> |
275 |
<input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-sm btn-primary" title="Add" type="submit" value="Add" /> |
276 |
<a href="#" id="tagsel_cancel">(done)</a> |
277 |
</div> |
278 |
<div id="tagsel_status" class="tagsel_tatus" style="display:none;"> |
279 |
Tag status here. |
280 |
</div> |
281 |
[% END %] |
282 |
</div> <!-- / .selections-toolbar --> |
283 |
</div> <!-- /#floating --> |
204 |
</div> <!-- /#floating --> |
284 |
|
205 |
|
285 |
<!-- TABLE RESULTS START --> |
206 |
<!-- TABLE RESULTS START --> |
Lines 531-537
Link Here
|
531 |
</form> <!-- / #bookbag_form --> |
452 |
</form> <!-- / #bookbag_form --> |
532 |
|
453 |
|
533 |
<form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl"> |
454 |
<form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl"> |
534 |
<legend class="sr-only">Pages</legend> |
|
|
535 |
<!-- The value will be set by holdBiblioNums() in basket.js --> |
455 |
<!-- The value will be set by holdBiblioNums() in basket.js --> |
536 |
<input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/> |
456 |
<input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/> |
537 |
</form> |
457 |
</form> |
Lines 581-671
Link Here
|
581 |
[% END %] |
501 |
[% END %] |
582 |
[% CoverImagePlugins | $raw %] |
502 |
[% CoverImagePlugins | $raw %] |
583 |
<script> |
503 |
<script> |
584 |
[% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) %] |
504 |
const loggedinusername = [% ( loggedinusername ) ? 1 : 0 | html %]; |
585 |
function holdMultiple() { |
505 |
const opacbookbag = [% ( opacbookbag ) ? 1 : 0 | html %]; |
586 |
var checkedBiblioNums = ""; // Separated by "/" |
506 |
const virtualshelves = [% ( virtualshelves ) ? 1 : 0 | html %]; |
587 |
var checkedCount = 0; |
507 |
</script> |
588 |
if(document.bookbag_form.biblionumber.length > 0) { |
508 |
[% Asset.js("js/results-list.js") | $raw %] |
589 |
for (var i=0; i < document.bookbag_form.biblionumber.length; i++) { |
509 |
<script> |
590 |
if (document.bookbag_form.biblionumber[i].checked) { |
|
|
591 |
checkedBiblioNums += (document.bookbag_form.biblionumber[i].value + "/"); |
592 |
checkedCount++; |
593 |
} |
594 |
} |
595 |
} |
596 |
|
597 |
if (checkedCount > 0) { |
598 |
holdBiblioNums(checkedBiblioNums); |
599 |
} else { |
600 |
alert( _("No item was selected") ); |
601 |
} |
602 |
} |
603 |
|
604 |
function holdBiblioNums(numList) { |
605 |
// numList: biblio numbers separated by "/" |
606 |
$("#hold_form_biblios").attr("value", numList); |
607 |
$("#hold_form").submit(); |
608 |
} |
609 |
[% END # /IF opacuserlogin && OPACHoldRequests %] |
610 |
|
611 |
[% IF ( TagsInputEnabled && loggedinusername ) %] |
612 |
function tagSelected() { |
613 |
var checkedBoxes = $(".searchresults :checkbox:checked"); |
614 |
if ($(checkedBoxes).size() == 0) { |
615 |
alert( _("No item was selected") ); |
616 |
} else { |
617 |
$("#tagsel_tag").hide(); |
618 |
$(".resort").hide(); |
619 |
$("#tagsel_form").show(); |
620 |
} |
621 |
} |
622 |
|
623 |
function tagCanceled() { |
624 |
$("#tagsel_form").hide(); |
625 |
$("#tagsel_tag").show(); |
626 |
$(".resort").show(); |
627 |
$("#tagsel_new").val(""); |
628 |
$("#tagsel_status, .tagstatus").empty().hide(); |
629 |
} |
630 |
|
631 |
function tagAdded() { |
632 |
var checkedBoxes = $(".searchresults :checkbox:checked"); |
633 |
if ($(checkedBoxes).size() == 0) { |
634 |
alert( _("No item was selected") ); |
635 |
return false; |
636 |
} |
637 |
|
638 |
var tag = $("#tagsel_new").val(); |
639 |
if (!tag || (tag == "")) { |
640 |
alert( _("No tag was specified.") ); |
641 |
return false; |
642 |
} |
643 |
|
644 |
var bibs = []; |
645 |
for (var i = 0; i < $(checkedBoxes).size(); i++) { |
646 |
var box = $(checkedBoxes).get(i); |
647 |
bibs[i] = $(box).val(); |
648 |
} |
649 |
|
650 |
KOHA.Tags.add_multitags_button(bibs, tag); |
651 |
return false; |
652 |
} |
653 |
[% END # /IF TagsInputEnabled && loggedinusername %] |
654 |
|
655 |
|
656 |
function enableCheckboxActions(){ |
657 |
// Enable/disable controls if checkboxes are checked |
658 |
var checkedBoxes = $(".cb:checked"); |
659 |
var controls = $(".selections-toolbar .links a, .selections-toolbar .links input, .selections-toolbar .links select, .selections-toolbar .links label, .selections-toolbar .links button"); |
660 |
if ($(checkedBoxes).size()) { |
661 |
$(".selections").html(_("With selected titles: ")); |
662 |
$(controls).removeClass("disabled"); |
663 |
} else { |
664 |
$(".selections").html(_("Select titles to: ")); |
665 |
$(controls).addClass("disabled"); |
666 |
} |
667 |
} |
668 |
|
669 |
[% IF ( OpacHighlightedWords ) %] |
510 |
[% IF ( OpacHighlightedWords ) %] |
670 |
var q_array = new Array(); // holds search terms if available |
511 |
var q_array = new Array(); // holds search terms if available |
671 |
|
512 |
|
Lines 704-714
Link Here
|
704 |
}); |
545 |
}); |
705 |
[% END %] |
546 |
[% END %] |
706 |
|
547 |
|
707 |
$(".cb").click(function(){ |
|
|
708 |
enableCheckboxActions(); |
709 |
}); |
710 |
enableCheckboxActions(); |
711 |
|
712 |
$(".br-readonly a").on("click", function(e){ |
548 |
$(".br-readonly a").on("click", function(e){ |
713 |
e.preventDefault(); |
549 |
e.preventDefault(); |
714 |
}); |
550 |
}); |
Lines 721-790
Link Here
|
721 |
$('#bookbag_form').submit(); |
557 |
$('#bookbag_form').submit(); |
722 |
}); |
558 |
}); |
723 |
|
559 |
|
724 |
[% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %] |
|
|
725 |
[% IF Koha.Preference( 'virtualshelves' ) == 1 %] |
726 |
$("#addto").on("change",function(){ |
727 |
cartList(); |
728 |
}); |
729 |
$(".addto").find("input:submit").click(function(){ |
730 |
cartList(); |
731 |
return false; |
732 |
}); |
733 |
[% ELSE %] |
734 |
$("#addto").on("click",function(){ |
735 |
cartList(); |
736 |
return false; |
737 |
}); |
738 |
[% END %] |
739 |
[% END %] |
740 |
|
741 |
function cartList(){ |
742 |
addtoOption = $("#addto").find("option:selected"); |
743 |
addtoval = addtoOption.val(); |
744 |
if(addtoval == "addtolist"){ |
745 |
var shelfnumber = addtoOption.attr("id").replace("s",""); |
746 |
if (vShelfAdd()) { |
747 |
Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd()); |
748 |
} |
749 |
return false; |
750 |
} else if(addtoval == "newlist"){ |
751 |
[% IF ( loggedinusername ) %]if (vShelfAdd()) { |
752 |
Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd()); |
753 |
}[% ELSE %] |
754 |
alert(_("You must be logged in to create or add to lists")); |
755 |
[% END %] |
756 |
return false; |
757 |
} else if(addtoval == "morelists"){ |
758 |
[% IF ( loggedinusername ) %] |
759 |
if (vShelfAdd()) { |
760 |
Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd()); |
761 |
} |
762 |
[% ELSE %] |
763 |
alert(_("You must be logged in to create or add to lists")); |
764 |
[% END %] |
765 |
return false; |
766 |
} |
767 |
if(addtoval == "addtocart" || $("#addto").attr("class") == "addtocart"){ |
768 |
addMultiple(); |
769 |
return false; |
770 |
} |
771 |
} |
772 |
$("#CheckAll").on("click",function(e){ |
773 |
e.preventDefault(); |
774 |
$(".cb").prop("checked", true); |
775 |
enableCheckboxActions(); |
776 |
}); |
777 |
$("#CheckNone").on("click",function(e){ |
778 |
e.preventDefault(); |
779 |
$(".cb").prop("checked", false); |
780 |
enableCheckboxActions(); |
781 |
}); |
782 |
|
783 |
$(".hold").on("click", function(e){ |
784 |
e.preventDefault(); |
785 |
holdMultiple(); |
786 |
}); |
787 |
|
788 |
[% IF ( query_desc ) %] |
560 |
[% IF ( query_desc ) %] |
789 |
[% IF ( OpacHighlightedWords ) %] |
561 |
[% IF ( OpacHighlightedWords ) %] |
790 |
q_array = query_desc.split(" "); |
562 |
q_array = query_desc.split(" "); |
Lines 842-891
Link Here
|
842 |
[% END # /IF OpenLibrarySearch %] |
614 |
[% END # /IF OpenLibrarySearch %] |
843 |
[% END # /IF query_desc %] |
615 |
[% END # /IF query_desc %] |
844 |
|
616 |
|
845 |
[% IF ( TagsInputEnabled && loggedinusername ) %] |
|
|
846 |
$("#tagsel_tag").show().click(function(){ |
847 |
tagSelected(); |
848 |
return false; |
849 |
}); |
850 |
$("#tagsel_cancel").click(function(){ |
851 |
tagCanceled(); |
852 |
return false; |
853 |
}); |
854 |
$("#tagsel_button").click(function(){ |
855 |
tagAdded(); |
856 |
return false; |
857 |
}); |
858 |
|
859 |
$(".tag_add").click(function(){ |
860 |
var thisid = $(this).attr("id"); |
861 |
thisid = thisid.replace("tag_add",""); |
862 |
$(this).addClass("hidden"); |
863 |
$("#tagform"+thisid).show(); |
864 |
$("#newtag"+thisid).focus(); |
865 |
$("#newtag"+thisid+"_status").empty().hide(); |
866 |
return false; |
867 |
}); |
868 |
$(".cancel_tag_add").click(function(){ |
869 |
var thisid = $(this).attr("id"); |
870 |
thisid = thisid.replace("cancel",""); |
871 |
$("#tagform"+thisid).hide(); |
872 |
$("#tag_add"+thisid).removeClass("hidden"); |
873 |
$("#newtag"+thisid).val(""); |
874 |
$("#newtag"+thisid+"_status").empty().hide(); |
875 |
return false; |
876 |
}); |
877 |
$(".tagbutton").click(function(){ |
878 |
var thisid = $(this).attr("title"); |
879 |
var tag = $("#newtag"+thisid).val(); |
880 |
if (!tag || (tag == "")) { |
881 |
alert( _("No tag was specified.") ); |
882 |
return false; |
883 |
} |
884 |
KOHA.Tags.add_tag_button(thisid, tag); |
885 |
return false; |
886 |
}); |
887 |
[% END # /IF TagsInputEnabled && loggedinusername %] |
888 |
|
889 |
[% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %] |
617 |
[% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %] |
890 |
[% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %] |
618 |
[% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %] |
891 |
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %] |
619 |
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %] |
Lines 903-915
Link Here
|
903 |
$("input.newtag").on('keydown', function(e){ |
631 |
$("input.newtag").on('keydown', function(e){ |
904 |
if (e.keyCode == 13) { e.preventDefault(); } |
632 |
if (e.keyCode == 13) { e.preventDefault(); } |
905 |
}); |
633 |
}); |
906 |
|
|
|
907 |
Sticky = $("#floating"); |
908 |
Sticky.hcSticky({ |
909 |
stickTo: ".searchresults", |
910 |
stickyClass: "floating" |
911 |
}); |
912 |
|
913 |
}); |
634 |
}); |
914 |
</script> |
635 |
</script> |
915 |
[% END %] |
636 |
[% END %] |