Bugzilla – Attachment 9694 Details for
Bug 8125
SIP should send Zipcode with address
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-8125-Sip-addess-should-include-all-address-field.patch (text/plain), 1.89 KB, created by
Colin Campbell
on 2012-05-22 10:20:22 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2012-05-22 10:20:22 UTC
Size:
1.89 KB
patch
obsolete
>From 95ced8e8515e04991acb690d3d495535e410df70 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Tue, 22 May 2012 11:11:33 +0100 >Subject: [PATCH] Bug 8125 Sip addess should include all address fields > >Expansion of Liz Rea's original patch >Bug report specifically mentioned kack of the >Zip/Postal code but all used address fields should >be included. Moved the address >generation to its own sub. >Hopefully using an if else will read more clearly than >the original ternary operator proved to be >--- > C4/SIP/ILS/Patron.pm | 22 +++++++++++++++++++--- > 1 files changed, 19 insertions(+), 3 deletions(-) > >diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm >index 99fd6e7..38b7da3 100644 >--- a/C4/SIP/ILS/Patron.pm >+++ b/C4/SIP/ILS/Patron.pm >@@ -59,13 +59,11 @@ sub new { > $kp->{opacnote} .= 'PATRON EXPIRED'; > } > my %ilspatron; >- my $adr = $kp->{streetnumber} || ''; >- my $address = $kp->{address} || ''; >+ my $adr = _get_address($kp); > my $dob = $kp->{dateofbirth}; > $dob and $dob =~ s/-//g; # YYYYMMDD > my $dexpiry = $kp->{dateexpiry}; > $dexpiry and $dexpiry =~ s/-//g; # YYYYMMDD >- $adr .= ($adr && $address) ? " $address" : $address; > my $fines_amount = $flags->{CHARGES}->{amount}; > $fines_amount = ($fines_amount and $fines_amount > 0) ? $fines_amount : 0; > { >@@ -350,6 +348,24 @@ sub charge_denied { > return "Please contact library staff"; > } > >+sub _get_address { >+ my $patron = shift; >+ >+ my $address = $patron->{streetnumber} || q{}; >+ for my $field (qw( roaddetails address address2 city state zipcode country)) >+ { >+ next unless $patron->{$field}; >+ if ($address) { >+ $address .= q{ }; >+ $address .= $patron->{$field}; >+ } >+ else { >+ $address .= $patron->{$field}; >+ } >+ } >+ return $address; >+} >+ > 1; > __END__ > >-- >1.7.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8125
:
9647
|
9694
|
10590
|
14169
|
21884
|
23263