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( 'shelves' => $shelves );
378
}
389
}
379
390
380
# XISBN Stuff
391
# XISBN Stuff
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-11 / +11 lines)
Lines 356-365 function verify_images() { Link Here
356
    [% IF ( XSLTDetailsDisplay ) %]
356
    [% IF ( XSLTDetailsDisplay ) %]
357
        [% XSLTBloc %]
357
        [% XSLTBloc %]
358
358
359
        [% IF ( GetShelves ) %]
359
        [% IF shelves %]
360
            <span class="results_summary"><span class="label">Lists that include this title: </span>
360
            <span class="results_summary"><span class="label">Lists that include this title: </span>
361
            [% FOREACH GetShelve IN GetShelves %]
361
            [% FOREACH s IN shelves %]
362
                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a>
362
                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a>
363
                [% IF ( loop.last ) %][% ELSE %]|[% END %]
363
                [% IF ( loop.last ) %][% ELSE %]|[% END %]
364
            [% END %]
364
            [% END %]
365
            </span>
365
            </span>
Lines 520-533 function verify_images() { Link Here
520
            </li>
520
            </li>
521
        [% END %]
521
        [% END %]
522
        <!--This grabs all of the lists a bib record appears in -->
522
        <!--This grabs all of the lists a bib record appears in -->
523
        [% IF ( GetShelves ) %]
523
        [% IF shelves %]
524
	        <li><strong>Lists that include this title: </strong>
524
            <li><strong>Lists that include this title: </strong>
525
	        <ul>
525
            <ul>
526
	        [% FOREACH GetShelve IN GetShelves %]
526
            [% FOREACH s IN shelves %]
527
		        <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a></li>
527
                <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a></li>
528
	        [% END %]
528
            [% END %]
529
	        </ul>
529
            </ul>
530
	        </li>
530
            </li>
531
        [% END %]
531
        [% END %]
532
        [% IF ( TagsEnabled &&  TagsShowOnDetail &&  TagLoop ) %]
532
        [% IF ( TagsEnabled &&  TagsShowOnDetail &&  TagLoop ) %]
533
                <li><strong>Tags:</strong>
533
                <li><strong>Tags:</strong>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-4 / +4 lines)
Lines 389-402 Link Here
389
                    [% END # / LibraryThingForLibrariesID %]
389
                    [% END # / LibraryThingForLibrariesID %]
390
390
391
                    <!--This grabs all of the lists a bib record appears in -->
391
                    <!--This grabs all of the lists a bib record appears in -->
392
                    [% IF ( GetShelves ) %]
392
                    [% IF shelves %]
393
                        <span class="results_summary lists"><span class="label">List(s) this item appears in: </span>
393
                        <span class="results_summary lists"><span class="label">List(s) this item appears in: </span>
394
                        [% FOREACH GetShelve IN GetShelves %]
394
                        [% FOREACH shelf IN shelves %]
395
                            <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a>
395
                            <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelf.shelfnumber %]">[% shelf.shelfname %]</a>
396
                            [% IF ( loop.last ) %][% ELSE %]|[% END %]
396
                            [% IF ( loop.last ) %][% ELSE %]|[% END %]
397
                        [% END %]
397
                        [% END %]
398
                        </span>
398
                        </span>
399
                    [% END # / GetShelves %]
399
                    [% END %]
400
400
401
                    [% IF ( TagsShowEnabled ) %]
401
                    [% IF ( TagsShowEnabled ) %]
402
                        <div class="results_summary tags">
402
                        <div class="results_summary tags">
(-)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( shelves => $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