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

(-)a/Koha/Item.pm (+9 lines)
Lines 37-42 Koha::Item - Koha Item object class Link Here
37
37
38
=cut
38
=cut
39
39
40
=head3 biblioitem
41
42
=cut
43
44
sub biblioitem {
45
    my ( $self ) = @_;
46
    return $self->_result->biblioitem;
47
}
48
40
=head3 effective_itemtype
49
=head3 effective_itemtype
41
50
42
Returns the itemtype for the item based on whether item level itemtypes are set or not.
51
Returns the itemtype for the item based on whether item level itemtypes are set or not.
(-)a/Koha/Schema/Result/Biblioitem.pm (-1 / +1 lines)
Lines 344-349 __PACKAGE__->has_many( Link Here
344
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-02-24 14:19:57
344
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-02-24 14:19:57
345
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:A/4lKYlKWWd8TcMVzMRtCg
345
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:A/4lKYlKWWd8TcMVzMRtCg
346
346
347
__PACKAGE__->belongs_to( biblio => "Koha::Schema::Result::Biblio", "biblionumber" );
347
348
348
# You can replace this text with custom content, and it will be preserved on regeneration
349
1;
349
1;
(-)a/Koha/Schema/Result/Item.pm (+2 lines)
Lines 619-624 __PACKAGE__->might_have( Link Here
619
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-04-23 12:42:12
619
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-04-23 12:42:12
620
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:urSpNt7LBda4T5Plhi6cPw
620
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:urSpNt7LBda4T5Plhi6cPw
621
621
622
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
623
622
sub effective_itemtype {
624
sub effective_itemtype {
623
    my ( $self ) = @_;
625
    my ( $self ) = @_;
624
626
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +1 lines)
Lines 675-681 No patron matched <span class="ex">[% message %]</span> Link Here
675
</fieldset>
675
</fieldset>
676
[% IF ( issue ) %]
676
[% IF ( issue ) %]
677
    <div class="lastchecked">
677
    <div class="lastchecked">
678
        <p><strong>Checked out: </strong>[% issue.item.biblioitemnumber.biblionumber.title %] ([% issue.item.barcode %]). Due on [% issue.date_due | $KohaDates %]</p>
678
        <p><strong>Checked out: </strong>[% issue.item.biblioitem.biblio.title %] ([% issue.item.barcode %]). Due on [% issue.date_due | $KohaDates %]</p>
679
    </div>
679
    </div>
680
[% END %]
680
[% END %]
681
</form></div>
681
</form></div>
(-)a/t/db_dependent/Schema.t (-1 / +31 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
use Test::More tests => 1;
3
4
use t::lib::TestBuilder;
5
6
use Koha::Biblios;
7
use Koha::Items;
8
9
my $builder = t::lib::TestBuilder->new;
10
11
subtest 'item->biblioitem' => sub {
12
    plan tests => 1;
13
14
    # NOTE This is a trick, if we want to populate the biblioitems table, we should not create a Biblio but a Biblioitem
15
    my $biblio = $builder->build( { source => 'Biblioitem', } )->{_fk}{biblionumber};
16
    my $item1       = $builder->build(
17
        {   source => 'Item',
18
            value  => { biblionumber => $biblio->{biblionumber}, biblioitemnumber => $biblio->{biblionumber} },
19
        }
20
    );
21
    my $item2 = $builder->build(
22
        {   source => 'Item',
23
            value  => { biblionumber => $biblio->{biblionumber}, biblioitemnumber => $biblio->{biblionumber} },
24
        }
25
    );
26
27
    my $biblio_object = Koha::Biblios->find( $biblio->{biblionumber} );
28
    my $item_object = Koha::Items->find( $item1->{itemnumber} );
29
30
    is( $item_object->biblioitem->biblio->biblionumber, $biblio->{biblionumber} );
31
};

Return to bug 14819