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

(-)a/cataloguing/additem.pl (-10 / +1 lines)
Lines 156-173 sub generate_subfield_form { Link Here
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
            my $CNtag       = substr( $pref_itemcallnumber, 0, 3 ); # 3-digit tag number
158
            my $CNsubfields = substr( $pref_itemcallnumber, 3 ); # Any and all subfields
158
            my $CNsubfields = substr( $pref_itemcallnumber, 3 ); # Any and all subfields
159
            my @subfields = ( $CNsubfields =~ m/./g ); # Split into single-character elements
160
            my $temp2 = $temp->field($CNtag);
159
            my $temp2 = $temp->field($CNtag);
161
160
162
            if ($temp2) {
161
            if ($temp2) {
163
                my @selectedsubfields;
162
                $value = $temp2->as_string( $CNsubfields, ' ' );
164
                foreach my $subfieldcode( @subfields ){
165
                    push @selectedsubfields, $temp2->subfield( $subfieldcode );
166
                }
167
                $value = join( ' ', @selectedsubfields );
168
169
                #remove any trailing space incase one subfield is used
170
                $value =~ s/^\s+|\s+$//g;
171
            }
163
            }
172
        }
164
        }
173
165
174
- 

Return to bug 9156