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