View | Details | Raw Unified | Return to bug 20517
Collapse All | Expand All

(-)a/C4/SIP/ILS/Transaction/Checkin.pm (-6 / +13 lines)
Lines 170-176 sub do_checkin { Link Here
170
170
171
    # Set sort bin based on info in the item associated with the issue, and the
171
    # Set sort bin based on info in the item associated with the issue, and the
172
    # mapping from SIP2SortBinMapping
172
    # mapping from SIP2SortBinMapping
173
    $self->sort_bin( _get_sort_bin( $item, $branch ) );
173
    $self->sort_bin( _get_sort_bin( $item, $branch, $account ) );
174
174
175
    $self->ok($return);
175
    $self->ok($return);
176
176
Lines 231-243 Returns the ID of the appropriate sort_bin, if there is one, or undef. Link Here
231
sub _get_sort_bin {
231
sub _get_sort_bin {
232
232
233
    # We should get an item represented as a hashref here
233
    # We should get an item represented as a hashref here
234
    my ( $item, $branch ) = @_;
234
    my ( $item, $branch, $account ) = @_;
235
    return unless $item;
235
    return unless $item;
236
236
237
    # Get the mapping and split on newlines
237
    my @lines;
238
    my $raw_map = C4::Context->preference('SIP2SortBinMapping');
238
    # Mapping in SIP config takes precedence over syspref
239
    return unless $raw_map;
239
    if ( my $mapping = $account->{sort_bin_mapping} ) {
240
    my @lines = split /\r\n/, $raw_map;
240
        @lines = map { $_->{mapping} } @$mapping;
241
    }
242
    else {
243
        # Get the mapping and split on newlines
244
        my $raw_map = C4::Context->preference('SIP2SortBinMapping');
245
        return unless $raw_map;
246
        @lines = split /\r\n/, $raw_map;
247
    }
241
248
242
    # Iterate over the mapping. The first hit wins.
249
    # Iterate over the mapping. The first hit wins.
243
    my $rule = 0;
250
    my $rule = 0;
(-)a/etc/SIPconfig.xml (-1 / +3 lines)
Lines 73-78 Link Here
73
             prevcheckout_block_checkout="0"
73
             prevcheckout_block_checkout="0"
74
             overdues_block_checkout="1"
74
             overdues_block_checkout="1"
75
             format_due_date="0">
75
             format_due_date="0">
76
          <!-- Refer to syspref SIP2SortBinMapping for full explanation of sort bin mapping -->
77
          <sort_bin_mapping mapping="CPL:itype:eq:BK:1"/>
78
          <sort_bin_mapping mapping="CPL:location:eq:OFFICE:2"/>
76
          <screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" />
79
          <screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" />
77
          <screen_msg_regex find="Invalid patron barcode." replace="Barcode not found, are you sure this is your library card?" />
80
          <screen_msg_regex find="Invalid patron barcode." replace="Barcode not found, are you sure this is your library card?" />
78
          <patron_attribute field="XY" code="CODE" />
81
          <patron_attribute field="XY" code="CODE" />
79
- 

Return to bug 20517