Bugzilla – Attachment 160988 Details for
Bug 35782
Remove Koha::Template::Plugin::Biblio::HoldsCount
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35782: Fix scoping problem with "biblio"
Bug-35782-Fix-scoping-problem-with-biblio.patch (text/plain), 7.27 KB, created by
David Nind
on 2024-01-12 16:19:06 UTC
(
hide
)
Description:
Bug 35782: Fix scoping problem with "biblio"
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-01-12 16:19:06 UTC
Size:
7.27 KB
patch
obsolete
>From 90a7443a4645068e7e52c47674b42d5aeeebb312 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 12 Jan 2024 15:22:52 +0100 >Subject: [PATCH] Bug 35782: Fix scoping problem with "biblio" > >The "biblio" Koha::Biblio object we send from the controller needs to be >accessible from the include files. >To avoid a clash we rename it biblio_info > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../prog/en/modules/reserve/request.tt | 22 +++++++++---------- > reserve/request.pl | 3 ++- > 2 files changed, 13 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 8d512eede7..631b82d2a8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -631,26 +631,26 @@ > [% END %] > </fieldset> > >- [% biblio = biblioloop.0 %] >+ [% biblio_info = biblioloop.0 %] > > <ol> > [% UNLESS Koha.Preference('item-level_itypes') %] > <li> > <span class="label">Item type:</span> >- [% biblio.itemtype.translated_description | html %] >+ [% biblio_info.itemtype.translated_description | html %] > </li> > [% END %] > >- [% IF ( biblio.biblioitem.publicationyear ) %] >+ [% IF ( biblio_info.biblioitem.publicationyear ) %] > <li> > <span class="label">Publication year:</span> >- [% biblio.biblioitem.publicationyear | html %] >+ [% biblio_info.biblioitem.publicationyear | html %] > </li> > [% END %] > </ol> > > <!-- ItemGroup level holds --> >- [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %] >+ [% IF Koha.Preference('EnableItemGroupHolds') && biblio_info.object.item_groups.count %] > <h2 style="padding: 0 1em;"> > Hold next available item from an item group > [% IF force_hold_level == 'item_group' %] >@@ -677,7 +677,7 @@ > </tr> > </thead> > <tbody> >- [% FOREACH g IN biblio.object.item_groups.search({}, { order_by => ['display_order'] }) %] >+ [% FOREACH g IN biblio_info.object.item_groups.search({}, { order_by => ['display_order'] }) %] > [% IF g.items %] > <tr> > <td> >@@ -711,7 +711,7 @@ > <th>Item type</th> > [% END %] > <th>Barcode</th> >- [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %] >+ [% IF Koha.Preference('EnableItemGroupHolds') && biblio_info.object.item_groups.count %] > <th>Item group</th> > [% END %] > <th>Home library</th> >@@ -729,7 +729,7 @@ > </thead> > <tbody> > [% SET selected = 0 %] >- [% FOREACH itemloo IN biblio.itemloop %] >+ [% FOREACH itemloo IN biblio_info.itemloop %] > [% UNLESS ( itemloo.hide ) %] > <tr class="[% itemloo.backgroundcolor | html %]"> > <td> >@@ -812,7 +812,7 @@ > <td> > [% itemloo.barcode | html %] > </td> >- [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %] >+ [% IF Koha.Preference('EnableItemGroupHolds') && biblio_info.object.item_groups.count %] > <td> > [% itemloo.object.item_group.description | html %] > </td> >@@ -912,7 +912,7 @@ > [% IF hiddencount %] > <form> > <p class="hiddencount"> >- <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% hiddencount | html %] hidden)</a> >+ <a href="request.pl?biblionumber=[% biblio_info.biblionumber | uri %]&borrowernumber=[% borrowernumber | uri %]&showallitems=1">Show all items ([% hiddencount | html %] hidden)</a> > </p> > </form> > [% END # /IF hiddencount %] >@@ -1312,7 +1312,7 @@ > var biblionumbers = [[% biblionumbers.join(', ') | $raw %]]; > var borrowernumber = "[% patron.borrowernumber | $raw %]"; > var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]"; >- var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %] >+ var override_items = {[% FOREACH biblio_info IN biblioloop %][% FOREACH itemloo IN biblio_info.itemloop %][% IF ( itemloo.override ) %] > [% itemloo.itemnumber | html %]: { > homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]", > holdallowed: "[% itemloo.holdallowed | html %]" >diff --git a/reserve/request.pl b/reserve/request.pl >index 186b3faff5..bb2eb56f2a 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -698,7 +698,8 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) > $template->param( exceeded_holds_per_record => $exceeded_holds_per_record ); > # FIXME: getting just the first bib's result doesn't seem right > $template->param( subscriptionsnumber => CountSubscriptionFromBiblionumber($biblionumbers[0])); >-} elsif ( ! $multi_hold ) { >+} >+unless ($multi_hold) { > my $biblio = Koha::Biblios->find( $biblionumbers[0] ); > $template->param( biblio => $biblio ); > } >-- >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 35782
:
160898
|
160930
|
160969
|
160987
|
160988
|
161036
|
161037