Bugzilla – Attachment 191142 Details for
Bug 41573
Tidy kohaTable block - patron_lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41573: patron_lists - auto tidy
5c4eabb.patch (text/plain), 11.83 KB, created by
Jonathan Druart
on 2026-01-09 14:50:32 UTC
(
hide
)
Description:
Bug 41573: patron_lists - auto tidy
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-09 14:50:32 UTC
Size:
11.83 KB
patch
obsolete
>From 5c4eabb8086fe71e1e39683ed9d7652d3cca0d34 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 9 Jan 2026 13:15:00 +0100 >Subject: [PATCH] Bug 41573: patron_lists - auto tidy > >--- > .../prog/en/modules/patron_lists/list.tt | 76 ++++++++++--------- > .../prog/en/modules/patron_lists/lists.tt | 36 +++++---- > .../modules/patron_lists/patron-lists-tab.tt | 1 - > 3 files changed, 56 insertions(+), 57 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt >index e6a6b453a25..a587a94c199 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt >@@ -237,92 +237,94 @@ > <script> > var table_settings = [% TablesSettings.GetTableSettings('members', 'patron-lists', 'patron-list-table', 'json') | $raw %] > </script> >- > <script> >- $(document).ready(function() { >- $('#patrons_to_add_fieldset').hide(); >+ $(document).ready(function () { >+ $("#patrons_to_add_fieldset").hide(); > >- $("#patron-list-table").kohaTable( >- { >- pagingType: "full", >- }, >- table_settings >- ); >+ $("#patron-list-table").kohaTable( >+ { >+ pagingType: "full", >+ }, >+ table_settings >+ ); > >- function RemovePatron( cardnumber, container ) { >- $( '#borrower_' + cardnumber ).remove(); >+ function RemovePatron(cardnumber, container) { >+ $("#borrower_" + cardnumber).remove(); > >- if ( ! $(container).html() ) { >- $(container).parent("fieldset").hide( 800 ); >+ if (!$(container).html()) { >+ $(container).parent("fieldset").hide(800); > } > } > patron_autocomplete($("#find_patron"), { > "on-select-add-to": { > container: $("#patrons_to_add"), >- input_name: 'patrons_to_add', >+ input_name: "patrons_to_add", > }, >- "on-select-callback": function( event, ui ) { >- $("#find_patron").val('').focus(); >+ "on-select-callback": function (event, ui) { >+ $("#find_patron").val("").focus(); > return false; >- } >+ }, > }); > >- $("body").on("click", "#CheckAll", function(e){ >+ $("body").on("click", "#CheckAll", function (e) { > e.preventDefault(); >- $("input[type='checkbox']","#patron-list-table").each(function(){ >- $(this).prop("checked",1); >+ $("input[type='checkbox']", "#patron-list-table").each(function () { >+ $(this).prop("checked", 1); > }); > }); >- $("body").on("click", "#CheckNone", function(e){ >+ $("body").on("click", "#CheckNone", function (e) { > e.preventDefault(); >- $("input[type='checkbox']","#patron-list-table").each(function(){ >- $(this).prop("checked",0); >+ $("input[type='checkbox']", "#patron-list-table").each(function () { >+ $(this).prop("checked", 0); > }); > }); > >- $("#remove_patrons").submit(function(){ >+ $("#remove_patrons").submit(function () { > var checkedItems = $("input:checked"); > if ($(checkedItems).size() == 0) { > alert(_("You must select one or more patrons to remove")); > return false; > } >- $(checkedItems).parents('tr').addClass("warn"); >- if( confirm(_("Are you sure you want to remove the selected patrons?")) ) { >+ $(checkedItems).parents("tr").addClass("warn"); >+ if (confirm(_("Are you sure you want to remove the selected patrons?"))) { > return true; > } else { >- $(checkedItems).parents('tr').removeClass("warn"); >+ $(checkedItems).parents("tr").removeClass("warn"); > return false; > } > }); > >- $("#add_patrons_by_id a").on("click", function(){ >+ $("#add_patrons_by_id a").on("click", function () { > $("#add_patrons_by_id, #patron_search_line").hide(); > $("#add_patrons_by_search, #patron_ids_line, #patron_ids_submit").show(); > }); > >- $("#add_patrons_by_search a").on("click", function(){ >+ $("#add_patrons_by_search a").on("click", function () { > $("#add_patrons_by_id, #patron_search_line").show(); > $("#add_patrons_by_search, #patron_ids_line, #patron_ids_submit").hide(); > }); > >- $('.merge-patrons').on('click', function() { >+ $(".merge-patrons").on("click", function () { > var checkedItems = $("input:checked"); > if ($(checkedItems).length < 2) { > alert(_("You must select two or more patrons to merge")); > return false; > } >- $(checkedItems).parents('tr').addClass("warn"); >+ $(checkedItems).parents("tr").addClass("warn"); > if (confirm(_("Are you sure you want to merge the selected patrons?"))) { >- var merge_patrons_url = '/cgi-bin/koha/members/merge-patrons.pl?' + >- $('.selection:checked') >- .map(function() { >- return "id=" + $( '#borrowernumber_' + $(this).val() ).val() >- }).get().join('&'); >+ var merge_patrons_url = >+ "/cgi-bin/koha/members/merge-patrons.pl?" + >+ $(".selection:checked") >+ .map(function () { >+ return "id=" + $("#borrowernumber_" + $(this).val()).val(); >+ }) >+ .get() >+ .join("&"); > > window.location.href = merge_patrons_url; > return false; > } else { >- $(checkedItems).parents('tr').removeClass("warn"); >+ $(checkedItems).parents("tr").removeClass("warn"); > return false; > } > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt >index 6c24d13acec..c1c164e143f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt >@@ -166,9 +166,8 @@ > const interface = "[% interface | html %]"; > const theme = "[% theme | html %]"; > </script> >- > <script> >- $(document).ready(function() { >+ $(document).ready(function () { > var patronExportModal = $("#patronExportModal"); > var patronExportModalBody = $("#patronExportModal .modal-body"); > >@@ -177,62 +176,61 @@ > $("#patron-lists-table").kohaTable({ > autoWidth: false, > pagingType: "full", >- order: [[ 1, "asc" ]] >+ order: [[1, "asc"]], > }); > >- $(".delete_patron").on("click", function(){ >+ $(".delete_patron").on("click", function () { > $(".dropdown").removeClass("open"); > var list = $(this).data("list-name"); >- return confirmDelete( _("Are you sure you want to delete the list %s?").format(list)); >+ return confirmDelete(_("Are you sure you want to delete the list %s?").format(list)); > }); > >- $("#patrons_lists_form").submit(function(){ >+ $("#patrons_lists_form").submit(function () { > var checkedItems = $("input[name=patron_lists_ids]:checked"); >- if ( checkedItems.size() == 0) { >+ if (checkedItems.size() == 0) { > alert(_("You must select one or more lists to delete")); > return false; > } >- if( confirm(_("Are you sure you want to delete the selected lists?")) ) { >+ if (confirm(_("Are you sure you want to delete the selected lists?"))) { > return true; > } else { > return false; > } > }); > >- $(document).on("click", ".select_list", function() { >+ $(document).on("click", ".select_list", function () { > var checkedItems = $("input[name=patron_lists_ids]:checked"); >- if ( checkedItems.size() == 0 ) { >+ if (checkedItems.size() == 0) { > $("#delete_selected_lists").addClass("disabled").prop("disabled", true); > } else { > $("#delete_selected_lists").removeClass("disabled").prop("disabled", false); > } > }); > >- $(".print_cards").on("click", function(e){ >+ $(".print_cards").on("click", function (e) { > e.preventDefault(); > var page = $(this).attr("href"); > patronExportModalBody.load(page + " #exportingf"); > patronExportModal.modal("show"); > }); > >- patronExportModal.on("hidden.bs.modal", function(){ >- patronExportModalBody.html("<div id=\"loading\"><img src=\"" + interface + "/" + theme + "/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); >+ patronExportModal.on("hidden.bs.modal", function () { >+ patronExportModalBody.html('<div id="loading"><img src="' + interface + "/" + theme + '/img/spinner-small.gif" alt="" /> ' + _("Loading") + "</div>"); > }); > >- patronExportModal.on("submit", "#exportingf", function(e){ >+ patronExportModal.on("submit", "#exportingf", function (e) { > e.preventDefault(); > modal_body = patronExportModalBody; >- modal_body.html("<div id=\"loading\"><img src=\"" + interface + "/" + theme + "/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); >+ modal_body.html('<div id="loading"><img src="' + interface + "/" + theme + '/img/spinner-small.gif" alt="" /> ' + _("Loading") + "</div>"); > target_url = $(this).attr("action"); >- params = $( this ).serialize(); >- $("#patronExportModal .modal-body").load( target_url + "?" + params + " #export_patron_list"); >+ params = $(this).serialize(); >+ $("#patronExportModal .modal-body").load(target_url + "?" + params + " #export_patron_list"); > }); > >- patronExportModal.on("click",".btn-close",function(e){ >+ patronExportModal.on("click", ".btn-close", function (e) { > e.preventDefault(); > patronExportModal.modal("hide"); > }); >- > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt >index 722c2e2e724..1f0ce7c3a18 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt >@@ -127,7 +127,6 @@ > CAN_user_tools_manage_patron_lists: [% CAN_user_tools_manage_patron_lists ? 1 : 0 | html %], > }); > </script> >- > <script> > var patron_lists_dt_params = { > sPaginationType: "full", >-- >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 41573
:
191139
|
191140
|
191141
| 191142