|
Lines 638-721
Link Here
|
| 638 |
}); |
638 |
}); |
| 639 |
</script> |
639 |
</script> |
| 640 |
[% END #/print %] |
640 |
[% END #/print %] |
| 641 |
|
|
|
| 642 |
<script> |
641 |
<script> |
| 643 |
var MSG_NO_ITEM_SELECTED = _("Nothing is selected."); |
642 |
var MSG_NO_ITEM_SELECTED = _("Nothing is selected."); |
| 644 |
var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these records from the list?"); |
643 |
var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these records from the list?"); |
| 645 |
var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?"); |
644 |
var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?"); |
| 646 |
</script> |
645 |
</script> |
| 647 |
|
|
|
| 648 |
[% IF op == 'list' %] |
646 |
[% IF op == 'list' %] |
| 649 |
<script> |
647 |
<script> |
| 650 |
var public = [% public | html %]; |
648 |
var public = [% public | html %]; |
| 651 |
const allow_transfer = [% allow_transfer ? 1 : 0 | html %]; |
649 |
const allow_transfer = [% allow_transfer ? 1 : 0 | html %]; |
| 652 |
</script> |
650 |
</script> |
| 653 |
|
|
|
| 654 |
<script> |
651 |
<script> |
| 655 |
$(document).ready(function(){ |
652 |
$(document).ready(function () { |
| 656 |
|
653 |
let sorton = ["vs.shelfname", "count", "vs.public", "vs.owner", "vs.sortfield", "vs.created_on", "vs.lastmodified"]; |
| 657 |
let sorton = [ |
|
|
| 658 |
'vs.shelfname', |
| 659 |
'count', |
| 660 |
'vs.public', |
| 661 |
'vs.owner', |
| 662 |
'vs.sortfield', |
| 663 |
'vs.created_on', |
| 664 |
'vs.lastmodified', |
| 665 |
]; |
| 666 |
|
654 |
|
| 667 |
var dtListResults = $("#listresultst").kohaTable({ |
655 |
var dtListResults = $("#listresultst").kohaTable({ |
| 668 |
order: [[ 5, "asc" ]], |
656 |
order: [[5, "asc"]], |
| 669 |
serverSide: true, |
657 |
serverSide: true, |
| 670 |
ajax: { |
658 |
ajax: { |
| 671 |
url: "/cgi-bin/koha/svc/virtualshelves/search", |
659 |
url: "/cgi-bin/koha/svc/virtualshelves/search", |
| 672 |
data: function ( d ) { |
660 |
data: function (d) { |
| 673 |
let order_by = []; |
661 |
let order_by = []; |
| 674 |
d.order.forEach((o, i) => order_by.push(sorton[o.column - 1] + " " + o.dir)); |
662 |
d.order.forEach((o, i) => order_by.push(sorton[o.column - 1] + " " + o.dir)); |
| 675 |
return $.extend( {}, d, { |
663 |
return $.extend({}, d, { |
| 676 |
public, |
664 |
public, |
| 677 |
order_by: order_by.join(','), |
665 |
order_by: order_by.join(","), |
| 678 |
shelfname: $("#searchshelfname_filter").val(), |
666 |
shelfname: $("#searchshelfname_filter").val(), |
| 679 |
owner: $("#searchowner_filter").val(), |
667 |
owner: $("#searchowner_filter").val(), |
| 680 |
sortby: $("#searchsortby_filter").val(), |
668 |
sortby: $("#searchsortby_filter").val(), |
| 681 |
template_path: 'virtualshelves/tables/shelves_results.tt', |
669 |
template_path: "virtualshelves/tables/shelves_results.tt", |
| 682 |
allow_transfer, |
670 |
allow_transfer, |
| 683 |
}); |
671 |
}); |
| 684 |
} |
672 |
}, |
| 685 |
}, |
673 |
}, |
| 686 |
bKohaAjaxSVC: true, |
674 |
bKohaAjaxSVC: true, |
| 687 |
columns: [ |
675 |
columns: [ |
| 688 |
{ data: 'dt_public' }, |
676 |
{ data: "dt_public" }, |
| 689 |
{ data: 'dt_shelfname' }, |
677 |
{ data: "dt_shelfname" }, |
| 690 |
{ data: 'dt_count' }, |
678 |
{ data: "dt_count" }, |
| 691 |
{ data: 'dt_is_shared' }, |
679 |
{ data: "dt_is_shared" }, |
| 692 |
{ data: 'dt_owner' }, |
680 |
{ data: "dt_owner" }, |
| 693 |
{ data: 'dt_sortby' }, |
681 |
{ data: "dt_sortby" }, |
| 694 |
{ data: 'dt_created_on' }, |
682 |
{ data: "dt_created_on" }, |
| 695 |
{ data: 'dt_modification_time' }, |
683 |
{ data: "dt_modification_time" }, |
| 696 |
{ data: 'dt_action', orderable: false, className: 'actions' } |
684 |
{ data: "dt_action", orderable: false, className: "actions" }, |
| 697 |
], |
|
|
| 698 |
columnDefs: [ |
| 699 |
{ visible: false, targets: [ 'NoVisible' ] } |
| 700 |
], |
685 |
], |
|
|
686 |
columnDefs: [{ visible: false, targets: ["NoVisible"] }], |
| 701 |
autoWidth: false, |
687 |
autoWidth: false, |
| 702 |
pagingType: 'full_numbers', |
688 |
pagingType: "full_numbers", |
| 703 |
searching: false, |
689 |
searching: false, |
| 704 |
processing: true, |
690 |
processing: true, |
| 705 |
orderCellsTop: true |
691 |
orderCellsTop: true, |
| 706 |
}); |
692 |
}); |
| 707 |
_dt_add_delay_filters(dtListResults.api(), $("#listresultst")); |
693 |
_dt_add_delay_filters(dtListResults.api(), $("#listresultst")); |
| 708 |
|
694 |
|
| 709 |
/* Select correct tab based on URL parameter */ |
695 |
/* Select correct tab based on URL parameter */ |
| 710 |
if( public == 0 ){ |
696 |
if (public == 0) { |
| 711 |
$('a[href="#privateshelves_tab_panel"]').tab('show'); |
697 |
$('a[href="#privateshelves_tab_panel"]').tab("show"); |
| 712 |
} else { |
698 |
} else { |
| 713 |
$('a[href="#publicshelves_tab_panel"]').tab("show"); |
699 |
$('a[href="#publicshelves_tab_panel"]').tab("show"); |
| 714 |
} |
700 |
} |
| 715 |
|
701 |
|
| 716 |
$('#tabs a[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) { |
702 |
$('#tabs a[data-bs-toggle="tab"]').on("shown.bs.tab", function (e) { |
| 717 |
let target = $(this).attr("href"); |
703 |
let target = $(this).attr("href"); |
| 718 |
if( target == "#publicshelves_tab_panel" ){ |
704 |
if (target == "#publicshelves_tab_panel") { |
| 719 |
public = 1; |
705 |
public = 1; |
| 720 |
} else { |
706 |
} else { |
| 721 |
public = 0; |
707 |
public = 0; |
|
Lines 723-729
Link Here
|
| 723 |
dtListResults.DataTable().draw(); |
709 |
dtListResults.DataTable().draw(); |
| 724 |
}); |
710 |
}); |
| 725 |
|
711 |
|
| 726 |
$("body").on("click", ".deleteshelf", function(){ |
712 |
$("body").on("click", ".deleteshelf", function () { |
| 727 |
return confirmDelete(MSG_CONFIRM_DELETE_LIST); |
713 |
return confirmDelete(MSG_CONFIRM_DELETE_LIST); |
| 728 |
}); |
714 |
}); |
| 729 |
}); |
715 |
}); |
|
Lines 776-834
Link Here
|
| 776 |
return param1; |
762 |
return param1; |
| 777 |
} |
763 |
} |
| 778 |
</script> |
764 |
</script> |
| 779 |
|
|
|
| 780 |
<script> |
765 |
<script> |
| 781 |
$(document).ready(function(){ |
766 |
$(document).ready(function () { |
| 782 |
$("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-times\"></i>"+_(" Clear all")+"<\/a>"); |
767 |
$("span.clearall").html('<a id="CheckNone" href="/cgi-bin/koha/shelves.pl"><i class="fa fa-times"></i>' + _(" Clear all") + "<\/a>"); |
| 783 |
$("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-check\"></i>"+_(" Select all")+"<\/a>"); |
768 |
$("span.checkall").html('<a id="CheckAll" href="/cgi-bin/koha/shelves.pl"><i class="fa fa-check"></i>' + _(" Select all") + "<\/a>"); |
| 784 |
$("#CheckAll").click(function(e){ |
769 |
$("#CheckAll").click(function (e) { |
| 785 |
e.preventDefault(); |
770 |
e.preventDefault(); |
| 786 |
$(".selection").each(function(){ |
771 |
$(".selection").each(function () { |
| 787 |
$(this).prop("checked", true); |
772 |
$(this).prop("checked", true); |
| 788 |
}); |
773 |
}); |
| 789 |
}); |
774 |
}); |
| 790 |
|
775 |
|
| 791 |
$("#CheckNone").click(function(e){ |
776 |
$("#CheckNone").click(function (e) { |
| 792 |
e.preventDefault(); |
777 |
e.preventDefault(); |
| 793 |
$(".selection").each(function(){ |
778 |
$(".selection").each(function () { |
| 794 |
$(this).prop("checked", false); |
779 |
$(this).prop("checked", false); |
| 795 |
}); |
780 |
}); |
| 796 |
}); |
781 |
}); |
| 797 |
$(".placehold").on("click",function(e){ |
782 |
$(".placehold").on("click", function (e) { |
| 798 |
placeHold(); |
783 |
placeHold(); |
| 799 |
e.preventDefault(); |
784 |
e.preventDefault(); |
| 800 |
}); |
785 |
}); |
| 801 |
$(".addtocart").show(); |
786 |
$(".addtocart").show(); |
| 802 |
let dropdown = build_dropdown(); |
787 |
let dropdown = build_dropdown(); |
| 803 |
$("span.addto").html(dropdown); |
788 |
$("span.addto").html(dropdown); |
| 804 |
$("#cartsubmit").on("click",function(e){ |
789 |
$("#cartsubmit").on("click", function (e) { |
| 805 |
cartList(); |
790 |
cartList(); |
| 806 |
e.preventDefault(); |
791 |
e.preventDefault(); |
| 807 |
}); |
792 |
}); |
| 808 |
$("#addto").change(function(){ |
793 |
$("#addto").change(function () { |
| 809 |
cartList(); |
|
|
| 810 |
}); |
| 811 |
$(".addto").find("input:submit").click(function(e){ |
| 812 |
e.preventDefault(); |
| 813 |
cartList(); |
794 |
cartList(); |
| 814 |
}); |
795 |
}); |
|
|
796 |
$(".addto") |
| 797 |
.find("input:submit") |
| 798 |
.click(function (e) { |
| 799 |
e.preventDefault(); |
| 800 |
cartList(); |
| 801 |
}); |
| 815 |
$("#selection_ops").show(); |
802 |
$("#selection_ops").show(); |
| 816 |
$(".merge-items").on("click",function(e){ |
803 |
$(".merge-items").on("click", function (e) { |
| 817 |
e.preventDefault(); |
804 |
e.preventDefault(); |
| 818 |
MergeItems(); |
805 |
MergeItems(); |
| 819 |
}); |
806 |
}); |
| 820 |
$("#listform").on("submit",function(e){ |
807 |
$("#listform").on("submit", function (e) {}); |
| 821 |
|
808 |
$(".list-remove").on("click", function (e) { |
| 822 |
}); |
809 |
if ($(".selection").filter(":checked").length > 0) { |
| 823 |
$(".list-remove").on("click",function(e){ |
|
|
| 824 |
if($(".selection").filter(":checked").length > 0){ |
| 825 |
return confirm(MSG_REMOVE_FROM_LIST); |
810 |
return confirm(MSG_REMOVE_FROM_LIST); |
| 826 |
} else { |
811 |
} else { |
| 827 |
alert(MSG_NO_ITEM_SELECTED); |
812 |
alert(MSG_NO_ITEM_SELECTED); |
| 828 |
e.preventDefault(); |
813 |
e.preventDefault(); |
| 829 |
} |
814 |
} |
| 830 |
}); |
815 |
}); |
| 831 |
$("#addToList").on("shown.bs.modal", function(e){ |
816 |
$("#addToList").on("shown.bs.modal", function (e) { |
| 832 |
$("#barcodes").focus(); |
817 |
$("#barcodes").focus(); |
| 833 |
}); |
818 |
}); |
| 834 |
}); |
819 |
}); |
|
Lines 837-848
Link Here
|
| 837 |
|
822 |
|
| 838 |
[% IF shelf AND op == 'edit_form' %] |
823 |
[% IF shelf AND op == 'edit_form' %] |
| 839 |
<script> |
824 |
<script> |
| 840 |
$(document).ready(function(){ |
825 |
$(document).ready(function () { |
| 841 |
AdjustRemark(); |
826 |
AdjustRemark(); |
| 842 |
}); |
827 |
}); |
| 843 |
</script> |
828 |
</script> |
| 844 |
[% END %] |
829 |
[% END %] |
| 845 |
|
|
|
| 846 |
<script> |
830 |
<script> |
| 847 |
/** |
831 |
/** |
| 848 |
* This function checks if the adequate number of records are checked for merging |
832 |
* This function checks if the adequate number of records are checked for merging |
|
Lines 969-987
Link Here
|
| 969 |
} |
953 |
} |
| 970 |
} |
954 |
} |
| 971 |
</script> |
955 |
</script> |
| 972 |
|
|
|
| 973 |
[% IF op == 'view' %] |
956 |
[% IF op == 'view' %] |
| 974 |
<script> |
957 |
<script> |
| 975 |
function sendList(){ |
958 |
function sendList(){ |
| 976 |
openWindow( CGIBIN + 'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]' ); |
959 |
openWindow( CGIBIN + 'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]' ); |
| 977 |
} |
960 |
} |
| 978 |
|
961 |
|
| 979 |
$(document).ready(function() { |
962 |
$(document).ready(function() { |
| 980 |
$("#sendlist").click(function(){ |
963 |
$("#sendlist").click(function(){ |
| 981 |
sendList(); |
964 |
sendList(); |
| 982 |
return false; |
965 |
return false; |
| 983 |
}); |
966 |
}); |
| 984 |
}); |
967 |
}); |
| 985 |
</script> |
968 |
</script> |
| 986 |
[% END %] |
969 |
[% END %] |
| 987 |
|
970 |
|
| 988 |
- |
|
|