Bugzilla – Attachment 64578 Details for
Bug 16755
Allow SIP2 field DA (hold patron name) to be customized
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16755 - allow SIP2 field DA ( hold patron name ) to be customized
Bug-16755---allow-SIP2-field-DA--hold-patron-name-.patch (text/plain), 4.07 KB, created by
Marcel de Rooy
on 2017-06-23 07:22:00 UTC
(
hide
)
Description:
Bug 16755 - allow SIP2 field DA ( hold patron name ) to be customized
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-06-23 07:22:00 UTC
Size:
4.07 KB
patch
obsolete
>From e7de1b4a21b3ef59d4948a940d4c87ec2c425a53 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 29 Dec 2016 14:22:04 +0000 >Subject: [PATCH] Bug 16755 - allow SIP2 field DA ( hold patron name ) to be > customized >Content-Type: text/plain; charset=utf-8 > >The SIP2 DA field that Koha transmits is an odd and arbitrary format >that some SIP2 clients cannot handle. It would be best if this >format were customizable on a per-login basis in the same manner as >the AV field. > >Test Plan: >1) Find an item that is checked out with holds >2) Return the item via SIP2 ( using the SIP2 cli emulator ) >3) Note the value of the DA field >4) Apply this patch, restart your SIP2 server >5) Repeat step 2 >6) Note the DA field value has not changed >7) Add this parameter to the login stanza you are using: > da_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]" >8) Restart the SIP2 server again >9) Repeat step 2 >10) Note the DA field returned is now in the format "$surname, $firstname" > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Benjamin Daeuber <BDaeuber@cityoffargo.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/SIP/ILS/Item.pm | 18 +++++++++++++++--- > C4/SIP/Sip/MsgType.pm | 2 +- > etc/SIPconfig.xml | 1 + > 3 files changed, 17 insertions(+), 4 deletions(-) > >diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm >index 0649799..a6c735c 100644 >--- a/C4/SIP/ILS/Item.pm >+++ b/C4/SIP/ILS/Item.pm >@@ -11,6 +11,7 @@ use warnings; > > use Sys::Syslog qw(syslog); > use Carp; >+use Template; > > use C4::SIP::ILS::Transaction; > >@@ -23,7 +24,7 @@ use C4::Members; > use C4::Reserves; > use Koha::Database; > use Koha::Biblios; >- >+use Koha::Patrons; > > =encoding UTF-8 > >@@ -161,8 +162,19 @@ sub hold_patron_id { > > } > sub hold_patron_name { >- my $self = shift; >- my $borrowernumber = (@_ ? shift: $self->hold_patron_id()) or return; >+ my ( $self, $template ) = @_; >+ my $borrowernumber = $self->hold_patron_id() or return; >+ >+ if ($template) { >+ my $tt = Template->new(); >+ >+ my $patron = Koha::Patrons->find($borrowernumber); >+ >+ my $output; >+ $tt->process( \$template, { patron => $patron }, \$output ); >+ return $output; >+ } >+ > my $holder = GetMember(borrowernumber=>$borrowernumber); > unless ($holder) { > syslog("LOG_ERR", "While checking hold, GetMember failed for borrowernumber '$borrowernumber'"); >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index 7a1a1e3..1273c9f 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -671,7 +671,7 @@ sub handle_checkin { > $resp .= maybe_add( FID_CALL_NUMBER, $item->call_number ); > $resp .= maybe_add( FID_DESTINATION_LOCATION, $item->destination_loc ); > $resp .= maybe_add( FID_HOLD_PATRON_ID, $item->hold_patron_bcode ); >- $resp .= maybe_add( FID_HOLD_PATRON_NAME, $item->hold_patron_name ); >+ $resp .= maybe_add( FID_HOLD_PATRON_NAME, $item->hold_patron_name( $server->{account}->{da_field_template} ) ); > if ( $status->hold and $status->hold->{branchcode} ne $item->destination_loc ) { > warn 'SIP hold mismatch: $status->hold->{branchcode}=' . $status->hold->{branchcode} . '; $item->destination_loc=' . $item->destination_loc; > >diff --git a/etc/SIPconfig.xml b/etc/SIPconfig.xml >index db25975..80f667e 100644 >--- a/etc/SIPconfig.xml >+++ b/etc/SIPconfig.xml >@@ -51,6 +51,7 @@ > <login id="lpl-sc-beacock" password="xyzzy" > delimiter="|" error-detect="enabled" institution="LPL" > send_patron_home_library_in_af="1" >+ da_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]" > av_field_template="[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]" > > <screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" /> > <screen_msg_regex find="Invalid patron barcode." replace="Barcode not found, are you sure this is your library card?" /> >-- >2.1.4
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 16755
:
58488
|
58489
|
60875
| 64578