Bugzilla – Attachment 132596 Details for
Bug 20517
Use the "sort bin" field in SIP2 Checkin Response
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20517: (QA follow-up) Add ability to override syspref with account level settings in SIP config file
Bug-20517-QA-follow-up-Add-ability-to-override-sys.patch (text/plain), 2.67 KB, created by
Kyle M Hall (khall)
on 2022-03-30 12:30:58 UTC
(
hide
)
Description:
Bug 20517: (QA follow-up) Add ability to override syspref with account level settings in SIP config file
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-03-30 12:30:58 UTC
Size:
2.67 KB
patch
obsolete
>From 1a84a25b4a671a7e2f659542053536ff56ec695b Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Wed, 30 Mar 2022 08:27:59 -0400 >Subject: [PATCH] Bug 20517: (QA follow-up) Add ability to override syspref > with account level settings in SIP config file > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/SIP/ILS/Transaction/Checkin.pm | 19 +++++++++++++------ > etc/SIPconfig.xml | 3 +++ > 2 files changed, 16 insertions(+), 6 deletions(-) > >diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm >index 0e3babe023..c420c2a63a 100644 >--- a/C4/SIP/ILS/Transaction/Checkin.pm >+++ b/C4/SIP/ILS/Transaction/Checkin.pm >@@ -170,7 +170,7 @@ sub do_checkin { > > # Set sort bin based on info in the item associated with the issue, and the > # mapping from SIP2SortBinMapping >- $self->sort_bin( _get_sort_bin( $item, $branch ) ); >+ $self->sort_bin( _get_sort_bin( $item, $branch, $account ) ); > > $self->ok($return); > >@@ -231,13 +231,20 @@ Returns the ID of the appropriate sort_bin, if there is one, or undef. > sub _get_sort_bin { > > # We should get an item represented as a hashref here >- my ( $item, $branch ) = @_; >+ my ( $item, $branch, $account ) = @_; > return unless $item; > >- # Get the mapping and split on newlines >- my $raw_map = C4::Context->preference('SIP2SortBinMapping'); >- return unless $raw_map; >- my @lines = split /\r\n/, $raw_map; >+ my @lines; >+ # Mapping in SIP config takes precedence over syspref >+ if ( my $mapping = $account->{sort_bin_mapping} ) { >+ @lines = map { $_->{mapping} } @$mapping; >+ } >+ else { >+ # Get the mapping and split on newlines >+ my $raw_map = C4::Context->preference('SIP2SortBinMapping'); >+ return unless $raw_map; >+ @lines = split /\r\n/, $raw_map; >+ } > > # Iterate over the mapping. The first hit wins. > my $rule = 0; >diff --git a/etc/SIPconfig.xml b/etc/SIPconfig.xml >index 9e94594bdd..c4f174d9f5 100644 >--- a/etc/SIPconfig.xml >+++ b/etc/SIPconfig.xml >@@ -73,6 +73,9 @@ > prevcheckout_block_checkout="0" > overdues_block_checkout="1" > format_due_date="0"> >+ <!-- Refer to syspref SIP2SortBinMapping for full explanation of sort bin mapping --> >+ <sort_bin_mapping mapping="CPL:itype:eq:BK:1"/> >+ <sort_bin_mapping mapping="CPL:location:eq:OFFICE:2"/> > <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?" /> > <patron_attribute field="XY" code="CODE" /> >-- >2.30.2
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 20517
:
75126
|
75369
|
103689
|
106291
|
129846
|
129847
|
129848
|
129849
|
129850
|
129851
|
129852
|
129853
|
129854
|
129855
|
132555
|
132556
|
132557
|
132558
|
132559
|
132591
|
132592
|
132593
|
132594
|
132595
| 132596