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

(-)a/C4/Items.pm (-5 / +7 lines)
Lines 2401-2411 sub PrepareItemrecordDisplay { Link Here
2401
2401
2402
                # search for itemcallnumber if applicable
2402
                # search for itemcallnumber if applicable
2403
                if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber'
2403
                if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber'
2404
                    && C4::Context->preference('itemcallnumber') ) {
2404
                    && C4::Context->preference('itemcallnumber') && $itemrecord) {
2405
                    my $CNtag      = substr( C4::Context->preference('itemcallnumber'), 0, 3 );
2405
                    foreach my $itemcn_pref (split(/,/,C4::Context->preference('itemcallnumber'))){
2406
                    my $CNsubfield = substr( C4::Context->preference('itemcallnumber'), 3, 1 );
2406
                        my $CNtag      = substr( $itemcn_pref, 0, 3 );
2407
                    if ( $itemrecord and my $field = $itemrecord->field($CNtag) ) {
2407
                        next unless my $field = $itemrecord->field($CNtag);
2408
                        $defaultvalue = $field->subfield($CNsubfield);
2408
                        my $CNsubfields = substr( $itemcn_pref, 3 );
2409
                        $defaultvalue = $field->as_string( $CNsubfields, ' ');
2410
                        last if $defaultvalue;
2409
                    }
2411
                    }
2410
                }
2412
                }
2411
                if (   $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber'
2413
                if (   $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber'
(-)a/cataloguing/additem.pl (-6 / +6 lines)
Lines 154-165 sub generate_subfield_form { Link Here
154
154
155
        my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
155
        my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
156
        if (!$value && $subfieldlib->{kohafield} eq 'items.itemcallnumber' && $pref_itemcallnumber) {
156
        if (!$value && $subfieldlib->{kohafield} eq 'items.itemcallnumber' && $pref_itemcallnumber) {
157
            my $CNtag       = substr( $pref_itemcallnumber, 0, 3 ); # 3-digit tag number
157
            foreach my $pref_itemcallnumber_part (split(/,/, $pref_itemcallnumber)){
158
            my $CNsubfields = substr( $pref_itemcallnumber, 3 ); # Any and all subfields
158
                my $CNtag       = substr( $pref_itemcallnumber_part, 0, 3 ); # 3-digit tag number
159
            my $temp2 = $temp->field($CNtag);
159
                my $CNsubfields = substr( $pref_itemcallnumber_part, 3 ); # Any and all subfields
160
                my $temp2 = $temp->field($CNtag);
160
161
161
            if ($temp2) {
162
                next unless $temp2;
162
                $value = $temp2->as_string( $CNsubfields, ' ' );
163
                $value = $temp2->as_string( $CNsubfields, ' ' );
164
                last if $value;
163
            }
165
            }
164
        }
166
        }
165
167
Lines 881-888 foreach my $subfield_code (sort keys(%witness)) { Link Here
881
my @loop_data =();
883
my @loop_data =();
882
my $i=0;
884
my $i=0;
883
885
884
my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
885
886
my $branch = $input->param('branch') || C4::Context->userenv->{branch};
886
my $branch = $input->param('branch') || C4::Context->userenv->{branch};
887
my $libraries = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later.
887
my $libraries = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later.
888
for my $library ( @$libraries ) {
888
for my $library ( @$libraries ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-3 / +2 lines)
Lines 72-80 Cataloging: Link Here
72
                  no: bibliographic record
72
                  no: bibliographic record
73
            - as the authoritative item type (for determining circulation and fines rules, for displaying an item type icon on either opac detail or results page, etc).
73
            - as the authoritative item type (for determining circulation and fines rules, for displaying an item type icon on either opac detail or results page, etc).
74
        -
74
        -
75
            - Map the MARC subfield
75
            - Map the MARC subfields
76
            - pref: itemcallnumber
76
            - pref: itemcallnumber
77
            - "to an item's callnumber. (This can contain multiple subfields to look in; for instance <code>082ab</code> would look in 082 subfields a and b.)<br />Examples (for MARC21 records): <strong>Dewey</strong>: <code>082ab</code> or <code>092ab</code>; <strong>LOC</strong>: <code>050ab</code> or <code>090ab</code>; <strong>from the item record</strong>: <code>852hi</code>"
77
            - "to an item's callnumber. List multiple comma-separated fields to check them sequentially. Each field can include multiple subfields. For example: '082ab,092ab' will look in the 082$a and 082$b, then the 092$a and 092$b. Examples (for MARC21 records): Dewey: 082ab,092ab; LOC: 050ab,090ab; from the item record: 952hi"
78
        -
78
        -
79
            - Display MARC subfield
79
            - Display MARC subfield
80
            - pref: AlternateHoldingsField
80
            - pref: AlternateHoldingsField
81
- 

Return to bug 3426