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 70-76 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
70
        if ($format =~ /^\d+$/) {
70
        if ($format =~ /^\d+$/) {
71
            my @biblios;
71
            my @biblios;
72
            while ( my $content = $contents->next ) {
72
            while ( my $content = $contents->next ) {
73
                push @biblios, $content->biblionumber->biblionumber;
73
                push @biblios, $content->biblionumber;
74
            }
74
            }
75
            $output = marc2csv(\@biblios, $format);
75
            $output = marc2csv(\@biblios, $format);
76
        # Other formats
76
        # Other formats
Lines 79-85 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
79
                filters => 'ViewPolicy'
79
                filters => 'ViewPolicy'
80
            });
80
            });
81
            while ( my $content = $contents->next ) {
81
            while ( my $content = $contents->next ) {
82
                my $biblionumber = $content->biblionumber->biblionumber;
82
                my $biblionumber = $content->biblionumber;
83
83
84
                my $record = GetMarcBiblio($biblionumber, 1);
84
                my $record = GetMarcBiblio($biblionumber, 1);
85
                my $framework = &GetFrameworkCode( $biblionumber );
85
                my $framework = &GetFrameworkCode( $biblionumber );
(-)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 28-33 use C4::Members; Link Here
28
use C4::Output;
28
use C4::Output;
29
use C4::Tags qw( get_tags );
29
use C4::Tags qw( get_tags );
30
use C4::XSLT;
30
use C4::XSLT;
31
32
use Koha::Biblioitems;
31
use Koha::Virtualshelves;
33
use Koha::Virtualshelves;
32
use Koha::RecordProcessor;
34
use Koha::RecordProcessor;
33
35
Lines 258-264 if ( $op eq 'view' ) { Link Here
258
            my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
260
            my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
259
            my @items;
261
            my @items;
260
            while ( my $content = $contents->next ) {
262
            while ( my $content = $contents->next ) {
261
                my $biblionumber = $content->biblionumber->biblionumber;
263
                my $biblionumber = $content->biblionumber;
262
                my $this_item    = GetBiblioData($biblionumber);
264
                my $this_item    = GetBiblioData($biblionumber);
263
                my $record = GetMarcBiblio($biblionumber);
265
                my $record = GetMarcBiblio($biblionumber);
264
                my $framework = GetFrameworkCode( $biblionumber );
266
                my $framework = GetFrameworkCode( $biblionumber );
Lines 274-280 if ( $op eq 'view' ) { Link Here
274
                }
276
                }
275
277
276
                my $marcflavour = C4::Context->preference("marcflavour");
278
                my $marcflavour = C4::Context->preference("marcflavour");
277
                my $itemtypeinfo = getitemtypeinfo( $content->biblionumber->biblioitems->first->itemtype, 'opac' );
279
                my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype;
280
                my $itemtypeinfo = getitemtypeinfo( $itemtype, 'opac' );
278
                $this_item->{imageurl}          = $itemtypeinfo->{imageurl};
281
                $this_item->{imageurl}          = $itemtypeinfo->{imageurl};
279
                $this_item->{description}       = $itemtypeinfo->{description};
282
                $this_item->{description}       = $itemtypeinfo->{description};
280
                $this_item->{notforloan}        = $itemtypeinfo->{notforloan};
283
                $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