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

(-)a/C4/VirtualShelves.pm (-21 lines)
Lines 42-48 BEGIN { Link Here
42
    @EXPORT = qw(
42
    @EXPORT = qw(
43
            &GetShelves &GetShelfContents
43
            &GetShelves &GetShelfContents
44
            &ShelfPossibleAction
44
            &ShelfPossibleAction
45
            &GetBibliosShelves
46
    );
45
    );
47
        @EXPORT_OK = qw(
46
        @EXPORT_OK = qw(
48
            &ShelvesMax
47
            &ShelvesMax
Lines 333-358 sub ShelfPossibleAction { Link Here
333
    return 0;
332
    return 0;
334
}
333
}
335
334
336
=head2 GetBibliosShelves
337
338
This finds all the public lists that this bib record is in.
339
340
=cut
341
342
sub GetBibliosShelves {
343
    my ( $biblionumber )  = @_;
344
    my $dbh = C4::Context->dbh;
345
    my $sth = $dbh->prepare('
346
        SELECT vs.shelfname, vs.shelfnumber 
347
        FROM virtualshelves vs 
348
        JOIN virtualshelfcontents vc ON (vs.shelfnumber= vc.shelfnumber) 
349
        WHERE vs.category=2
350
        AND vc.biblionumber= ?
351
    ');
352
    $sth->execute( $biblionumber );
353
    return $sth->fetchall_arrayref({});
354
}
355
356
=head2 ShelvesMax
335
=head2 ShelvesMax
357
336
358
    $howmany= ShelvesMax($context);
337
    $howmany= ShelvesMax($context);
(-)a/catalogue/detail.pl (-1 / +12 lines)
Lines 45-50 use C4::HTML5Media; Link Here
45
use C4::CourseReserves qw(GetItemCourseReservesInfo);
45
use C4::CourseReserves qw(GetItemCourseReservesInfo);
46
use C4::Acquisition qw(GetOrdersByBiblionumber);
46
use C4::Acquisition qw(GetOrdersByBiblionumber);
47
47
48
use Koha::Virtualshelves;
49
48
my $query = CGI->new();
50
my $query = CGI->new();
49
51
50
my $analyze = $query->param('analyze');
52
my $analyze = $query->param('analyze');
Lines 374-380 $template->param( Link Here
374
# Lists
376
# Lists
375
377
376
if (C4::Context->preference("virtualshelves") ) {
378
if (C4::Context->preference("virtualshelves") ) {
377
   $template->param( 'GetShelves' => GetBibliosShelves( $biblionumber ) );
379
    my $shelves = Koha::Virtualshelves->search(
380
        {
381
            biblionumber => $biblionumber,
382
            category => 2,
383
        },
384
        {
385
            join => 'virtualshelfcontents',
386
        }
387
    );
388
    $template->param( 'GetShelves' => $shelves );
378
}
389
}
379
390
380
# XISBN Stuff
391
# XISBN Stuff
(-)a/opac/opac-detail.pl (-4 / +12 lines)
Lines 53-58 use Koha::DateUtils; Link Here
53
use C4::HTML5Media;
53
use C4::HTML5Media;
54
use C4::CourseReserves qw(GetItemCourseReservesInfo);
54
use C4::CourseReserves qw(GetItemCourseReservesInfo);
55
55
56
use Koha::Virtualshelves;
57
56
BEGIN {
58
BEGIN {
57
	if (C4::Context->preference('BakerTaylorEnabled')) {
59
	if (C4::Context->preference('BakerTaylorEnabled')) {
58
		require C4::External::BakerTaylor;
60
		require C4::External::BakerTaylor;
Lines 844-855 $template->param( Link Here
844
);
846
);
845
847
846
# Lists
848
# Lists
847
848
if (C4::Context->preference("virtualshelves") ) {
849
if (C4::Context->preference("virtualshelves") ) {
849
   $template->param( 'GetShelves' => GetBibliosShelves( $biblionumber ) );
850
    my $shelves = Koha::Virtualshelves->search(
851
        {
852
            biblionumber => $biblionumber,
853
            category => 2,
854
        },
855
        {
856
            join => 'virtualshelfcontents',
857
        }
858
    );
859
    $template->param( 'GetShelves' => $shelves );
850
}
860
}
851
861
852
853
# XISBN Stuff
862
# XISBN Stuff
854
if (C4::Context->preference("OPACFRBRizeEditions")==1) {
863
if (C4::Context->preference("OPACFRBRizeEditions")==1) {
855
    eval {
864
    eval {
856
- 

Return to bug 14544