[open-ils-commits] [GIT] Evergreen ILS branch master updated. 52b09a619b1cd8475e88bab16bd1efa5917a33ea

Evergreen Git git at git.evergreen-ils.org
Thu May 25 09:09:12 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  52b09a619b1cd8475e88bab16bd1efa5917a33ea (commit)
       via  1c6b0d4895d817542e4d5193b1ca36372d8cd4f4 (commit)
       via  c1ac4845ba1bdebad903b650791d691694dd6c6d (commit)
      from  58579e840f471109abae23b28aa85a7c35ff992b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 52b09a619b1cd8475e88bab16bd1efa5917a33ea
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Thu May 18 22:38:33 2017 -0400

    LP1574141: add release notes
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/docs/RELEASE_NOTES_NEXT/API/Batch_contact_invalidation.adoc b/docs/RELEASE_NOTES_NEXT/API/Batch_contact_invalidation.adoc
new file mode 100644
index 0000000..90b2fd9
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/API/Batch_contact_invalidation.adoc
@@ -0,0 +1,15 @@
+Batch Patron Contact Invalidation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The following methods are used to mark patron contact fields
+as invalid by moving the invalid value to a standing penalty:
+
+ * `open-ils.actor.invalidate.email`
+ * `open-ils.actor.invalidate.day_phone`
+ * `open-ils.actor.invalidate.evening_phone`
+ * `open-ils.actor.invalidate.other_phone`
+
+These methods now accept a fifth argument specifying the value
+of the contact field, e.g., a specific phone number or email
+address. If supplied, and if a specific patron ID (the first
+argument) is not supplied, all patrons with that specific contact
+value will have it marked invalid.

