Bugzilla – Attachment 166907 Details for
Bug 36271
Bookings should have circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36271: (follow-up) Add switch for join table according to item-level_itypes syspref
Bug-36271-follow-up-Add-switch-for-join-table-acco.patch (text/plain), 1.86 KB, created by
Thibaud Guillot (thibaud_g)
on 2024-05-17 13:50:45 UTC
(
hide
)
Description:
Bug 36271: (follow-up) Add switch for join table according to item-level_itypes syspref
Filename:
MIME Type:
Creator:
Thibaud Guillot (thibaud_g)
Created:
2024-05-17 13:50:45 UTC
Size:
1.86 KB
patch
obsolete
>From b9a65e44cc9dd66355351c201617ea24c3225888 Mon Sep 17 00:00:00 2001 >From: Thibaud Guillot <thibaud.guillot@biblibre.com> >Date: Fri, 17 May 2024 15:50:09 +0200 >Subject: [PATCH] Bug 36271: (follow-up) Add switch for join table according to > item-level_itypes syspref > >--- > Koha/Booking.pm | 26 +++++++++++++++++++------- > 1 file changed, 19 insertions(+), 7 deletions(-) > >diff --git a/Koha/Booking.pm b/Koha/Booking.pm >index abd006bd86a..c99027cb156 100644 >--- a/Koha/Booking.pm >+++ b/Koha/Booking.pm >@@ -91,13 +91,25 @@ sub can_be_booked_in_advance { > my $bookings_per_item_count = Koha::Bookings->search( { patron_id => $patron->borrowernumber, item_id => $item->itemnumber } )->count(); > return { status => 'tooManyBookings', limit => $bookings_per_item, rule => 'bookings_per_item' } if defined($bookings_per_item) && $bookings_per_item <= $bookings_per_item_count; > >- my $querycount = q{ >- SELECT count(*) AS count >- FROM bookings AS b >- LEFT JOIN biblioitems AS bi ON (b.biblio_id=bi.biblionumber) >- WHERE b.patron_id = ? >- AND bi.itemtype = ? >- }; >+ >+ my $querycount; >+ if (C4::Context->preference('item-level_itypes')) { >+ $querycount = q{ >+ SELECT count(*) AS count >+ FROM bookings AS b >+ LEFT JOIN items AS i ON (b.biblio_id=i.biblionumber) >+ WHERE b.patron_id = ? >+ AND i.itype = ? >+ }; >+ } else { >+ $querycount = q{ >+ SELECT count(*) AS count >+ FROM bookings AS b >+ LEFT JOIN biblioitems AS bi ON (b.biblio_id=bi.biblionumber) >+ WHERE b.patron_id = ? >+ AND bi.itemtype = ? >+ }; >+ } > > my $sthcount = $dbh->prepare($querycount); > $sthcount->execute( $patron->borrowernumber, $item->effective_itemtype ); >-- >2.30.2
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 36271
:
163546
|
164627
|
165061
|
165063
|
166809
|
166907
|
166930
|
166931
|
166932
|
166933
|
166952
|
166957
|
166962
|
170197
|
172866
|
172924