From 9ae733b9a49522bd12218eb47d2a3fe37397ac7b Mon Sep 17 00:00:00 2001 From: Stefan Berndtsson Date: Mon, 15 Jan 2018 14:20:06 +0100 Subject: [PATCH] Add option to send permanent_location as AQ in SIP response https://bugs.koha-community.org/show_bug.cgi?id=20058 --- C4/SIP/ILS/Item.pm | 6 +++++- installer/data/mysql/atomicupdate/sip-send-location-code.sql | 2 ++ .../prog/en/modules/admin/preferences/circulation.pref | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/sip-send-location-code.sql diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 240e199..4215103 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -82,7 +82,11 @@ sub new { } my $self = $item->unblessed; $self->{ 'id' } = $item->barcode; # to SIP, the barcode IS the id. - $self->{permanent_location}= $item->homebranch; + if(C4::Context->preference('UseLocationAsAQInSIP')) { + $self->{permanent_location}= $item->permanent_location; + } else { + $self->{permanent_location}= $item->homebranch; + } $self->{'collection_code'} = $item->ccode; $self->{ 'call_number' } = $item->itemcallnumber; diff --git a/installer/data/mysql/atomicupdate/sip-send-location-code.sql b/installer/data/mysql/atomicupdate/sip-send-location-code.sql new file mode 100644 index 0000000..4b6442f --- /dev/null +++ b/installer/data/mysql/atomicupdate/sip-send-location-code.sql @@ -0,0 +1,2 @@ +INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type`) VALUES +('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 6589e3e..3876f14 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -498,6 +498,13 @@ Circulation: yes: Cumulate no: "Don't cumulate" - the restriction periods. + - + - Use + - pref: UseLocationAsAQInSIP + choices: + yes: permanent_location + no: homebranch + - for AQ field in SIP protocol. Holds Policy: - - pref: AllowHoldItemTypeSelection -- 2.7.4