From 83f125a0b2f0c4fcb59b9903eca84e9b738ed073 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. --- .../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 d53210cea3..ced1b30f1d 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 @@ -333,6 +333,7 @@ Library limitation Authorized value category Mandatory + Mandatory - OPAC Searching Actions @@ -373,6 +374,13 @@ No [% END %] + + [% IF ( item.opac_mandatory ) -%] + Yes + [% ELSE -%] + No + [% END %] + [% IF ( item.staff_searchable ) %] [% IF( item.searched_by_default ) %] @@ -441,8 +449,10 @@ $("#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(); -- 2.39.2