Bugzilla – Attachment 161038 Details for
Bug 35787
Remove Koha::Template::Plugin::Biblio::CanBook
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35787: Remove Koha::Template::Plugin::Biblio::CanBook
Bug-35787-Remove-KohaTemplatePluginBiblioCanBook.patch (text/plain), 2.84 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-01-15 13:27:00 UTC
(
hide
)
Description:
Bug 35787: Remove Koha::Template::Plugin::Biblio::CanBook
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-01-15 13:27:00 UTC
Size:
2.84 KB
patch
obsolete
>From 948015ea5b1cf5daf32028cb5d6ee3d110a13ea2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 12 Jan 2024 14:02:29 +0100 >Subject: [PATCH] Bug 35787: Remove Koha::Template::Plugin::Biblio::CanBook > >We can replace it with biblio.items.filter_by_bookable, no need to have this TT method. > >Additionally there was no test for it. > >Test plan: >Make sure the Bookings tab on the left of the biblio detail page is >displayed when needed. > >Note that there is also a "Place booking" button that should appear in >the toolbar. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Template/Plugin/Biblio.pm | 8 -------- > .../intranet-tmpl/prog/en/includes/biblio-view-menu.inc | 2 +- > koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc | 2 +- > 3 files changed, 2 insertions(+), 10 deletions(-) > >diff --git a/Koha/Template/Plugin/Biblio.pm b/Koha/Template/Plugin/Biblio.pm >index 7e582da37eb..74fa7d42a1d 100644 >--- a/Koha/Template/Plugin/Biblio.pm >+++ b/Koha/Template/Plugin/Biblio.pm >@@ -72,14 +72,6 @@ sub RecallsCount { > return $recalls->count; > } > >-sub CanBook { >- my ( $self, $biblionumber ) = @_; >- >- my $biblio = Koha::Biblios->find($biblionumber); >- return 0 unless $biblio; >- return $biblio->bookable_items->count ? 1 : 0; >-} >- > sub BookingsCount { > my ( $self, $biblionumber ) = @_; > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >index 3667a969033..c657cf5edad 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >@@ -50,7 +50,7 @@ > <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio_object_id | url %]">Items</a> > </li> > >- [% IF ( Biblio.CanBook(biblio_object_id) && CAN_user_circulate_manage_bookings ) %] >+ [% IF ( CAN_user_circulate_manage_bookings && biblio.items.filter_by_bookable.count ) %] > [%- IF ( bookingsview ) -%] > <li class="active"> > [%- ELSE -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >index 93818826d23..d090f4a6b1c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >@@ -195,7 +195,7 @@ > [% END %] > [% END %] > >-[% IF ( CAN_user_circulate_manage_bookings && Biblio.CanBook(biblionumber) ) %] >+[% IF ( CAN_user_circulate_manage_bookings && biblio.items.filter_by_bookable.count ) %] > <div class="btn-group"><button id="placbooking" class="btn btn-default" data-toggle="modal" data-target="#placeBookingModal" data-biblionumber="[% biblionumber | html %]"><i class="fa fa-calendar"></i> Place booking</button></div> > [% END %] > >-- >2.43.0
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 35787
:
160960
| 161038 |
161056