From 1b9a4d97545dafb9cbdd2f08f516375a9d393a5f 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 Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer (cherry picked from commit 855b8bc66e3bf1d012d0caeab938556eb520fd51) Signed-off-by: Fridolin Somers (cherry picked from commit 0a8908bddb1a75f539e596893a257de0aac24fa6) Signed-off-by: Lucas Gass --- 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 9f78956dd3..2d7f7478b1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -197,6 +197,7 @@ + [% ELSE %] +
+

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

+
+ [% END %]