@@ -, +, @@ --- .../opac-tmpl/bootstrap/en/modules/opac-account.tt | 29 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt @@ -68,7 +68,6 @@ [% PROCESS 'account-table.inc' ACCOUNT_LINES = ACCOUNT_LINES, ENABLE_OPAC_PAYMENTS = ENABLE_OPAC_PAYMENTS, plugins = plugins %] - @@ -82,14 +81,38 @@ $( document ).ready(function() { var MSG_MIN_THRESHOLD = _("Minimum amount needed by this service is %s"); + var txtActivefilter = _("Filter paid transactions"); + var txtInactivefilter = _("Show all transactions"); - $("#finestable").dataTable($.extend(true, {}, dataTablesDefaults, { + var fines_table = $("#finestable").dataTable($.extend(true, {}, dataTablesDefaults, { "columnDefs": [ { "type": "title-string", "targets" : [ "title-string" ] } ], - "order": [[ 0, "desc" ]] + [% IF ENABLE_OPAC_PAYMENTS %] + "order": [[ 1, "desc" ]], + [% ELSE %] + "order": [[ 0, "desc" ]], + [% END %] + "dom": '<"#filter_p">', } )); + $("#filter_p").html('

'+txtActivefilter+''); + $('#filter_paid').click(function(e) { + e.preventDefault(); + if ($(this).hasClass('filtered')) { + var filteredValue = ''; + $(this).html(' '+txtActivefilter); + } else { //Not filtered. Let's do it! + var filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408 + $(this).html(' '+txtInactivefilter); + } + fines_table.fnFilter(filteredValue, -1, true, false); + $(this).toggleClass('filtered'); + }); + + //Start filtered + $('#filter_paid').click(); + $(".paypal").on("click", function() { window.open('https://www.paypal.com/webapps/mpp/paypal-popup','WIPaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700'); return false; --