commit 1c6b0d4895d817542e4d5193b1ca36372d8cd4f4
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Thu May 18 22:28:49 2017 -0400

    LP1574141: minor code tweaks
    
    - return the BAD_PARAMS event if client provides neither patron ID
      nor contact value
    - more precisely identify missing parameters
    - standardize indentation
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
index ba5868c..6cc2e8b 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
@@ -4792,14 +4792,13 @@ sub mark_users_contact_invalid {
     return $e->die_event unless $e->checkauth;
     
     my $howfind = {};
-    if ($patron_id){
+    if (defined $patron_id && $patron_id ne "") {
         $howfind = {usr => $patron_id};
-    }
-    elsif ($contact){
+    } elsif (defined $contact && $contact ne "") {
         $howfind = {$contact_type => $contact};
-    }
-    else{ #Error out if no patron id set or no contact is set.
-        return $e->die_event;
+    } else {
+        # Error out if no patron id set or no contact is set.
+        return OpenILS::Event->new('BAD_PARAMS');
     }
  
     return OpenILS::Utils::BadContact->mark_users_contact_invalid(

commit c1ac4845ba1bdebad903b650791d691694dd6c6d
Author: Josh Stompro <stomproj at larl.org>
Date:   Fri Jul 1 15:29:42 2016 -0500

    LP1574141 - Allow invalidate for all patrons with the same contact.
    
    Teach the open-ils.actor.invalidate.* methods to allow invalidating
    by the contact value, so all patrons with that contact value can have
    it invalidated with one call.
    
    This adds a new parameter for the contact value (email address, phone
    number).  Then all customers with that value have it invalidated from
    their account.
    
    This somewhat simplifies writing a cli script for invalidating email
    addresses since the script doesn't have to look up the user first.
    
    The ability to invalidate all with the same contact value was already
    there, it just wasn't exposed.
    
    Testing:
    
    1. Make sure the normal staff client invalidate buttons still work.
    2. Use srfsh to try the call with a contact value.
      request open-ils.actor open-ils.actor.invalidate.email "<authkey>" "" "" "" "test at email.com"
    
    Signed-off-by: Josh Stompro <stomproj at larl.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
index 0e936cf..ba5868c 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
@@ -4715,12 +4715,13 @@ __PACKAGE__->register_method(
     method   => "mark_users_contact_invalid",
     api_name => "open-ils.actor.invalidate.email",
     signature => {
-        desc => "Given a patron, clear the email field and put the old email address into a note and/or create a standing penalty, depending on OU settings",
+        desc => "Given a patron or email address, clear the email field for one patron or all patrons with that email address and put the old email address into a note and/or create a standing penalty, depending on OU settings",
         params => [
             {desc => "Authentication token", type => "string"},
-            {desc => "Patron ID", type => "number"},
+            {desc => "Patron ID (optional if Email address specified)", type => "number"},
             {desc => "Additional note text (optional)", type => "string"},
-            {desc => "penalty org unit ID (optional)", type => "number"}
+            {desc => "penalty org unit ID (optional)", type => "number"},
+            {desc => "Email address (optional)", type => "string"}
         ],
         return => {desc => "Event describing success or failure", type => "object"}
     }
@@ -4730,12 +4731,13 @@ __PACKAGE__->register_method(
     method   => "mark_users_contact_invalid",
     api_name => "open-ils.actor.invalidate.day_phone",
     signature => {
-        desc => "Given a patron, clear the day_phone field and put the old day_phone into a note and/or create a standing penalty, depending on OU settings",
+        desc => "Given a patron or phone number, clear the day_phone field for one patron or all patrons with that day_phone number and put the old day_phone into a note and/or create a standing penalty, depending on OU settings",
         params => [
             {desc => "Authentication token", type => "string"},
-            {desc => "Patron ID", type => "number"},
+            {desc => "Patron ID (optional if Phone Number specified)", type => "number"},
             {desc => "Additional note text (optional)", type => "string"},
-            {desc => "penalty org unit ID (optional)", type => "number"}
+            {desc => "penalty org unit ID (optional)", type => "number"},
+            {desc => "Phone Number (optional)", type => "string"}
         ],
         return => {desc => "Event describing success or failure", type => "object"}
     }
@@ -4745,12 +4747,13 @@ __PACKAGE__->register_method(
     method   => "mark_users_contact_invalid",
     api_name => "open-ils.actor.invalidate.evening_phone",
     signature => {
-        desc => "Given a patron, clear the evening_phone field and put the old evening_phone into a note and/or create a standing penalty, depending on OU settings",
+        desc => "Given a patron or phone number, clear the evening_phone field for one patron or all patrons with that evening_phone number and put the old evening_phone into a note and/or create a standing penalty, depending on OU settings",
         params => [
             {desc => "Authentication token", type => "string"},
-            {desc => "Patron ID", type => "number"},
+            {desc => "Patron ID (optional if Phone Number specified)", type => "number"},
             {desc => "Additional note text (optional)", type => "string"},
-            {desc => "penalty org unit ID (optional)", type => "number"}
+            {desc => "penalty org unit ID (optional)", type => "number"},
+            {desc => "Phone Number (optional)", type => "string"}
         ],
         return => {desc => "Event describing success or failure", type => "object"}
     }
@@ -4760,20 +4763,21 @@ __PACKAGE__->register_method(
     method   => "mark_users_contact_invalid",
     api_name => "open-ils.actor.invalidate.other_phone",
     signature => {
-        desc => "Given a patron, clear the other_phone field and put the old other_phone into a note and/or create a standing penalty, depending on OU settings",
+        desc => "Given a patron or phone number, clear the other_phone field for one patron or all patrons with that other_phone number and put the old other_phone into a note and/or create a standing penalty, depending on OU settings",
         params => [
             {desc => "Authentication token", type => "string"},
-            {desc => "Patron ID", type => "number"},
+            {desc => "Patron ID (optional if Phone Number specified)", type => "number"},
             {desc => "Additional note text (optional)", type => "string"},
             {desc => "penalty org unit ID (optional, default to top of org tree)",
-                type => "number"}
+                type => "number"},
+            {desc => "Phone Number (optional)", type => "string"}
         ],
         return => {desc => "Event describing success or failure", type => "object"}
     }
 );
 
 sub mark_users_contact_invalid {
-    my ($self, $conn, $auth, $patron_id, $addl_note, $penalty_ou) = @_;
+    my ($self, $conn, $auth, $patron_id, $addl_note, $penalty_ou, $contact) = @_;
 
     # This method invalidates an email address or a phone_number which
     # removes the bad email address or phone number, copying its contents
@@ -4786,9 +4790,20 @@ sub mark_users_contact_invalid {
 
     my $e = new_editor(authtoken => $auth, xact => 1);
     return $e->die_event unless $e->checkauth;
-
+    
+    my $howfind = {};
+    if ($patron_id){
+        $howfind = {usr => $patron_id};
+    }
+    elsif ($contact){
+        $howfind = {$contact_type => $contact};
+    }
+    else{ #Error out if no patron id set or no contact is set.
+        return $e->die_event;
+    }
+ 
     return OpenILS::Utils::BadContact->mark_users_contact_invalid(
-        $e, $contact_type, {usr => $patron_id},
+        $e, $contact_type, $howfind,
         $addl_note, $penalty_ou, $e->requestor->id
     );
 }

-----------------------------------------------------------------------

Summary of changes:
 .../src/perlmods/lib/OpenILS/Application/Actor.pm  |   44 +++++++++++++-------
 .../API/Batch_contact_invalidation.adoc            |   15 +++++++
 2 files changed, 44 insertions(+), 15 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/API/Batch_contact_invalidation.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list