Bugzilla – Attachment 43465 Details for
Bug 14544
Move the list related code to Koha::Virtualshelves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14544: Get rid of GetBibliosShelves
Bug-14544-Get-rid-of-GetBibliosShelves.patch (text/plain), 6.85 KB, created by
Marcel de Rooy
on 2015-10-16 08:53:07 UTC
(
hide
)
Description:
Bug 14544: Get rid of GetBibliosShelves
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-10-16 08:53:07 UTC
Size:
6.85 KB
patch
obsolete
>From e33b09c49f6be3f2716f39e59e86349d9ffd4681 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 6 Aug 2015 15:28:12 +0100 >Subject: [PATCH] Bug 14544: Get rid of GetBibliosShelves >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/VirtualShelves.pm | 21 ------------------- > catalogue/detail.pl | 13 +++++++++++- > .../prog/en/modules/catalogue/detail.tt | 22 ++++++++++---------- > .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 8 +++---- > opac/opac-detail.pl | 15 ++++++++++--- > 5 files changed, 39 insertions(+), 40 deletions(-) > >diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm >index 5c072f9..252ca2e 100644 >--- a/C4/VirtualShelves.pm >+++ b/C4/VirtualShelves.pm >@@ -42,7 +42,6 @@ BEGIN { > @EXPORT = qw( > &GetShelves &GetShelfContents > &ShelfPossibleAction >- &GetBibliosShelves > ); > @EXPORT_OK = qw( > &ShelvesMax >@@ -333,26 +332,6 @@ sub ShelfPossibleAction { > return 0; > } > >-=head2 GetBibliosShelves >- >-This finds all the public lists that this bib record is in. >- >-=cut >- >-sub GetBibliosShelves { >- my ( $biblionumber ) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare(' >- SELECT vs.shelfname, vs.shelfnumber >- FROM virtualshelves vs >- JOIN virtualshelfcontents vc ON (vs.shelfnumber= vc.shelfnumber) >- WHERE vs.category=2 >- AND vc.biblionumber= ? >- '); >- $sth->execute( $biblionumber ); >- return $sth->fetchall_arrayref({}); >-} >- > =head2 ShelvesMax > > $howmany= ShelvesMax($context); >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 30ce2c2..1989a7c 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -44,6 +44,8 @@ use C4::HTML5Media; > use C4::CourseReserves qw(GetItemCourseReservesInfo); > use C4::Acquisition qw(GetOrdersByBiblionumber); > >+use Koha::Virtualshelves; >+ > my $query = CGI->new(); > > my $analyze = $query->param('analyze'); >@@ -377,7 +379,16 @@ $template->param( > # Lists > > if (C4::Context->preference("virtualshelves") ) { >- $template->param( 'GetShelves' => GetBibliosShelves( $biblionumber ) ); >+ my $shelves = Koha::Virtualshelves->search( >+ { >+ biblionumber => $biblionumber, >+ category => 2, >+ }, >+ { >+ join => 'virtualshelfcontents', >+ } >+ ); >+ $template->param( 'shelves' => $shelves ); > } > > # XISBN Stuff >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 20ac837..b501e42 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -357,10 +357,10 @@ function verify_images() { > [% IF ( XSLTDetailsDisplay ) %] > [% XSLTBloc %] > >- [% IF ( GetShelves ) %] >+ [% IF shelves %] > <span class="results_summary"><span class="label">Lists that include this title: </span> >- [% FOREACH GetShelve IN GetShelves %] >- <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a> >+ [% FOREACH s IN shelves %] >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a> > [% IF ( loop.last ) %][% ELSE %]|[% END %] > [% END %] > </span> >@@ -521,14 +521,14 @@ function verify_images() { > </li> > [% END %] > <!--This grabs all of the lists a bib record appears in --> >- [% IF ( GetShelves ) %] >- <li><strong>Lists that include this title: </strong> >- <ul> >- [% FOREACH GetShelve IN GetShelves %] >- <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a></li> >- [% END %] >- </ul> >- </li> >+ [% IF shelves %] >+ <li><strong>Lists that include this title: </strong> >+ <ul> >+ [% FOREACH s IN shelves %] >+ <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a></li> >+ [% END %] >+ </ul> >+ </li> > [% END %] > [% IF ( TagsEnabled && TagsShowOnDetail && TagLoop ) %] > <li><strong>Tags:</strong> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 1c36c06..cb0daa5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -390,14 +390,14 @@ > [% END # / LibraryThingForLibrariesID %] > > <!--This grabs all of the lists a bib record appears in --> >- [% IF ( GetShelves ) %] >+ [% IF shelves %] > <span class="results_summary lists"><span class="label">List(s) this item appears in: </span> >- [% FOREACH GetShelve IN GetShelves %] >- <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a> >+ [% FOREACH shelf IN shelves %] >+ <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelf.shelfnumber %]">[% shelf.shelfname %]</a> > [% IF ( loop.last ) %][% ELSE %]|[% END %] > [% END %] > </span> >- [% END # / GetShelves %] >+ [% END %] > > [% IF ( TagsShowEnabled ) %] > <div class="results_summary tags"> >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 0fa588f..4e3d73e 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -53,6 +53,8 @@ use Koha::DateUtils; > use C4::HTML5Media; > use C4::CourseReserves qw(GetItemCourseReservesInfo); > >+use Koha::Virtualshelves; >+ > BEGIN { > if (C4::Context->preference('BakerTaylorEnabled')) { > require C4::External::BakerTaylor; >@@ -844,12 +846,19 @@ $template->param( > ); > > # Lists >- > if (C4::Context->preference("virtualshelves") ) { >- $template->param( 'GetShelves' => GetBibliosShelves( $biblionumber ) ); >+ my $shelves = Koha::Virtualshelves->search( >+ { >+ biblionumber => $biblionumber, >+ category => 2, >+ }, >+ { >+ join => 'virtualshelfcontents', >+ } >+ ); >+ $template->param( shelves => $shelves ); > } > >- > # XISBN Stuff > if (C4::Context->preference("OPACFRBRizeEditions")==1) { > eval { >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14544
:
41034
|
41035
|
41036
|
41037
|
41038
|
41039
|
41040
|
41041
|
41042
|
41403
|
41404
|
41405
|
41406
|
41407
|
41408
|
41409
|
41410
|
41411
|
41412
|
41584
|
41585
|
41586
|
41587
|
41588
|
41589
|
41590
|
41591
|
41592
|
41593
|
41594
|
41595
|
41596
|
41597
|
41598
|
41599
|
41600
|
41601
|
41716
|
41717
|
41718
|
41719
|
41720
|
41721
|
41722
|
41723
|
41724
|
41725
|
41726
|
41727
|
41728
|
41729
|
41730
|
41731
|
41732
|
41733
|
41766
|
41909
|
41910
|
41913
|
41914
|
41915
|
41917
|
41918
|
41919
|
41924
|
41927
|
41931
|
41932
|
41953
|
41954
|
41955
|
41956
|
41957
|
41958
|
41959
|
41960
|
41961
|
41962
|
41963
|
41964
|
41965
|
41966
|
41967
|
41968
|
41969
|
41970
|
41973
|
41974
|
41975
|
41976
|
41977
|
41978
|
41979
|
41980
|
41981
|
41982
|
41983
|
41986
|
41988
|
42192
|
42199
|
42200
|
42201
|
42202
|
42203
|
42204
|
42205
|
42206
|
42207
|
42208
|
42209
|
42210
|
42211
|
42212
|
42213
|
42214
|
42215
|
42216
|
42217
|
42218
|
42219
|
42638
|
43223
|
43224
|
43225
|
43226
|
43227
|
43228
|
43229
|
43230
|
43231
|
43232
|
43233
|
43234
|
43235
|
43236
|
43237
|
43238
|
43239
|
43240
|
43241
|
43242
|
43243
|
43296
|
43334
|
43335
|
43403
|
43456
|
43457
|
43458
|
43459
|
43460
|
43461
|
43462
|
43463
|
43464
|
43465
|
43466
|
43467
|
43469
|
43470
|
43471
|
43472
|
43473
|
43474
|
43475
|
43476
|
43477
|
43478
|
43479
|
43480
|
43481
|
43482
|
43485
|
43486
|
43487
|
44467
|
44468
|
44469
|
44470
|
44471
|
44472
|
44473
|
44474
|
44475
|
44476
|
44477
|
44478
|
44479
|
44480
|
44481
|
44482
|
44483
|
44484
|
44485
|
44486
|
44487
|
44758
|
44845
|
44852
|
44863
|
44872