@@ -, +, @@ --- koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 123 ++++++++ .../intranet-tmpl/prog/en/js/pages/circulation.js | 129 -------- .../prog/en/modules/circ/circulation.tt | 84 ++---- .../prog/en/modules/members/moremember.tt | 321 ++++++-------------- members/moremember.pl | 129 +------- 5 files changed, 262 insertions(+), 524 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -1,4 +1,127 @@ $(document).ready(function() { + // Handle the select all/none links for checkouts table columns + $("#CheckAllRenewals").on("click",function(){ + $("#UncheckAllCheckins").click(); + $(".renew:visible").attr("checked", "checked" ); + return false; + }); + $("#UncheckAllRenewals").on("click",function(){ + $(".renew:visible").removeAttr("checked"); + return false; + }); + + $("#CheckAllCheckins").on("click",function(){ + $("#UncheckAllRenewals").click(); + $(".checkin:visible").attr("checked", "checked" ); + return false; + }); + $("#UncheckAllCheckins").on("click",function(){ + $(".checkin:visible").removeAttr("checked"); + return false; + }); + + // Don't allow both return and renew checkboxes to be checked + $(document).on("change", '.renew', function(){ + if ( $(this).is(":checked") ) { + $( "#checkin_" + $(this).val() ).removeAttr("checked"); + } + }); + $(document).on("change", '.checkin', function(){ + if ( $(this).is(":checked") ) { + $( "#renew_" + $(this).val() ).removeAttr("checked"); + } + }); + + // Clicking the table cell checks the checkbox inside it + $(document).on("click", 'td', function(e){ + if(e.target.tagName.toLowerCase() == 'td'){ + $(this).find("input:checkbox:visible").each( function() { + $(this).click(); + }); + } + }); + + // Handle renewals + $("#RenewCheckinChecked").on("click",function(){ + $(".checkin:checked:visible").each(function() { + itemnumber = $(this).val(); + + $(this).replaceWith(""); + + params = { + itemnumber: itemnumber, + borrowernumber: borrowernumber, + branchcode: branchcode, + exempt_fine: $("#exemptfine").is(':checked') + }; + + $.post( "/cgi-bin/koha/api/checkin.pl", params, function( data ) { + id = "#checkin_" + data.itemnumber; + + content = ""; + if ( data.returned ) { + content = _("Returned"); + } else { + content = _("Unable to return"); + } + + $(id).replaceWith( content ); + }, "json") + }); + + $(".renew:checked:visible").each(function() { + var override_limit = $("#override_limit").is(':checked') ? 1 : 0; + + var itemnumber = $(this).val(); + + $(this).replaceWith(""); + + var params = { + itemnumber: itemnumber, + borrowernumber: borrowernumber, + branchcode: branchcode, + override_limit: override_limit, + date_due: $("#newduedate").val() + }; + + $.post( "/cgi-bin/koha/api/renew.pl", params, function( data ) { + var id = "#renew_" + data.itemnumber; + + var content = ""; + if ( data.renew_okay ) { + content = _("Renewed, due: ") + data.date_due; + } else { + content = _("Renew failed: "); + if ( data.error == "no_checkout" ) { + content += _("not checked out"); + } else if ( data.error == "too_many" ) { + content += _("too many renewals"); + } else if ( data.error == "on_reserve" ) { + content += _("on reserve"); + } else if ( data.error ) { + content += data.error; + } else { + content += _("reason unknown"); + } + } + + $(id).replaceWith( content ); + }, "json") + }); + + // Prevent form submit + return false; + }); + + $("#RenewAll").on("click",function(){ + $("#CheckAllRenewals").click(); + $("#UncheckAllCheckins").click(); + $("#RenewCheckinChecked").click(); + + // Prevent form submit + return false; + }); + var ymd = $.datepicker.formatDate('yy-mm-dd', new Date()); $("#issues-table").dataTable({ --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js +++ a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js @@ -1,25 +1,4 @@ $(document).ready(function() { - // Handle the select all/none links for checkouts table columns - $("#CheckAllRenewals").on("click",function(){ - $("#UncheckAllCheckins").click(); - $(".renew:visible").attr("checked", "checked" ); - return false; - }); - $("#UncheckAllRenewals").on("click",function(){ - $(".renew:visible").removeAttr("checked"); - return false; - }); - - $("#CheckAllCheckins").on("click",function(){ - $("#UncheckAllRenewals").click(); - $(".checkin:visible").attr("checked", "checked" ); - return false; - }); - $("#UncheckAllCheckins").on("click",function(){ - $(".checkin:visible").removeAttr("checked"); - return false; - }); - $("#CheckAllExports").on("click",function(){ $(".export:visible").attr("checked", "checked" ); return false; @@ -29,99 +8,6 @@ $(document).ready(function() { return false; }); - // Don't allow both return and renew checkboxes to be checked - $(document).on("change", '.renew', function(){ - if ( $(this).is(":checked") ) { - $( "#checkin_" + $(this).val() ).removeAttr("checked"); - } - }); - $(document).on("change", '.checkin', function(){ - if ( $(this).is(":checked") ) { - $( "#renew_" + $(this).val() ).removeAttr("checked"); - } - }); - - // Handle renewals - $("#RenewCheckinChecked").on("click",function(){ - $(".checkin:checked:visible").each(function() { - itemnumber = $(this).val(); - - $(this).replaceWith(""); - - params = { - itemnumber: itemnumber, - borrowernumber: borrowernumber, - branchcode: branchcode, - exempt_fine: $("#exemptfine").is(':checked') - }; - - $.post( "/cgi-bin/koha/api/checkin.pl", params, function( data ) { - id = "#checkin_" + data.itemnumber; - - content = ""; - if ( data.returned ) { - content = _("Returned"); - } else { - content = _("Unable to return"); - } - - $(id).replaceWith( content ); - }, "json") - }); - - $(".renew:checked:visible").each(function() { - var override_limit = $("#override_limit").is(':checked') ? 1 : 0; - - var itemnumber = $(this).val(); - - $(this).replaceWith(""); - - var params = { - itemnumber: itemnumber, - borrowernumber: borrowernumber, - branchcode: branchcode, - override_limit: override_limit, - date_due: $("#newduedate").val() - }; - - $.post( "/cgi-bin/koha/api/renew.pl", params, function( data ) { - var id = "#renew_" + data.itemnumber; - - var content = ""; - if ( data.renew_okay ) { - content = _("Renewed, due: ") + data.date_due; - } else { - content = _("Renew failed: "); - if ( data.error == "no_checkout" ) { - content += _("not checked out"); - } else if ( data.error == "too_many" ) { - content += _("too many renewals"); - } else if ( data.error == "on_reserve" ) { - content += _("on reserve"); - } else if ( data.error ) { - content += data.error; - } else { - content += _("reason unknown"); - } - } - - $(id).replaceWith( content ); - }, "json") - }); - - // Prevent form submit - return false; - }); - - $("#RenewAll").on("click",function(){ - $("#CheckAllRenewals").click(); - $("#UncheckAllCheckins").click(); - $("#RenewCheckinChecked").click(); - - // Prevent form submit - return false; - }); - $('#patronlists').tabs(); $("#messages ul").after(""+MSG_ADD_MESSAGE+""); @@ -156,14 +42,6 @@ $(document).ready(function() { return false; }); - // Clicking the table cell checks the checkbox inside it - $(document).on("click", 'td', function(e){ - if(e.target.tagName.toLowerCase() == 'td'){ - $(this).find("input:checkbox:visible").each( function() { - $(this).click(); - }); - } - }); }); function export_checkouts(format) { @@ -200,10 +78,3 @@ function validate1(date) { return false; } } - -// prevent adjacent checkboxes from being checked simultaneously -function radioCheckBox(box){ - box.parents("td").siblings().find("input:checkbox.radio").each(function(){ - $(this).removeAttr("checked"); - }); - } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -669,8 +669,7 @@ No patron matched [% message %]
Patron has nothing checked out.
-[% END %] - + + + + [% ELSE %] +Patron has nothing checked out.
+ [% END %]Due date | -Title | -Item type | -Checked out on | -Checked out from | -Call no | -Charge | -Price | -Patron | -
---|
Due date | +Title | +Item type | +Checked out on | +Checked out from | +Call no | +Charge | +Price | +Patron | +
---|