From 87ce94130abb2743a402f82f536649991163d635 Mon Sep 17 00:00:00 2001 From: Stefan Berndtsson Date: Mon, 15 Jan 2018 14:20:06 +0100 Subject: [PATCH] Bug 20058: Add option to send permanent_location as AQ in SIP response --- C4/SIP/ILS/Item.pm | 6 +++++- .../bug_20058_add_UseLocationAsAQInSIP_syspref.pl | 13 +++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../en/modules/admin/preferences/circulation.pref | 9 +++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_20058_add_UseLocationAsAQInSIP_syspref.pl diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 48df606cad..e627d7ac86 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -85,7 +85,11 @@ sub new { my $self = $item->unblessed; $self->{_object} = $item; $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; $self->{'shelving_location'} = $item->location; diff --git a/installer/data/mysql/atomicupdate/bug_20058_add_UseLocationAsAQInSIP_syspref.pl b/installer/data/mysql/atomicupdate/bug_20058_add_UseLocationAsAQInSIP_syspref.pl new file mode 100644 index 0000000000..be8dd450ab --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20058_add_UseLocationAsAQInSIP_syspref.pl @@ -0,0 +1,13 @@ +use Modern::Perl; + +return { + bug_number => "20058", + description => "Option to use shelving location instead of homebranch for sorting", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + $dbh->do(q{INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES +('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo')}); + say $out "Syspref UseLocationAsAQInSIP has been added"; + }, +} diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 59db857ca6..bf77604286 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -719,6 +719,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('useDischarge','0','','Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'), ('UseEmailReceipts','0','','Send email receipts for payments and write-offs','YesNo'), ('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'), +('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'), ('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'), ('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'), ('viewISBD','1','','Allow display of ISBD view of bibiographic records','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 fc07ec1ed6..c4bb694306 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 @@ -655,10 +655,19 @@ Circulation: - pref: StoreLastBorrower default: 0 choices: + - 1: Store 0: "Don't store" - 'the last patron to return an item. This setting is independent of the opacreadinghistory and AnonymousPatron system preferences.' Holds policy: + - + - Use + - pref: UseLocationAsAQInSIP + choices: + yes: permanent_location + no: homebranch + - for AQ field in SIP protocol. + Holds Policy: - - In the staff interface, split the holds queue into separate tables by - pref: HoldsSplitQueue -- 2.20.1