Bugzilla – Attachment 191528 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: (follow-up) More tidying
Bug-41572-follow-up-More-tidying.patch (text/plain), 23.65 KB, created by
Owen Leonard
on 2026-01-15 19:23:56 UTC
(
hide
)
Description:
Bug 41572: (follow-up) More tidying
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2026-01-15 19:23:56 UTC
Size:
23.65 KB
patch
obsolete
>From 1616da32e181a2f4ead4f6c4d1f1166df5332ae0 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 15 Jan 2026 14:21:59 -0500 >Subject: [PATCH] Bug 41572: (follow-up) More tidying > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/modules/members/holdshistory.tt | 329 +++++++++--------- > .../prog/en/modules/members/pay.tt | 47 +-- > 2 files changed, 191 insertions(+), 185 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >index 45a8b6748f2..28141365f0a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >@@ -192,206 +192,209 @@ > const show_itemtype_column = [% show_itemtype_column ? 1 : 0 | html %]; > </script> > <script> >- $(document).ready(function() { >+ $(document).ready(function () { > let current_holds_table = build_holds_table("#table_holdshistory"); > let old_holds_table = build_holds_table("#table_oldholdshistory", 1); >- function build_holds_table(table_id, old){ >+ function build_holds_table(table_id, old) { > let additional_filters = { >- "-and": function(){ >+ "-and": function () { > let statuses = []; > let include_cancelled = false; >- if ( table_id == '#table_holdshistory' ) { >- if ( $("#current_pending_filter").is(":checked") ) { >+ if (table_id == "#table_holdshistory") { >+ if ($("#current_pending_filter").is(":checked")) { > statuses.push(null); > } >- if ( $("#current_waiting_filter").is(":checked") ) { >+ if ($("#current_waiting_filter").is(":checked")) { > statuses.push("W"); > } >- if ( $("#current_processing_filter").is(":checked") ) { >+ if ($("#current_processing_filter").is(":checked")) { > statuses.push("P"); > } >- if ( $("#current_transit_filter").is(":checked") ) { >+ if ($("#current_transit_filter").is(":checked")) { > statuses.push("T"); > } > } else { >- if ( $("#old_fulfilled_filter").is(":checked") ) { >+ if ($("#old_fulfilled_filter").is(":checked")) { > statuses.push("F"); > } >- if ( $("#old_cancelled_filter").is(":checked") ) { >+ if ($("#old_cancelled_filter").is(":checked")) { > include_cancelled = true; > } > } >- if ( include_cancelled ) { >- return [{status: statuses}, { cancellation_date: {"<": new Date().toISOString() } } ]; // cancellation_date cannot be in the future. Would be better a 'not null' here however. >+ if (include_cancelled) { >+ return [{ status: statuses }, { cancellation_date: { "<": new Date().toISOString() } }]; // cancellation_date cannot be in the future. Would be better a 'not null' here however. > } else { >- return [{status: statuses}]; >+ return [{ status: statuses }]; > } > }, >- > }; > > let table_url = `/api/v1/patrons/${patron_id}/holds`; >- let table_embeds = ['+strings', 'biblio', 'item', 'pickup_library']; >- if (old){ >- table_url += '?old=1'; >- table_embeds.push('deleted_biblio'); >+ let table_embeds = ["+strings", "biblio", "item", "pickup_library"]; >+ if (old) { >+ table_url += "?old=1"; >+ table_embeds.push("deleted_biblio"); > } >- return $(table_id).kohaTable({ >- ajax: { >- url: table_url, >- }, >- order: [], >- embed: table_embeds, >- columns: [ >- { >- data: "biblio.title:biblio.subtitle:biblio.medium", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- if( row.biblio ){ >- return $biblio_to_html(row.biblio, { link: 1 }); >- } else { >- return $biblio_to_html(row.deleted_biblio, { link: 0, deleted: 1 }); >- } >- } >- }, >- { >- data: "biblio.author", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- let biblio = row.biblio ? row.biblio : row.deleted_biblio; >- return biblio ? biblio.author : ""; >- } >- }, >- { >- data: "item.external_id", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- return row.item ? row.item.external_id : ""; >- } >- }, >- { >- data: "item.callnumber", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- return row.item ? row.item.callnumber: ""; >- } >- }, >- { >- data: "me.pickup_library_id", >- datatype: "coded_value:library", >- dataFilter: "libraries", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- return escape_str(row._strings.pickup_library_id ? row._strings.pickup_library_id.str : row.pickup_library_id); >- } >- }, >- { >- data: "hold_date", >- type: "date", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- return $date(row.hold_date); >- } >+ return $(table_id).kohaTable( >+ { >+ ajax: { >+ url: table_url, > }, >- { >- data: "expiration_date", >- type: "date", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- return $date(row.expiration_date) >- } >- }, >- { >- data: "waiting_date", >- type: "date", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- return $date(row.waiting_date) >- } >- }, >- { >- data: "cancellation_date", >- type: "date", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- return $date(row.cancellation_date) >- } >- }, >- ...(show_itemtype_column? >- [{ >- data: "item_type_id", >- datatype: "coded_value:item_type", >- dataFilter: "item_types", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- if ( row.item_type_id ) { >- return row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id; >- } else { >- return _("Any item type"); >- } >- } >- }]:[]), >- { >- data: "status", >- searchable: false, >- orderable: true, >- render: function (data, type, row, meta) { >- if ( row.status == 'F' ) { >- return _("Fulfilled"); >- } else if (row.cancellation_date) { >- let r = _("Cancelled"); >- if (row.cancellation_reason){ >- r += " (%s)".format(row._strings.cancellation_reason.str); >+ order: [], >+ embed: table_embeds, >+ columns: [ >+ { >+ data: "biblio.title:biblio.subtitle:biblio.medium", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ if (row.biblio) { >+ return $biblio_to_html(row.biblio, { link: 1 }); >+ } else { >+ return $biblio_to_html(row.deleted_biblio, { link: 0, deleted: 1 }); >+ } >+ }, >+ }, >+ { >+ data: "biblio.author", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ let biblio = row.biblio ? row.biblio : row.deleted_biblio; >+ return biblio ? biblio.author : ""; >+ }, >+ }, >+ { >+ data: "item.external_id", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ return row.item ? row.item.external_id : ""; >+ }, >+ }, >+ { >+ data: "item.callnumber", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ return row.item ? row.item.callnumber : ""; >+ }, >+ }, >+ { >+ data: "me.pickup_library_id", >+ datatype: "coded_value:library", >+ dataFilter: "libraries", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ return escape_str(row._strings.pickup_library_id ? row._strings.pickup_library_id.str : row.pickup_library_id); >+ }, >+ }, >+ { >+ data: "hold_date", >+ type: "date", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ return $date(row.hold_date); >+ }, >+ }, >+ { >+ data: "expiration_date", >+ type: "date", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ return $date(row.expiration_date); >+ }, >+ }, >+ { >+ data: "waiting_date", >+ type: "date", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ return $date(row.waiting_date); >+ }, >+ }, >+ { >+ data: "cancellation_date", >+ type: "date", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ return $date(row.cancellation_date); >+ }, >+ }, >+ ...(show_itemtype_column >+ ? [ >+ { >+ data: "item_type_id", >+ datatype: "coded_value:item_type", >+ dataFilter: "item_types", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ if (row.item_type_id) { >+ return row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id; >+ } else { >+ return _("Any item type"); >+ } >+ }, >+ }, >+ ] >+ : []), >+ { >+ data: "status", >+ searchable: false, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ if (row.status == "F") { >+ return _("Fulfilled"); >+ } else if (row.cancellation_date) { >+ let r = _("Cancelled"); >+ if (row.cancellation_reason) { >+ r += " (%s)".format(row._strings.cancellation_reason.str); >+ } >+ return r; >+ } else if (row.status == "W") { >+ return _("Waiting"); >+ } else if (row.status == "P") { >+ return _("Processing"); >+ } else if (row.status == "T") { >+ return _("In transit"); > } >- return r; >- } else if (row.status == 'W') { >- return _("Waiting"); >- } else if (row.status == 'P') { >- return _("Processing"); >- } else if (row.status == 'T') { >- return _("In transit"); >- } > >- return _("Pending"); >- } >- }, >- { >- data: "notes", >- searchable: true, >- orderable: true, >- render: function (data, type, row, meta) { >- return row.notes; >- } >- }, >- ], >- }, >- table_settings, >- true, >- additional_filters, >- filters_options, >+ return _("Pending"); >+ }, >+ }, >+ { >+ data: "notes", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ return row.notes; >+ }, >+ }, >+ ], >+ }, >+ table_settings, >+ true, >+ additional_filters, >+ filters_options > ); > } >- $("#current_holds_filters :checkbox, #old_holds_filters :checkbox").on("change", function(e){ >+ $("#current_holds_filters :checkbox, #old_holds_filters :checkbox").on("change", function (e) { > e.preventDefault(); > let container = $(this).closest("div"); >- if ( $(this).hasClass("show_all") ) { >- if ( $(this).is(":checked") ) { >+ if ($(this).hasClass("show_all")) { >+ if ($(this).is(":checked")) { > container.find(":checkbox").prop("checked", true); > } >- } else if ( $(this).not(":checked") ) { >+ } else if ($(this).not(":checked")) { > container.find(".show_all").prop("checked", false); > } >- let table_dt = $("#"+container.data("table-id")).DataTable(); >+ let table_dt = $("#" + container.data("table-id")).DataTable(); > table_dt.draw(); > }); > }); >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 6a2eaa241e1..432ae48893f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -244,55 +244,58 @@ > }); > </script> > <script> >- function enableCheckboxActions(){ >+ function enableCheckboxActions() { > // Enable/disable controls if checkboxes are checked > var checkedBoxes = $("input.cb:checked"); > if ($(checkedBoxes).size()) { >- $("#payselected, #writeoff-selected").prop("disabled",false); >+ $("#payselected, #writeoff-selected").prop("disabled", false); > } else { >- $("#payselected, #writeoff-selected").prop("disabled",true); >+ $("#payselected, #writeoff-selected").prop("disabled", true); > } > } >- $(document).ready(function(){ >- if (payment_id && prefs.FinePaymentAutoPopup){ >- window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=${payment_id}&change_given=${change_given}&borrowernumber=${patron_id}`, '_blank'); >+ $(document).ready(function () { >+ if (payment_id && prefs.FinePaymentAutoPopup) { >+ window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=${payment_id}&change_given=${change_given}&borrowernumber=${patron_id}`, "_blank"); > } > >- $('#pay-fines-form').preventDoubleFormSubmit(); >- $("#woall").click(function(event){ >+ $("#pay-fines-form").preventDoubleFormSubmit(); >+ $("#woall").click(function (event) { > var msg = _("Are you sure you want to write off %s in outstanding charges? This cannot be undone!").format(total); > var answer = confirm(msg); >- if (!answer){ >- event.preventDefault(); >- } >+ if (!answer) { >+ event.preventDefault(); >+ } > }); >- $('#CheckAll').click(function(e){ >+ $("#CheckAll").click(function (e) { > e.preventDefault(); >- $(".cb").each(function(){ >- $(this).prop("checked", true ); >+ $(".cb").each(function () { >+ $(this).prop("checked", true); > }); > enableCheckboxActions(); > }); >- $('#CheckNone').click(function(e){ >+ $("#CheckNone").click(function (e) { > e.preventDefault(); >- $(".cb").each(function(){ >- $(this).prop("checked", false ); >+ $(".cb").each(function () { >+ $(this).prop("checked", false); > }); > enableCheckboxActions(); > }); >- $(".cb").change(function(){ >+ $(".cb").change(function () { > enableCheckboxActions(); > }); > enableCheckboxActions(); >- $(".add-note").on("click", function(e){ >+ $(".add-note").on("click", function (e) { > e.preventDefault(); > $(this).hide(); > var accountlines_id = $(this).data("accountlines_id"); >- $("#payment_note_" + accountlines_id ).show().find("input").focus(); >+ $("#payment_note_" + accountlines_id) >+ .show() >+ .find("input") >+ .focus(); > }); >- $(".cancel-note").on("click", function(e){ >+ $(".cancel-note").on("click", function (e) { > e.preventDefault(); >- this_td = $(this).closest('td.actions'); >+ this_td = $(this).closest("td.actions"); > this_td.find(".payment_note").hide().find("input").val(""); > this_td.find(".add-note").show(); > }); >-- >2.39.5
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
|
191521
|
191522
|
191523
|
191524
|
191525
|
191526
|
191527
|
191528
|
192714
|
192715
|
192716
|
192717
|
192718
|
192719
|
192720
|
192721
|
192722