From e95e18b21be24cd8df990960acf33b4873704a3c 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 Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- 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 | 8 ++++++++ 4 files changed, 27 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 5d0a24a8c7..6069b6d46d 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -84,7 +84,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 c117b49a63..869fffe3c7 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -758,6 +758,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'), ('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'), ('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'), ('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','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 f99af038e8..bcdb4b2b88 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 @@ -1383,6 +1383,14 @@ Circulation: - pref: SIP2SortBinMapping type: textarea class: long + - + - Use + - pref: UseLocationAsAQInSIP + choices: + yes: permanent_location + no: homebranch + - for AQ field in SIP protocol. + Curbside pickup module: - - pref: CurbsidePickup -- 2.39.5