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

(-)a/Koha/Virtualshelf.pm (-2 / +5 lines)
Lines 28-33 use Koha::Exceptions; Link Here
28
use Koha::Virtualshelfshare;
28
use Koha::Virtualshelfshare;
29
use Koha::Virtualshelfshares;
29
use Koha::Virtualshelfshares;
30
use Koha::Virtualshelfcontent;
30
use Koha::Virtualshelfcontent;
31
use Koha::Virtualshelfcontents;
31
32
32
use base qw(Koha::Object);
33
use base qw(Koha::Object);
33
34
Lines 105-117 sub is_shelfname_valid { Link Here
105
106
106
sub get_shares {
107
sub get_shares {
107
    my ( $self ) = @_;
108
    my ( $self ) = @_;
108
    my $shares = $self->{_result}->virtualshelfshares;
109
    my $rs = $self->{_result}->virtualshelfshares;
110
    my $shares = Koha::Virtualshelfshares->_new_from_dbic( $rs );
109
    return $shares;
111
    return $shares;
110
}
112
}
111
113
112
sub get_contents {
114
sub get_contents {
113
    my ( $self ) = @_;
115
    my ( $self ) = @_;
114
    my $contents = $self->{_result}->virtualshelfcontents;
116
    my $rs = $self->{_result}->virtualshelfcontents;
117
    my $contents = Koha::Virtualshelfcontents->_new_from_dbic( $rs );
115
    return $contents;
118
    return $contents;
116
}
119
}
117
120
(-)a/opac/opac-downloadshelf.pl (-2 / +2 lines)
Lines 71-83 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
71
        if ($format =~ /^\d+$/) {
71
        if ($format =~ /^\d+$/) {
72
            my @biblios;
72
            my @biblios;
73
            while ( my $content = $contents->next ) {
73
            while ( my $content = $contents->next ) {
74
                push @biblios, $content->biblionumber->biblionumber;
74
                push @biblios, $content->biblionumber;
75
            }
75
            }
76
            $output = marc2csv(\@biblios, $format);
76
            $output = marc2csv(\@biblios, $format);
77
        # Other formats
77
        # Other formats
78
        } else {
78
        } else {
79
            while ( my $content = $contents->next ) {
79
            while ( my $content = $contents->next ) {
80
                my $biblionumber = $content->biblionumber->biblionumber;
80
                my $biblionumber = $content->biblionumber;
81
81
82
                my $record = GetMarcBiblio($biblionumber, 1);
82
                my $record = GetMarcBiblio($biblionumber, 1);
83
                next unless $record;
83
                next unless $record;
(-)a/opac/opac-sendshelf.pl (-1 / +1 lines)
Lines 86-92 if ( $email ) { Link Here
86
    my @results;
86
    my @results;
87
87
88
    while ( my $content = $contents->next ) {
88
    while ( my $content = $contents->next ) {
89
        my $biblionumber = $content->biblionumber->biblionumber;
89
        my $biblionumber = $content->biblionumber;
90
        my $fw               = GetFrameworkCode($biblionumber);
90
        my $fw               = GetFrameworkCode($biblionumber);
91
        my $dat              = GetBiblioData($biblionumber);
91
        my $dat              = GetBiblioData($biblionumber);
92
        my $record           = GetMarcBiblio($biblionumber, 1);
92
        my $record           = GetMarcBiblio($biblionumber, 1);
(-)a/opac/opac-shelves.pl (-2 / +5 lines)
Lines 27-32 use C4::Members; Link Here
27
use C4::Output;
27
use C4::Output;
28
use C4::Tags qw( get_tags );
28
use C4::Tags qw( get_tags );
29
use C4::XSLT;
29
use C4::XSLT;
30
31
use Koha::Biblioitems;
30
use Koha::Virtualshelves;
32
use Koha::Virtualshelves;
31
33
32
my $query = new CGI;
34
my $query = new CGI;
Lines 255-261 if ( $op eq 'view' ) { Link Here
255
257
256
            my @items;
258
            my @items;
257
            while ( my $content = $contents->next ) {
259
            while ( my $content = $contents->next ) {
258
                my $biblionumber = $content->biblionumber->biblionumber;
260
                my $biblionumber = $content->biblionumber;
259
                my $this_item    = GetBiblioData($biblionumber);
261
                my $this_item    = GetBiblioData($biblionumber);
260
                my $record       = GetMarcBiblio($biblionumber);
262
                my $record       = GetMarcBiblio($biblionumber);
261
263
Lines 265-271 if ( $op eq 'view' ) { Link Here
265
                }
267
                }
266
268
267
                my $marcflavour = C4::Context->preference("marcflavour");
269
                my $marcflavour = C4::Context->preference("marcflavour");
268
                my $itemtypeinfo = getitemtypeinfo( $content->biblionumber->biblioitems->first->itemtype, 'opac' );
270
                my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype;
271
                my $itemtypeinfo = getitemtypeinfo( $itemtype, 'opac' );
269
                $this_item->{imageurl}          = $itemtypeinfo->{imageurl};
272
                $this_item->{imageurl}          = $itemtypeinfo->{imageurl};
270
                $this_item->{description}       = $itemtypeinfo->{description};
273
                $this_item->{description}       = $itemtypeinfo->{description};
271
                $this_item->{notforloan}        = $itemtypeinfo->{notforloan};
274
                $this_item->{notforloan}        = $itemtypeinfo->{notforloan};
(-)a/virtualshelves/downloadshelf.pl (-2 / +2 lines)
Lines 64-76 if ($shelfid && $format) { Link Here
64
            if ($format =~ /^\d+$/) {
64
            if ($format =~ /^\d+$/) {
65
                my @biblios;
65
                my @biblios;
66
                while ( my $content = $contents->next ) {
66
                while ( my $content = $contents->next ) {
67
                    push @biblios, $content->biblionumber->biblionumber;
67
                    push @biblios, $content->biblionumber;
68
                }
68
                }
69
                $output = marc2csv(\@biblios, $format);
69
                $output = marc2csv(\@biblios, $format);
70
            }
70
            }
71
            else { #Other formats
71
            else { #Other formats
72
                while ( my $content = $contents->next ) {
72
                while ( my $content = $contents->next ) {
73
                    my $biblionumber = $content->biblionumber->biblionumber;
73
                    my $biblionumber = $content->biblionumber;
74
                    my $record = GetMarcBiblio($biblionumber, 1);
74
                    my $record = GetMarcBiblio($biblionumber, 1);
75
                    if ($format eq 'iso2709') {
75
                    if ($format eq 'iso2709') {
76
                        $output .= $record->as_usmarc();
76
                        $output .= $record->as_usmarc();
(-)a/virtualshelves/sendshelf.pl (-1 / +1 lines)
Lines 77-83 if ($email) { Link Here
77
    my @results;
77
    my @results;
78
78
79
    while ( my $content = $contents->next ) {
79
    while ( my $content = $contents->next ) {
80
        my $biblionumber     = $content->biblionumber->biblionumber;
80
        my $biblionumber     = $content->biblionumber;
81
        my $fw               = GetFrameworkCode($biblionumber);
81
        my $fw               = GetFrameworkCode($biblionumber);
82
        my $dat              = GetBiblioData($biblionumber);
82
        my $dat              = GetBiblioData($biblionumber);
83
        my $record           = GetMarcBiblio($biblionumber, 1);
83
        my $record           = GetMarcBiblio($biblionumber, 1);
(-)a/virtualshelves/shelves.pl (-5 / +8 lines)
Lines 27-32 use C4::Members; Link Here
27
use C4::Output;
27
use C4::Output;
28
use C4::XSLT;
28
use C4::XSLT;
29
29
30
use Koha::Biblios;
31
use Koha::Biblioitems;
30
use Koha::CsvProfiles;
32
use Koha::CsvProfiles;
31
use Koha::Virtualshelves;
33
use Koha::Virtualshelves;
32
34
Lines 223-229 if ( $op eq 'view' ) { Link Here
223
            my @items;
225
            my @items;
224
            while ( my $content = $contents->next ) {
226
            while ( my $content = $contents->next ) {
225
                my $this_item;
227
                my $this_item;
226
                my $biblionumber = $content->biblionumber->biblionumber;
228
                my $biblionumber = $content->biblionumber;
227
                my $record       = GetMarcBiblio($biblionumber);
229
                my $record       = GetMarcBiblio($biblionumber);
228
230
229
                if ( $xslfile ) {
231
                if ( $xslfile ) {
Lines 232-240 if ( $op eq 'view' ) { Link Here
232
                }
234
                }
233
235
234
                my $marcflavour = C4::Context->preference("marcflavour");
236
                my $marcflavour = C4::Context->preference("marcflavour");
235
                my $itemtypeinfo = getitemtypeinfo( $content->biblionumber->biblioitems->first->itemtype, 'intranet' );
237
                my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype;
236
                $this_item->{title}             = $content->biblionumber->title;
238
                my $itemtypeinfo = getitemtypeinfo( $itemtype, 'intranet' );
237
                $this_item->{author}            = $content->biblionumber->author;
239
                my $biblio = Koha::Biblios->find( $content->biblionumber );
240
                $this_item->{title}             = $biblio->title;
241
                $this_item->{author}            = $biblio->author;
238
                $this_item->{dateadded}         = $content->dateadded;
242
                $this_item->{dateadded}         = $content->dateadded;
239
                $this_item->{imageurl}          = $itemtypeinfo->{imageurl};
243
                $this_item->{imageurl}          = $itemtypeinfo->{imageurl};
240
                $this_item->{description}       = $itemtypeinfo->{description};
244
                $this_item->{description}       = $itemtypeinfo->{description};
241
- 

Return to bug 17094