Bugzilla – Attachment 191138 Details for
Bug 41572
Tidy kohaTable block - members
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41572: members - auto tidy
200a0ba.patch (text/plain), 11.70 KB, created by
Jonathan Druart
on 2026-01-09 14:50:05 UTC
(
hide
)
Description:
Bug 41572: members - auto tidy
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-09 14:50:05 UTC
Size:
11.70 KB
patch
obsolete
>From 200a0ba8f4f998d16d53f03d22106c8e6cc3d620 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 9 Jan 2026 13:14:42 +0100 >Subject: [PATCH] Bug 41572: members - auto tidy > >--- > .../prog/en/modules/members/boraccount.tt | 96 +++++++++---------- > .../en/modules/members/moremember-print.tt | 7 +- > .../prog/en/modules/members/pay.tt | 1 - > .../prog/en/modules/members/readingrec.tt | 7 +- > 4 files changed, 54 insertions(+), 57 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >index 921a7901d60..bf2045bc894 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -585,11 +585,10 @@ > const change_given = "[% change_given | html %]"; > const payment_id = "[% payment_id | html %]"; > </script> >- > <script> >- $(document).ready(function() { >- if (payment_id && prefs.FinePaymentAutoPopup){ >- window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&change_given=${change_given}&accountlines_id=${payment_id}`, '_blank'); >+ $(document).ready(function () { >+ if (payment_id && prefs.FinePaymentAutoPopup) { >+ window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&change_given=${change_given}&accountlines_id=${payment_id}`, "_blank"); > } > > var txtActivefilter = _("Filter paid transactions"); >@@ -602,85 +601,86 @@ > }, > table_settings > ); >- $("#filter_c").html('<p><a href="#" id="filter_transacs"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>'); >- $('#filter_transacs').click(function(e) { >+ $("#filter_c").html('<p><a href="#" id="filter_transacs"><i class="fa fa-filter"></i> ' + txtActivefilter + "</a>"); >+ $("#filter_transacs").click(function (e) { > e.preventDefault(); >- if ($(this).hasClass('filtered')) { >- var filteredValue = ''; >- $(this).html('<i class="fa fa-filter"></i> '+txtActivefilter); >- } else { //Not filtered. Let's do it! >- var filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408 >- $(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter); >+ if ($(this).hasClass("filtered")) { >+ var filteredValue = ""; >+ $(this).html('<i class="fa fa-filter"></i> ' + txtActivefilter); >+ } else { >+ //Not filtered. Let's do it! >+ var filteredValue = "^((?!0.00).*)$"; //Filter not matching 0.00 http://stackoverflow.com/a/406408 >+ $(this).html('<i class="fa fa-filter"></i> ' + txtInactivefilter); > } >- table_account_fines.DataTable().columns( 14 ).search( filteredValue, true, false ).draw(); >- $(this).toggleClass('filtered'); >+ table_account_fines.DataTable().columns(14).search(filteredValue, true, false).draw(); >+ $(this).toggleClass("filtered"); > }); > >- $("#issuePayoutModal").on("shown.bs.modal", function(e){ >+ $("#issuePayoutModal").on("shown.bs.modal", function (e) { > var button = $(e.relatedTarget); >- var accountline = button.data('accountline'); >- $('#payoutline').val(accountline); >- var amount = button.data('amount') * -1; >+ var accountline = button.data("accountline"); >+ $("#payoutline").val(accountline); >+ var amount = button.data("amount") * -1; > $("#paid + span").text(amount.format_price()); >- $("#amount").attr({ "value": amount.format_price(), "max": amount, "min": 0 }); >+ $("#amount").attr({ value: amount.format_price(), max: amount, min: 0 }); > $("#amount, #payout_transaction_type").focus(); > }); > >- $("#issueRefundModal").on("shown.bs.modal", function(e){ >+ $("#issueRefundModal").on("shown.bs.modal", function (e) { > var button = $(e.relatedTarget); >- var item = button.data('item'); >+ var item = button.data("item"); > $("#item + span").replaceWith(item); >- var accountline = button.data('accountline'); >- $('#refundline').val(accountline); >- var amount = button.data('amount'); >- var amountoutstanding = button.data('amountoutstanding') || 0; >+ var accountline = button.data("accountline"); >+ $("#refundline").val(accountline); >+ var amount = button.data("amount"); >+ var amountoutstanding = button.data("amountoutstanding") || 0; > var paid = amount - amountoutstanding; > $("#paid + span").text(paid.format_price()); >- $("#returned").attr({ "value": paid.format_price(), "max": paid.format_price(), "min": 0 }); >- var member = button.data('member'); >- if ( member === '' ) { >+ $("#returned").attr({ value: paid.format_price(), max: paid.format_price(), min: 0 }); >+ var member = button.data("member"); >+ if (member === "") { > $("#refund_type option[value='AC']").remove(); >- } else if ( $("#refund_type option[value='AC']").length == 0 ) { >+ } else if ($("#refund_type option[value='AC']").length == 0) { > $("#refund_type").prepend('<option value="AC" selected="selected">Account credit</option>'); > } > $("#returned, #refund_type").focus(); > }); > >- $("#applyDiscountModal").on("shown.bs.modal", function(e){ >+ $("#applyDiscountModal").on("shown.bs.modal", function (e) { > var button = $(e.relatedTarget); >- var item = button.data('item'); >+ var item = button.data("item"); > $("#apply_discount_item + span").replaceWith(item); >- var accountline = button.data('accountline'); >- $('#discountline').val(accountline); >- var amountoutstanding = button.data('amountoutstanding'); >+ var accountline = button.data("accountline"); >+ $("#discountline").val(accountline); >+ var amountoutstanding = button.data("amountoutstanding"); > $("#charged + span").text(amountoutstanding); >- $("#discount").attr({ "value": (0).format_price(), "max": amountoutstanding, "min": 0 }); >+ $("#discount").attr({ value: (0).format_price(), max: amountoutstanding, min: 0 }); > $("#discount").focus(); > }); > >- $("#voidPaymentModal").on("shown.bs.modal", function(e){ >+ $("#voidPaymentModal").on("shown.bs.modal", function (e) { > var button = $(e.relatedTarget); >- var item = button.data('accountline'); >- $('#voidline').val(item); >+ var item = button.data("accountline"); >+ $("#voidline").val(item); > }); > >- $("#cancelChargeModal").on("shown.bs.modal", function(e){ >+ $("#cancelChargeModal").on("shown.bs.modal", function (e) { > var button = $(e.relatedTarget); >- var item = button.data('accountlines_id'); >- $('#accountlines_id').val(item); >+ var item = button.data("accountlines_id"); >+ $("#accountlines_id").val(item); > }); > >- $("#editNoteModal").on("shown.bs.modal", function(e) { >+ $("#editNoteModal").on("shown.bs.modal", function (e) { > var button = $(e.relatedTarget); >- var accountline = button.data('accountline'); >- $('#noteline').val(accountline); >- var note = button.data('note'); >- $('#edited_note').val(note); >+ var accountline = button.data("accountline"); >+ $("#noteline").val(accountline); >+ var note = button.data("note"); >+ $("#edited_note").val(note); > }); > >- $(".receipt-email-action").on("click", function(e){ >+ $(".receipt-email-action").on("click", function (e) { > e.preventDefault(); >- return $(this).siblings('form').submit(); >+ return $(this).siblings("form").submit(); > }); > }); > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >index 41d2fc7c3e2..0d4364b01cd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >@@ -177,9 +177,8 @@ > var holds_columns = [% TablesSettings.GetTableSettings( 'circ', 'print_summary', 'print-summary-holds', 'json' ) | $raw %]; > var fines_columns = [% TablesSettings.GetTableSettings( 'circ', 'print_summary', 'print-summary-fines', 'json' ) | $raw %]; > </script> >- > <script> >- function initTables(){ >+ function initTables() { > $("#print-summary-checkouts").kohaTable( > { > dom: '<"dt-info"><"top pager"<"table_controls"B>>t', >@@ -208,10 +207,10 @@ > ); > } > >- if( autoprint ){ >+ if (autoprint) { > window.onbeforeprint = initTables(); > } else { >- $(document).ready(function(){ >+ $(document).ready(function () { > initTables(); > }); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >index 2bd70b30585..97d61aa218d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -243,7 +243,6 @@ > FinePaymentAutoPopup: [% Koha.Preference('FinePaymentAutoPopup') ? 1 : 0 | html %], > }); > </script> >- > <script> > function enableCheckboxActions(){ > // Enable/disable controls if checkboxes are checked >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt >index c232f229fc1..0ad88a57e08 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt >@@ -169,9 +169,8 @@ > > var table_settings = [% TablesSettings.GetTableSettings('members', 'checkouthistory', 'checkouthistory-table', 'json') | $raw %]; > </script> >- > <script> >- $(document).ready(function() { >+ $(document).ready(function () { > var table = $("#table_readingrec").kohaTable( > { > pagingType: "full", >@@ -184,9 +183,9 @@ > $("#tabs a[data-bs-toggle='tab']").on("shown.bs.tab", function (e) { > active_tab = $(this).attr("href"); > let pattern = ""; >- if( active_tab == "#tab_checkout_panel" ){ >+ if (active_tab == "#tab_checkout_panel") { > pattern = "standard_checkout"; >- } else if( active_tab == "#tab_onsite_checkout_panel" ){ >+ } else if (active_tab == "#tab_onsite_checkout_panel") { > pattern = "onsite_checkout"; > } > table_dt.columns(0).search(pattern).draw(); >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41572
:
191133
|
191134
|
191135
|
191136
|
191137
| 191138