Bugzilla – Attachment 191706 Details for
Bug 41580
Tidy kohaTable block - tools
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41580: (follow-up) Fixes for errors
Bug-41580-follow-up-Fixes-for-errors.patch (text/plain), 6.84 KB, created by
Owen Leonard
on 2026-01-20 15:26:12 UTC
(
hide
)
Description:
Bug 41580: (follow-up) Fixes for errors
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2026-01-20 15:26:12 UTC
Size:
6.84 KB
patch
obsolete
>From c44428ce53e19a726f9fe709eff67678fe9190da Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 20 Jan 2026 09:27:08 -0500 >Subject: [PATCH] Bug 41580: (follow-up) Fixes for errors > >- In Cataloging -> Manage staged MARC records: the logic around showing > the "Edit" button was not correct >- In Tools -> Batch patron modification: There was sometimes an error in > the console about a variable not existing which can be resolved by > moving the corresponding (and related) JS into the conditional which > depends on the table of results existing. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../en/modules/tools/manage-marc-import.tt | 15 ++-- > .../prog/en/modules/tools/modborrowers.tt | 68 ++++++++++--------- > 2 files changed, 43 insertions(+), 40 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >index 472d5d80ac7..1708a7e0ec7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >@@ -588,15 +588,12 @@ > '<a href="' + aData['diff_url'] + '">' + _("View") + '</a>' > ); > } >- if (aData['matched']) { >- $('td:eq(6)', nRow).html( >- '<a class="btn btn-default btn-xs" target="_blank" href="' + record_details_url >- + aData['matched'] + '"><i class="fa-solid fa-eye"></i> ' + _("View") + '</a> ' >- if (perms.CAN_user_editcatalogue_edit_catalogue){ >- + '<a class="btn btn-default btn-xs" target="_blank" href="' + record_edit_url >- + aData['matched'] + '"><i class="fa-solid fa-pencil" aria-hidden="true"></i> ' + _("Edit") + '</a>' >- } >- ); >+ if (aData["matched"]) { >+ let buttons = '<a class="btn btn-default btn-xs" target="_blank" href="' + record_details_url + aData["matched"] + '"><i class="fa-solid fa-eye"></i> ' + _("View") + "</a> "; >+ if (permissions.CAN_user_editcatalogue_edit_catalogue) { >+ buttons += '<a class="btn btn-default btn-xs" target="_blank" href="' + record_edit_url + aData["matched"] + '"><i class="fa-solid fa-pencil" aria-hidden="true"></i> ' + _("Edit") + "</a>"; >+ } >+ $("td:eq(6)", nRow).html(buttons); > } > }, > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >index 5cca9f84fed..de8d9c78ce2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >@@ -567,28 +567,46 @@ > }); > return false; > }); >- } > >- $('select[name="patron_attributes"]').change(function () { >- updateAttrValues(this); >- }); >+ $('select[name="patron_attributes"]').change(function() { >+ updateAttrValues(this); >+ } ); > >- $('select[name="patron_attributes"]').change(); >+ $('select[name="patron_attributes"]').change(); > >- $(".clear-date").on("click", function (e) { >- e.preventDefault(); >- var fieldID = this.id.replace("clear-date-", ""); >- $("#" + fieldID).val(""); >- }); >- $("#cataloguing_additem_newitem").on("click", ".add_attributes", function (e) { >- e.preventDefault(); >- add_attributes(); >- }); >- $("#cataloguing_additem_newitem").on("click", ".del_attributes", function (e) { >- e.preventDefault(); >- del_attributes(this); >- }); >- $("#patron_batchmod_form").on("submit", function () { >+ $(".clear-date").on("click",function(e){ >+ e.preventDefault(); >+ var fieldID = this.id.replace("clear-date-",""); >+ $("#" + fieldID).val(""); >+ }); >+ $("#cataloguing_additem_newitem").on("click",".add_attributes",function(e){ >+ e.preventDefault(); >+ add_attributes(); >+ }); >+ $("#cataloguing_additem_newitem").on("click",".del_attributes",function(e){ >+ e.preventDefault(); >+ del_attributes(this); >+ }); >+ >+ $('form[name="f"]').on("submit", function(){ >+ // Add the checkboxes to the DOM before we submit the form >+ var form = this; >+ var checkboxes = $(patron_table).find('input:checkbox:checked').serializeArray(); >+ $.each(checkboxes, function(){ >+ let borrowernumber = this.value; >+ if(!$(form).find('input[name="borrowernumber"][value="'+borrowernumber+'"]').length){ >+ $(form).append( >+ $('<input>') >+ .attr('type', 'hidden') >+ .attr('name', 'borrowernumber') >+ .val(borrowernumber) >+ ); >+ } >+ }); >+ }); >+ } >+ >+ $("#patron_batchmod_form").on("submit", function(){ > /* Reset form fields on inactive tabs */ > var tab = $(this).find("ul.nav-tabs li a.active").attr("href"); > if (tab == "#usecardnumber_panel") { >@@ -600,18 +618,6 @@ > $("#borrowernumberuploadfile, #cardnumberuploadfile, #borrowernumberlist, #cardnumberlist").val(""); > } > }); >- >- $('form[name="f"]').on("submit", function () { >- // Add the checkboxes to the DOM before we submit the form >- var form = this; >- var checkboxes = $(patron_table).find("input:checkbox:checked").serializeArray(); >- $.each(checkboxes, function () { >- let borrowernumber = this.value; >- if (!$(form).find('input[name="borrowernumber"][value="' + borrowernumber + '"]').length) { >- $(form).append($("<input>").attr("type", "hidden").attr("name", "borrowernumber").val(borrowernumber)); >- } >- }); >- }); > }); > > function updateAttrValues(select_attr) { >-- >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 41580
:
191163
|
191164
|
191165
|
191166
|
191167
|
191168
|
191169
|
191170
|
191171
|
191697
|
191698
|
191699
|
191700
|
191701
|
191702
|
191703
|
191704
|
191705
| 191706 |
191707