- $(".checkall").click(function(){
- $(".checkboxed").checkCheckboxes();
- return false;
- });
- $(".clearall").click(function(){
- $(".checkboxed").unCheckCheckboxes();
- return false;
- });
-[% IF ( offset ) %]$("#markseen").before("<input type=\"submit\" value=\"<< Mark seen and continue\" id=\"markback\" />");[% END %]
-[% IF ( nextoffset ) %]$("#markseen").after("<input type=\"submit\" id=\"marknext\" value=\"Mark seen and continue >>\" />");[% END %]
- $("#markback").click(function(){
- $(".checkboxed").find("input").filter("[name=offset]").attr("value","[% prevoffset %]");
- return true;
- });
- $("#marknext").click(function(){
- $(".checkboxed").find("input").filter("[name=offset]").attr("value","[% nextoffset %]");
- return true;
- });
- });
+ inventorydt = $('#inventoryt').dataTable($.extend(true, {}, dataTablesDefaults, {
+ 'sPaginationType': 'full_numbers',
+ [% IF compareinv2barcd %]
+ "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 1 ] } ],
+ [% ELSE %]
+ "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 0 ] } ],
+ [% END %]
+ 'fnDrawCallback': function() {
+ //bind the click handler script to the newly created elements held in the table
+ $('.openWin').bind('click',function(e){
+ e.preventDefault();
+ openWindow(this.href,'marcview',800,600);
+ });
+ }
+ } ));
+
+
+ $("#continuewithoutmarkingbutton").click(function(){
+ inventorydt.fnPageChange( 'next' );
+ return false;
+ });
+
+ $("#markseenandcontinuebutton").click(function(){
+ var param = '';
+ $("input:checked").each(function() {
+ param += "|" + $(this).attr('name');
+ });
+ $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
+ inventorydt.fnPageChange( 'next' );
+ return false;
+ });
+
+ $("#markseenandquit").click(function(){
+ var param = '';
+ $("input:checked").each(function() {
+ param += "|" + $(this).attr('name');
+ });
+ $.ajax({
+ type: 'POST',
+ url: '/cgi-bin/koha/tools/ajax-inventory.pl',
+ data: { seen: param},
+ async: false
+ });
+ document.location.href = '/cgi-bin/koha/tools/inventory.pl';
+ return false;
+ });
+
+
+ $(".checkall").click(function(){
+ $(".checkboxed").checkCheckboxes();
+ return false;
+ });
+ $(".clearall").click(function(){
+ $(".checkboxed").unCheckCheckboxes();
+ return false;
+ });
+ $("#inventory_form").on("submit",function(){
+ return checkForm();
+ });
+});