Bugzilla – Attachment 156152 Details for
Bug 34886
Regression in when hold button appears
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34886: Rename can_item_be_reserved variable
Bug-34886-Rename-canitembereserved-variable.patch (text/plain), 3.67 KB, created by
Pedro Amorim
on 2023-09-25 12:50:33 UTC
(
hide
)
Description:
Bug 34886: Rename can_item_be_reserved variable
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-09-25 12:50:33 UTC
Size:
3.67 KB
patch
obsolete
>From f24c4500c2e15f1b16f7005d9f0e699519fa3013 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 25 Sep 2023 12:19:25 +0000 >Subject: [PATCH] Bug 34886: Rename can_item_be_reserved variable > >This variable is named like a function that returns a boolean, but is actually just a flag. >--- > opac/opac-ISBDdetail.pl | 6 +++--- > opac/opac-MARCdetail.pl | 6 +++--- > opac/opac-detail.pl | 8 ++++---- > 3 files changed, 10 insertions(+), 10 deletions(-) > >diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl >index fb7fc05bf5..f984e4bee8 100755 >--- a/opac/opac-ISBDdetail.pl >+++ b/opac/opac-ISBDdetail.pl >@@ -168,7 +168,7 @@ $template->param( > subscriptionsnumber => $subscriptionsnumber, > ); > >-my $can_item_be_reserved = 0; >+my $has_reservable_items = 0; > my $res = GetISBDView({ > 'record' => $record, > 'template' => 'opac', >@@ -178,10 +178,10 @@ my $res = GetISBDView({ > my $items = $biblio->items; > while ( my $item = $items->next ) { > >- $can_item_be_reserved = $can_item_be_reserved || IsAvailableForItemLevelRequest($item, $patron, undef); >+ $has_reservable_items = $has_reservable_items || IsAvailableForItemLevelRequest( $item, $patron, undef ); > } > >-if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { >+if( $has_reservable_items || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { > $template->param( ReservableItems => 1 ); > } > >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index c42d73abf0..62e2823ff1 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -136,14 +136,14 @@ $template->param( > ) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible. > $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8; # except -8; > >-my $can_item_be_reserved = 0; >+my $has_reservable_items = 0; > $items->reset; > > while ( my $item = $items->next ) { >- $can_item_be_reserved = $can_item_be_reserved || IsAvailableForItemLevelRequest($item, $patron, undef); >+ $has_reservable_items = $has_reservable_items || IsAvailableForItemLevelRequest( $item, $patron, undef ); > } > >-if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { >+if( $has_reservable_items || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { > $template->param( ReservableItems => 1 ); > } > >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 2483e55772..59eeedcfe1 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -658,7 +658,7 @@ if ( C4::Context->preference('OPACAcquisitionDetails' ) ) { > }; > } > >-my $can_item_be_reserved = 0; >+my $has_reservable_items = 0; > my ( $itemloop_has_images, $otheritemloop_has_images ); > if ( not $viewallitems and $items->count > $max_items_to_display ) { > $template->param( >@@ -683,9 +683,9 @@ else { > $item_info->{home_library_info} = $opac_info_home->content if $opac_info_home; > > if ( $patron ) { >- $can_item_be_reserved = IsAvailableForItemLevelRequest($item, $patron, undef); >+ $has_reservable_items = IsAvailableForItemLevelRequest($item, $patron, undef); > } else { >- $can_item_be_reserved = >+ $has_reservable_items = > Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => undef } ); > } > >@@ -763,7 +763,7 @@ else { > } > } > >-if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { >+if( $has_reservable_items || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { > $template->param( ReservableItems => 1 ); > } > >-- >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 34886
:
156107
|
156114
|
156150
|
156151
|
156152
|
156153
|
156277
|
156278
|
156279
|
156293
|
156294
|
156295
|
156326
|
156327
|
156980
|
156981
|
159678
|
159679
|
161633
|
161634
|
161981
|
161982
|
163674
|
164106
|
164107
|
164108
|
164109
|
164110
|
164159
|
164160
|
164161