From: Josh Stompro Date: Thu, 28 Feb 2019 16:41:01 +0000 (-0600) Subject: LP#1752334 - BadContact, use additional note if provided. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=766e09d70082477d824519d7daa198d816683602;p=working%2FEvergreen.git LP#1752334 - BadContact, use additional note if provided. If an additional note is provided when marking a contact invalid, then that note should be appended to the penalty note field. This change adds that functionality. This doesn't change the results for staff that are using the invalidate buttons in the client, since there isn't a chance to add an additional note from that interface. But if someone is calling open-ils.actor.invalidate.email via some other method, then you can specify the additional note. I would like to be able to add extra notes when automatically processing bounced emails, to give staff a clue as to why the email failed. Such as " Account over quota for past 3 weeks, ask patron to check their account." Testing plan: Before fix. 1. Choose a patron with an email address and note their patron id number. 2. Run an srfsh shell. 3. Login to get an auth token 'login username password' 4. Run the invalidate email command to mark the users email invalid, including an addition note value. srfsh# request open-ils.actor open-ils.actor.invalidate.email "" "" "Testing Additional Note" 5. Take a look at the patron account and see that the penalty message only includes a copy of the email address that was marked invalid. After fix. 1. Restart the opensrf actor service if needed to re-read the changed perl module. osrf_control -l --service open-ils.actor --restart 2. Remove the penalty and re-add email address to test patron's account. 3. Run an srfsh shell. 4. Login to get an auth token 'login username password' 5. Run the invalidate email command to mark the users email invalid, including an addition note value. srfsh# request open-ils.actor open-ils.actor.invalidate.email "" "" "Testing Additional Note" 6. Take a look at the patron account and see that the penalty message note now includes the additional note. Signed-off-by: Josh Stompro --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/BadContact.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/BadContact.pm index 28ee239d62..c4409b05c4 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/BadContact.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/BadContact.pm @@ -98,7 +98,7 @@ sub mark_users_contact_invalid { $usr_penalty->org_unit($penalty_ou); $usr_penalty->standing_penalty($penalty->id); $usr_penalty->staff($staff_id); - $usr_penalty->note($_->$contact_type); + $usr_penalty->note($addl_note ? $_->$contact_type.' '.$addl_note : $_->$contact_type); $editor->create_actor_user_standing_penalty($usr_penalty) or return $editor->die_event;