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

(-)a/Koha/Biblio.pm (-2 / +2 lines)
Lines 110-118 Returns a Marc::Record object Link Here
110
=cut
110
=cut
111
111
112
sub record {
112
sub record {
113
    my ( $self ) = @_;
113
    my $self = shift;
114
114
115
    return $self->metadata->record;
115
    return $self->metadata->record(@_);
116
}
116
}
117
117
118
=head3 record_schema
118
=head3 record_schema
(-)a/t/db_dependent/Biblio.t (-12 / +29 lines)
Lines 238-253 $biblio_module->mock( Link Here
238
    sub {
238
    sub {
239
        my ($self) = shift;
239
        my ($self) = shift;
240
240
241
        my ( $title_field,            $title_subfield )            = get_title_field();
241
        my ( $title_field,       $title_subfield )       = get_title_field();
242
        my ( $subtitle_field,         $subtitle_subfield )         = get_subtitle_field();
242
        my ( $subtitle_field,    $subtitle_subfield )    = get_subtitle_field();
243
        my ( $medium_field,           $medium_subfield )           = get_medium_field();
243
        my ( $medium_field,      $medium_subfield )      = get_medium_field();
244
        my ( $part_number_field,      $part_number_subfield )      = get_part_number_field();
244
        my ( $part_number_field, $part_number_subfield ) = get_part_number_field();
245
        my ( $part_name_field,        $part_name_subfield )        = get_part_name_field();
245
        my ( $part_name_field,   $part_name_subfield )   = get_part_name_field();
246
        my ( $isbn_field,             $isbn_subfield )             = get_isbn_field();
246
        my ( $isbn_field,        $isbn_subfield )        = get_isbn_field();
247
        my ( $issn_field,             $issn_subfield )             = get_issn_field();
247
        my ( $issn_field,        $issn_subfield )        = get_issn_field();
248
        my ( $biblionumber_field,     $biblionumber_subfield )     = ( '999', 'c' );
248
        my ( $biblionumber_field, $biblionumber_subfield )         = ( '999', 'c' );
249
        my ( $biblioitemnumber_field, $biblioitemnumber_subfield ) = ( '999', '9' );
249
        my ( $biblioitemnumber_field, $biblioitemnumber_subfield ) = ( '999', '9' );
250
        my ( $itemnumber_field,       $itemnumber_subfield )       = get_itemnumber_field();
250
        my ( $itemnumber_field, $itemnumber_subfield )             = get_itemnumber_field();
251
        my ( $itemcallnumber_field, $itemcallnumber_subfield )     = get_itemcallnumber_field();
251
252
252
        return {
253
        return {
253
            'biblio.title'                 => [ { tagfield => $title_field,            tagsubfield => $title_subfield } ],
254
            'biblio.title'                 => [ { tagfield => $title_field,            tagsubfield => $title_subfield } ],
Lines 259-265 $biblio_module->mock( Link Here
259
            'biblioitems.isbn'             => [ { tagfield => $isbn_field,             tagsubfield => $isbn_subfield } ],
260
            'biblioitems.isbn'             => [ { tagfield => $isbn_field,             tagsubfield => $isbn_subfield } ],
260
            'biblioitems.issn'             => [ { tagfield => $issn_field,             tagsubfield => $issn_subfield } ],
261
            'biblioitems.issn'             => [ { tagfield => $issn_field,             tagsubfield => $issn_subfield } ],
261
            'biblioitems.biblioitemnumber' => [ { tagfield => $biblioitemnumber_field, tagsubfield => $biblioitemnumber_subfield } ],
262
            'biblioitems.biblioitemnumber' => [ { tagfield => $biblioitemnumber_field, tagsubfield => $biblioitemnumber_subfield } ],
262
            'items.itemnumber'             => [ { tagfield => $itemnumber_subfield,    tagsubfield => $itemnumber_subfield } ],
263
            'items.itemnumber'             => [ { tagfield => $itemnumber_field,       tagsubfield => $itemnumber_subfield } ],
264
            'items.itemcallnumber'         => [ { tagfield => $itemcallnumber_field,   tagsubfield => $itemcallnumber_subfield } ],
263
        };
265
        };
264
      }
266
      }
265
);
267
);
Lines 556-561 sub get_itemnumber_field { Link Here
556
    return ( $marc_flavour eq 'UNIMARC' ) ? ( '995', '9' ) : ( '952', '9' );
558
    return ( $marc_flavour eq 'UNIMARC' ) ? ( '995', '9' ) : ( '952', '9' );
557
}
559
}
558
560
561
sub get_itemcallnumber_field {
562
    my $marc_flavour = C4::Context->preference('marcflavour');
563
    return ( $marc_flavour eq 'UNIMARC' ) ? ( '995', 'k' ) : ( '952', 'o' );
564
}
565
559
sub get_author_field {
566
sub get_author_field {
560
    my $marc_flavour = C4::Context->preference('marcflavour');
567
    my $marc_flavour = C4::Context->preference('marcflavour');
561
    return ( $marc_flavour eq 'UNIMARC' ) ? ( '700', 'a', '4' ) : ( '100', 'a', 'e' );
568
    return ( $marc_flavour eq 'UNIMARC' ) ? ( '700', 'a', '4' ) : ( '100', 'a', 'e' );
Lines 952-958 subtest 'autoControlNumber tests' => sub { Link Here
952
};
959
};
953
960
954
subtest 'record test' => sub {
961
subtest 'record test' => sub {
955
    plan tests => 1;
962
    plan tests => 2;
956
963
957
    my $marc_record = MARC::Record->new;
964
    my $marc_record = MARC::Record->new;
958
    $marc_record->append_fields( create_isbn_field( '0590353403', 'MARC21' ) );
965
    $marc_record->append_fields( create_isbn_field( '0590353403', 'MARC21' ) );
Lines 963-968 subtest 'record test' => sub { Link Here
963
970
964
    is( $biblio->record->as_formatted,
971
    is( $biblio->record->as_formatted,
965
        $biblio->metadata->record->as_formatted );
972
        $biblio->metadata->record->as_formatted );
973
974
    Koha::Item->new(
975
        {
976
            biblionumber   => $biblio->biblionumber, biblioitemnumber => $biblio->biblioitem->biblioitemnumber,
977
            itemcallnumber => '12345'
978
        }
979
    )->store;
980
    is(
981
        $biblio->record( { embed_items => 1 } )->as_formatted,
982
        $biblio->metadata->record( { embed_items => 1 } )->as_formatted
983
    );
966
};
984
};
967
985
968
subtest 'record_schema test' => sub {
986
subtest 'record_schema test' => sub {
969
- 

Return to bug 38033