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 44-49 use C4::HTML5Media; Link Here
44
use C4::CourseReserves qw(GetItemCourseReservesInfo);
44
use C4::CourseReserves qw(GetItemCourseReservesInfo);
45
use C4::Acquisition qw(GetOrdersByBiblionumber);
45
use C4::Acquisition qw(GetOrdersByBiblionumber);
46
46
47
use Koha::Virtualshelves;
48
47
my $query = CGI->new();
49
my $query = CGI->new();
48
50
49
my $analyze = $query->param('analyze');
51
my $analyze = $query->param('analyze');
Lines 377-383 $template->param( Link Here
377
# Lists
379
# Lists
378
380
379
if (C4::Context->preference("virtualshelves") ) {
381
if (C4::Context->preference("virtualshelves") ) {
380
   $template->param( 'GetShelves' => GetBibliosShelves( $biblionumber ) );
382
    my $shelves = Koha::Virtualshelves->search(
383
        {
384
            biblionumber => $biblionumber,
385
            category => 2,
386
        },
387
        {
388
            join => 'virtualshelfcontents',
389
        }
390
    );
391
    $template->param( 'shelves' => $shelves );
381
}
392
}
382
393
383
# XISBN Stuff
394
# XISBN Stuff
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-11 / +11 lines)
Lines 357-366 function verify_images() { Link Here
357
    [% IF ( XSLTDetailsDisplay ) %]
357
    [% IF ( XSLTDetailsDisplay ) %]
358
        [% XSLTBloc %]
358
        [% XSLTBloc %]
359
359
360
        [% IF ( GetShelves ) %]
360
        [% IF shelves %]
361
            <span class="results_summary"><span class="label">Lists that include this title: </span>
361
            <span class="results_summary"><span class="label">Lists that include this title: </span>
362
            [% FOREACH GetShelve IN GetShelves %]
362
            [% FOREACH s IN shelves %]
363
                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a>
363
                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a>
364
                [% IF ( loop.last ) %][% ELSE %]|[% END %]
364
                [% IF ( loop.last ) %][% ELSE %]|[% END %]
365
            [% END %]
365
            [% END %]
366
            </span>
366
            </span>
Lines 521-534 function verify_images() { Link Here
521
            </li>
521
            </li>
522
        [% END %]
522
        [% END %]
523
        <!--This grabs all of the lists a bib record appears in -->
523
        <!--This grabs all of the lists a bib record appears in -->
524
        [% IF ( GetShelves ) %]
524
        [% IF shelves %]
525
	        <li><strong>Lists that include this title: </strong>
525
            <li><strong>Lists that include this title: </strong>
526
	        <ul>
526
            <ul>
527
	        [% FOREACH GetShelve IN GetShelves %]
527
            [% FOREACH s IN shelves %]
528
                <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a></li>
528
                <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a></li>
529
	        [% END %]
529
            [% END %]
530
	        </ul>
530
            </ul>
531
	        </li>
531
            </li>
532
        [% END %]
532
        [% END %]
533
        [% IF ( TagsEnabled &&  TagsShowOnDetail &&  TagLoop ) %]
533
        [% IF ( TagsEnabled &&  TagsShowOnDetail &&  TagLoop ) %]
534
                <li><strong>Tags:</strong>
534
                <li><strong>Tags:</strong>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-4 / +4 lines)
Lines 390-403 Link Here
390
                    [% END # / LibraryThingForLibrariesID %]
390
                    [% END # / LibraryThingForLibrariesID %]
391
391
392
                    <!--This grabs all of the lists a bib record appears in -->
392
                    <!--This grabs all of the lists a bib record appears in -->
393
                    [% IF ( GetShelves ) %]
393
                    [% IF shelves %]
394
                        <span class="results_summary lists"><span class="label">List(s) this item appears in: </span>
394
                        <span class="results_summary lists"><span class="label">List(s) this item appears in: </span>
395
                        [% FOREACH GetShelve IN GetShelves %]
395
                        [% FOREACH shelf IN shelves %]
396
                            <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a>
396
                            <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelf.shelfnumber %]">[% shelf.shelfname %]</a>
397
                            [% IF ( loop.last ) %][% ELSE %]|[% END %]
397
                            [% IF ( loop.last ) %][% ELSE %]|[% END %]
398
                        [% END %]
398
                        [% END %]
399
                        </span>
399
                        </span>
400
                    [% END # / GetShelves %]
400
                    [% END %]
401
401
402
                    [% IF ( TagsShowEnabled ) %]
402
                    [% IF ( TagsShowEnabled ) %]
403
                        <div class="results_summary tags">
403
                        <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