Bugzilla – Attachment 144927 Details for
Bug 32445
Status display of 'not for loan' items is broken in OPAC/staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32445: Fix availability display on opac-basket
Bug-32445-Fix-availability-display-on-opac-basket.patch (text/plain), 5.90 KB, created by
Jonathan Druart
on 2023-01-03 11:22:29 UTC
(
hide
)
Description:
Bug 32445: Fix availability display on opac-basket
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-01-03 11:22:29 UTC
Size:
5.90 KB
patch
obsolete
>From 3d76b3d22272895e1496176708d22afae4c2be11 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 3 Jan 2023 11:19:32 +0100 >Subject: [PATCH] Bug 32445: Fix availability display on opac-basket > >Also fix holding branch > >Will display an empty span if no location, big deal? >--- > .../bootstrap/en/modules/opac-basket.tt | 12 +++++---- > opac/opac-basket.pl | 26 +------------------ > 2 files changed, 8 insertions(+), 30 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >index 4e6219c0bd6..23d8c10f7ce 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >@@ -1,5 +1,7 @@ > [% USE raw %] > [% USE Koha %] >+[% USE AuthorisedValues %] >+[% USE Branches %] > [% USE KohaDates %] > [% USE Asset %] > [% SET is_popup = 1 %] >@@ -241,12 +243,12 @@ > <ul> > [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] > <li> >- <strong>[% ITEM_RESULT.branchname | html %]</strong> >- [% IF ( ITEM_RESULT.location_opac ) %]<span class="shelvingloc">[% ITEM_RESULT.location_opac | html %]</span>[% END %] >+ <strong>[% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]</strong> >+ <span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => 1 ) | html %]</span> > [% IF ( ITEM_RESULT.itemcallnumber ) %] > ([% ITEM_RESULT.itemcallnumber | html %]) > [% END %] >- ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %]) >+ ([% INCLUDE 'item-status.inc' item = ITEM_RESULT.item_object %]) > </li> > [% END %] > </ul> >@@ -303,8 +305,8 @@ > </td> > <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] > <li> >- [% ITEM_RESULT.branchname | html %] >- [% IF ( ITEM_RESULT.location_opac ) %]<span class="shelvingloc">[% ITEM_RESULT.location_opac | html %]</span>[% END %] >+ [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %] >+ <span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => 1 ) | html %]</span> > [% IF ( ITEM_RESULT.itemcallnumber ) %] > ([% ITEM_RESULT.itemcallnumber | html %]) > [% END %] >diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl >index 411ae6444c3..d6b11acf4ce 100755 >--- a/opac/opac-basket.pl >+++ b/opac/opac-basket.pl >@@ -93,22 +93,10 @@ foreach my $biblionumber ( @bibs ) { > next > if $biblio->hidden_in_opac({ rules => $rules }); > >- # grab all the items... >- my $items = $biblio->items->filter_by_visible_in_opac({ patron => $logged_in_user })->unblessed; >- foreach my $item (@$items) { >- my $reserve_status = C4::Reserves::GetReserveStatus($item->{itemnumber}); >- if( $reserve_status eq "Waiting"){ $item->{'waiting'} = 1; } >- if( $reserve_status eq "Processing"){ $item->{'processing'} = 1; } >- } >- > my $hasauthors = 0; > if($dat->{'author'} || @$marcauthorsarray) { > $hasauthors = 1; > } >- my $collections = >- { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $dat->{frameworkcode}, kohafield => 'items.ccode' } ) }; >- my $shelflocations = >- { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $dat->{frameworkcode}, kohafield => 'items.location' } ) }; > > # COinS format FIXME: for books Only > my $fmt = substr $record->leader(), 6,2; >@@ -120,21 +108,9 @@ foreach my $biblionumber ( @bibs ) { > $dat->{'even'} = 1; > } > >- for my $itm (@$items) { >- if ($itm->{'location'}){ >- $itm->{'location_opac'} = $shelflocations->{$itm->{'location'} }; >- } >- my $item_object = Koha::Items->find($itm->{itemnumber}); >- my $transfer = $item_object->get_transfer; >- if ( $transfer && $transfer->in_transit ) { >- $itm->{transfertwhen} = $transfer->datesent; >- $itm->{transfertfrom} = $transfer->frombranch; >- $itm->{transfertto} = $transfer->tobranch; >- } >- } > $num++; > $dat->{biblionumber} = $biblionumber; >- $dat->{ITEM_RESULTS} = $items; >+ $dat->{ITEM_RESULTS} = $biblio->items->filter_by_visible_in_opac({ patron => $logged_in_user }); > $dat->{MARCNOTES} = $marcnotesarray; > $dat->{MARCSUBJCTS} = $marcsubjctsarray; > $dat->{MARCAUTHORS} = $marcauthorsarray; >-- >2.25.1
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 32445
:
144542
|
144926
|
144927
|
144928
|
144929
|
144930
|
144971
|
144978
|
144987
|
144988
|
144989
|
144990
|
144991
|
144992
|
144993
|
144994
|
145004
|
145005
|
145006
|
145007
|
145008
|
145009
|
145010
|
145011
|
145014
|
145015
|
145016
|
145017
|
145018
|
145019
|
145020
|
145021