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

(-)a/C4/Biblio.pm (-2 / +5 lines)
Lines 539-545 sub LinkBibHeadingsToAuthorities { Link Here
539
                        '', '', "a" => "" . $field->subfield('a') );
539
                        '', '', "a" => "" . $field->subfield('a') );
540
                    map {
540
                    map {
541
                        $authfield->add_subfields( $_->[0] => $_->[1] )
541
                        $authfield->add_subfields( $_->[0] => $_->[1] )
542
                          if ( $_->[0] =~ /[A-z]/ && $_->[0] ne "a" )
542
                          if ( $_->[0] =~ /[A-z]/ && $_->[0] ne "a"
543
                            && C4::Heading::valid_bib_heading_subfield(
544
                                $authority_type->auth_tag_to_report, $_->[0] )
545
                            );
543
                    } $field->subfields();
546
                    } $field->subfields();
544
                    $marcrecordauth->insert_fields_ordered($authfield);
547
                    $marcrecordauth->insert_fields_ordered($authfield);
545
548
Lines 2989-2995 sub _koha_modify_biblio { Link Here
2989
2992
2990
    $sth->execute(
2993
    $sth->execute(
2991
        $frameworkcode,      $biblio->{'author'},      $biblio->{'title'},         $biblio->{'unititle'}, $biblio->{'notes'},
2994
        $frameworkcode,      $biblio->{'author'},      $biblio->{'title'},         $biblio->{'unititle'}, $biblio->{'notes'},
2992
        $biblio->{'serial'}, $biblio->{'seriestitle'}, $biblio->{'copyrightdate'}, $biblio->{'abstract'}, $biblio->{'biblionumber'}
2995
        $biblio->{'serial'}, $biblio->{'seriestitle'}, $biblio->{'copyrightdate'} ? int($biblio->{'copyrightdate'}) : undef, $biblio->{'abstract'}, $biblio->{'biblionumber'}
2993
    ) if $biblio->{'biblionumber'};
2996
    ) if $biblio->{'biblionumber'};
2994
2997
2995
    if ( $dbh->errstr || !$biblio->{'biblionumber'} ) {
2998
    if ( $dbh->errstr || !$biblio->{'biblionumber'} ) {
(-)a/C4/Heading.pm (+18 lines)
Lines 17-22 package C4::Heading; Link Here
17
# You should have received a copy of the GNU General Public License
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use Modern::Perl;
21
20
use strict;
22
use strict;
21
use warnings;
23
use warnings;
22
use MARC::Record;
24
use MARC::Record;
Lines 170-175 sub preferred_authorities { Link Here
170
    return $results;
172
    return $results;
171
}
173
}
172
174
175
=head2 valid_bib_heading_subfield
176
177
    if (C4::Heading::valid_bib_heading_subfield('100', 'e', '')) ...
178
179
=cut
180
181
sub valid_bib_heading_subfield {
182
    my $tag           = shift;
183
    my $subfield      = shift;
184
    my $marcflavour   = @_ ? shift : C4::Context->preference('marcflavour');
185
186
    my $marc_handler = _marc_format_handler($marcflavour);
187
188
    return $marc_handler->valid_bib_heading_subfield( $tag, $subfield );
189
}
190
173
=head1 INTERNAL METHODS
191
=head1 INTERNAL METHODS
174
192
175
=head2 _search
193
=head2 _search
(-)a/C4/Heading/MARC21.pm (-1 / +15 lines)
Lines 161-166 sub valid_bib_heading_tag { Link Here
161
161
162
}
162
}
163
163
164
=head2 valid_bib_heading_subfield
165
166
=cut
167
168
sub valid_bib_heading_subfield {
169
    my $self          = shift;
170
    my $tag           = shift;
171
    my $subfield      = shift;
172
173
    if ( exists $bib_heading_fields->{$tag} ) {
174
        return 1 if ($bib_heading_fields->{$tag}->{subfields} =~ /$subfield/);
175
    }
176
    return 0;
177
}
178
164
=head2 parse_heading
179
=head2 parse_heading
165
180
166
=cut
181
=cut
167
- 

Return to bug 21826