From b4630994a2db3a67c1857ef73248542239f025ff Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 16 Nov 2023 05:08:30 +0000 Subject: [PATCH] Bug 35344: Warn on patron image upload if missing cardnumber This change displays a warning message instead of the patron image upload feature in the patron record when the patron is missing the cardnumber. Without this change, the staff user can try to upload a patron image but it will silently fail. This change warns the staff user of the cardnumber requirement for patron image upload. Test plan: 0. Apply the patch 1. Enable the "patronimages" system preference 2. Go to http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51 3. Click "Add" over the patron image placeholder 4. Note the "Upload photo" button and the ability to take a patron photo if your device has a camera 5. Remove "cardnumber" from BorrowerMandatoryField 6. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51 7. Edit the patron to remove the cardnumber 8. Click "Add" over the patron image placeholder 9. Note that no patron image upload features appear. Instead, only a warning appears stating that the patron needs a cardnumber before the patron image upload can be performed --- koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc | 6 ++++++ koha-tmpl/intranet-tmpl/prog/js/members-menu.js | 2 +- koha-tmpl/intranet-tmpl/prog/js/patron-webcam.js | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index ead8c18fbe..6b1f791101 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -200,6 +200,7 @@ + [% ELSE %] +
+

The patron must have a cardnumber before a patron photo can be uploaded.

+
+ [% END %]