Bug 12523 - Add patron email in Holds awaiting pickup circulation rapport
authorsimith <simith@inlibro.com>
Thu, 3 Jul 2014 12:32:32 +0000 (08:32 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 7 Aug 2014 19:18:23 +0000 (16:18 -0300)
Modified:

circ/waitingreservers.pl    - added GetFirstValidEmailAddress

Testing:

I Apply the patch

0) Put an item in hold for pickup;
1) In Circulation -> Holds awaiting pickup, validate email (column Patron);

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described and will use the first valid email address.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
circ/waitingreserves.pl

index b7b890d..07190a1 100755 (executable)
@@ -128,10 +128,13 @@ foreach my $num (@getreserves) {
     $getreserv{'borrowername'}      = $getborrower->{'surname'};
     $getreserv{'borrowerfirstname'} = $getborrower->{'firstname'};
     $getreserv{'borrowerphone'}     = $getborrower->{'phone'};
-    if ( $getborrower->{'emailaddress'} ) {
-        $getreserv{'borrowermail'}  = $getborrower->{'emailaddress'};
+
+    my $borEmail = GetFirstValidEmailAddress( $borrowernum );
+
+    if ( $borEmail ) {
+        $getreserv{'borrowermail'}  = $borEmail;
     }
+
     if ($today > $calcDate) {
         if ($cancelall) {
             my $res = cancel( $itemnumber, $borrowernum, $holdingbranch, $homebranch, !$transfer_when_cancel_all );