From f58b22b2e9afcffc5b85cb190dd5067535aad698 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 6 Jun 2024 13:26:54 +0000 Subject: [PATCH] Bug 35635: Add opac_mandatory to patron attribute table To test: 1. Before applying the patch go to Adminstration > Patron attribute types 2. Create or modify some attributes to be mandatory and some to not be mandatory. 3. APPLY PATCH, updatedatabase, restart_all 4. Go back to Adminstration > Patron attribute types. The patron attributes that were made mandatory should now also have the opac_mandatory field checked. 5. Make sure that you can change the correctly save the new "OPAC mandatory:" field. 6. If the 'Display in OPAC:' field is unchecked the 'OPAC mandatory:' checkbox should be disabled. 7. Mark some patron attributes as 'OPAC mandatory:'. 8. Go to the OPAC self reg page, the field should be required. 9. BAck on Adminstration > Patron attribute types check some attributes as 'OPAC mandatory:' and 'Editable in OPAC:'. 10. As a logged in OPAC user go to "Personal details" and make sure the attribute is required. 11. For the same attriubute as step 9-10 , mark as NOT 'Editable in OPAC:'. Make sure you can still save the form on the OPAC "Personal details" page. Signed-off-by: Brendan Lawlor Signed-off-by: Jonathan Druart --- .../prog/en/modules/admin/patron-attr-types.tt | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 f2984b07d9b..836c6b59821 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 @@ -328,6 +328,7 @@ Library limitation Authorized value category Mandatory + Mandatory - OPAC Searching Actions @@ -369,6 +370,13 @@ No [% END %] + + [% IF ( item.opac_mandatory ) -%] + Yes + [% ELSE -%] + No + [% END %] + [% IF ( item.staff_searchable ) %] [% IF( item.searched_by_default ) %] @@ -424,8 +432,10 @@ .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(); -- 2.39.5