Bugzilla – Attachment 188657 Details for
Bug 41067
'OPAC mandatory' attribute setting requires 'Editable in OPAC' to work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41067: Disable OPAC mandatory when not editable
Bug-41067-Disable-OPAC-mandatory-when-not-editable.patch (text/plain), 3.30 KB, created by
Laura Escamilla
on 2025-10-30 14:07:13 UTC
(
hide
)
Description:
Bug 41067: Disable OPAC mandatory when not editable
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2025-10-30 14:07:13 UTC
Size:
3.30 KB
patch
obsolete
>From c2afd317620c4e51c671edd6732505f95bc4a425 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 23 Oct 2025 12:57:42 +0200 >Subject: [PATCH] Bug 41067: Disable OPAC mandatory when not editable > >If a patron attribute is not editable at the OPAC it should not be >possible to make it mandatory. > >Test plan: >Create a new patron attribute and confirm that checkboxes behaviour is >consistent. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >--- > .../en/modules/admin/patron-attr-types.tt | 46 ++++++++++++++----- > 1 file changed, 34 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >index 56ab6a79b9..f83cacf1fa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >@@ -408,6 +408,40 @@ > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'select2.inc' %] > <script> >+ const opac_display = document.getElementById("opac_display"); >+ const opac_editable = document.getElementById("opac_editable"); >+ const opac_mandatory = document.getElementById("opac_mandatory"); >+ >+ function setDisabled(el, disabled) { >+ const label = el.closest("label"); >+ if (disabled) { >+ el.checked = false; >+ el.disabled = true; >+ if (label) label.setAttribute("aria-disabled", "true"); >+ } else { >+ el.disabled = false; >+ if (label) label.removeAttribute("aria-disabled"); >+ } >+ } >+ >+ function updateCheckboxes() { >+ if (!opac_display.checked) { >+ setDisabled(opac_editable, true); >+ } else { >+ setDisabled(opac_editable, false); >+ } >+ if (opac_editable.checked) { >+ setDisabled(opac_mandatory, false); >+ } else { >+ setDisabled(opac_mandatory, true); >+ } >+ } >+ >+ opac_display.addEventListener("change", updateCheckboxes); >+ opac_editable.addEventListener("change", updateCheckboxes); >+ >+ updateCheckboxes(); >+ > $(document).ready(function () { > function toggle_search_default() { > if ($("#staff_searchable").is(":checked")) { >@@ -426,18 +460,6 @@ > $("#branches option:first").attr("selected", "selected"); > } > >- $("#opac_display") >- .change(function () { >- if (this.checked) { >- $("#opac_editable").removeAttr("disabled").parent().removeAttr("aria-disabled"); >- $("#opac_mandatory").removeAttr("disabled").parent().removeAttr("aria-disabled"); >- } else { >- $("#opac_editable").attr("disabled", true).parent().attr("aria-disabled", "true"); >- $("#opac_mandatory").attr("disabled", true).parent().attr("aria-disabled", "true"); >- } >- }) >- .change(); >- > $("#is_date") > .change(function () { > if (this.checked) { >-- >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 41067
:
188324
|
188420
|
188421
| 188657 |
188658