From 1b09317a9914978c42821c8f30207bf025350c60 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sat, 25 Oct 2014 12:48:33 -0400 Subject: [PATCH] Add output of phone numbers in NCIP::ILS::Evergreen->lookupuser. Signed-off-by: Jason Stephenson --- lib/NCIP/ILS/Evergreen.pm | 41 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/lib/NCIP/ILS/Evergreen.pm b/lib/NCIP/ILS/Evergreen.pm index 4b444bd..db908a7 100644 --- a/lib/NCIP/ILS/Evergreen.pm +++ b/lib/NCIP/ILS/Evergreen.pm @@ -1339,17 +1339,54 @@ sub handle_user_elements { } # Right now, we're only sharing email address if the user - # has it. We don't share phone numbers. + # has it. if ($user->email()) { my $address = NCIP::User::AddressInformation->new({UserAddressRoleType=>'Email Address'}); $address->ElectronicAddress( NCIP::ElectronicAddress->new({ - Type=>'Email Address', + Type=>'mailto', Data=>$user->email() }) ); push @$addresses, $address; } + # Auto-graphics asked for the phone numbers. + if ($user->day_phone()) { + my $address = NCIP::User::AddressInformation->new({UserAddressRoleType=>'Day Phone'}); + $address->ElectronicAddress( + NCIP::ElectronicAddress->new( + { + Type=>'Day Phone', + Data=>$user->day_phone() + } + ) + ); + push @$adresses, $address; + } + if ($user->evening_phone()) { + my $address = NCIP::User::AddressInformation->new({UserAddressRoleType=>'Evening Phone'}); + $address->ElectronicAddress( + NCIP::ElectronicAddress->new( + { + Type=>'Evening Phone', + Data=>$user->evening_phone() + } + ) + ); + push @$adresses, $address; + } + if ($user->other_phone()) { + my $address = NCIP::User::AddressInformation->new({UserAddressRoleType=>'Other Phone'}); + $address->ElectronicAddress( + NCIP::ElectronicAddress->new( + { + Type=>'Other Phone', + Data=>$user->other_phone() + } + ) + ); + push @$adresses, $address; + } $optionalfields->UserAddressInformation($addresses); } -- 2.43.2