Bugzilla – Attachment 145008 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: Remove non-Koha::Item support from item-status.inc
Bug-32445-Remove-non-KohaItem-support-from-item-st.patch (text/plain), 3.52 KB, created by
Martin Renvoize (ashimema)
on 2023-01-04 12:28:43 UTC
(
hide
)
Description:
Bug 32445: Remove non-Koha::Item support from item-status.inc
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-01-04 12:28:43 UTC
Size:
3.52 KB
patch
obsolete
>From 59858796748807c5c9659884b82db966e30166ee Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 3 Jan 2023 11:43:28 +0100 >Subject: [PATCH] Bug 32445: Remove non-Koha::Item support from item-status.inc > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../bootstrap/en/includes/item-status.inc | 35 ++++++++----------- > 1 file changed, 15 insertions(+), 20 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >index 601cd8984ea..7adeb1e0f2a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -7,6 +7,11 @@ > [%#- structure is used by course reserves pages, which do -%] > [%#- not use an API to fetch items that populates item.datedue. -%] > >+[% UNLESS item.isa('Koha::Item') %] >+ <div>Programming error, item-status.inc must be called with a Koha::Item object.<div> >+ [% STOP %] >+[% END %] >+ > [% IF ( item.itemlost ) %] > [% SET itemavailable = 0 %] > [% itemlost_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost, opac => 1 ) %] >@@ -17,13 +22,9 @@ > [% END %] > [% END %] > >-[% IF item.isa('Koha::Item') %] >- [% SET datedue = item.checkout.date_due %] >- [% SET onsite_checkout = item.checkout.onsite_checkout %] >-[% ELSE %] >- [% SET datedue = item.datedue || issue.date_due %] >- [% SET onsite_checkout = item.onsite_checkout %] >-[% END %] >+[% SET datedue = item.checkout.date_due %] >+[% SET onsite_checkout = item.checkout.onsite_checkout %] >+ > [% IF datedue %] > [% SET itemavailable = 0 %] > [% IF onsite_checkout %] >@@ -46,17 +47,11 @@ > [% END %] > [% END %] > >-[% IF item.isa('Koha::Item') %] >- [% SET transfer = item.get_transfer %] >- [% IF transfer AND transfer.in_transit %] >- [% SET transfertwhen = transfer.datesent %] >- [% SET transfertfrom = transfer.frombranch %] >- [% SET transfertto = transfer.tobranch %] >- [% END %] >-[% ELSE %] >- [% SET transfertwhen = item.transfertwhen %] >- [% SET transfertfrom = item.transfertfrom %] >- [% SET transfertto = item.transfertto %] >+[% SET transfer = item.get_transfer %] >+[% IF transfer AND transfer.in_transit %] >+ [% SET transfertwhen = transfer.datesent %] >+ [% SET transfertfrom = transfer.frombranch %] >+ [% SET transfertto = transfer.tobranch %] > [% END %] > [% IF transfertwhen %] [%# transfertwhen is set in C4::Search, do not have it for course reserves %] > [% SET itemavailable = 0 %] >@@ -64,7 +59,7 @@ > to [% Branches.GetName( transfertto ) | html %] since [% transfertwhen | $KohaDates %]</span> > [% END %] > >-[% IF (item.isa('Koha::Item') AND item.holds.waiting.count) OR (item.isa('Koha::Item') AND item.holds.processing.count) OR (NOT item.isa('Koha::Item') AND item.waiting) OR (NOT item.isa('Koha::Item') AND item.processing) %] >+[% IF item.holds.waiting.count OR item.holds.processing.count %] > [% SET itemavailable = 0 %] > <span class="item-status onhold">On hold</span> > [% END %] >@@ -108,7 +103,7 @@ > [% END %] > [% END %] > >-[% IF Koha.Preference('OPACAcquisitionDetails') AND ( item.isa('Koha::Item') ) AND ( item.orders.filter_by_active.count ) %] >+[% IF Koha.Preference('OPACAcquisitionDetails') AND item.orders.filter_by_active.count %] > [% SET itemavailable = 0 %] > <span class="item-status onorder">On order</span> > [% END %] >-- >2.39.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 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