Bugzilla – Attachment 123235 Details for
Bug 28761
Item status shows incorrectly on opac-course-details.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28761: better handle notforloan and restricted status in item.status.inc
Bug-28761-better-handle-notforloan-and-restricted-.patch (text/plain), 3.54 KB, created by
Lucas Gass (lukeg)
on 2021-07-27 21:37:26 UTC
(
hide
)
Description:
Bug 28761: better handle notforloan and restricted status in item.status.inc
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2021-07-27 21:37:26 UTC
Size:
3.54 KB
patch
obsolete
>From b3a5862462c12f0d2b9deee2a74085f8c99ef8a5 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 27 Jul 2021 21:34:32 +0000 >Subject: [PATCH] Bug 28761: better handle notforloan and restricted status in > item.status.inc > >To test: >1. create a course in course reserves, add an item to it. >2. confirm your item shows Available for its status on opac-course-details.pl >3. give your item a notforloan status >4. reload opac-course-details.pl, confirm its still "available" >5. give your item a restricted user status >6. reload opac-course-details.pl, confirm its still "available" >7. give your item a lost, damaged, or withdrawn status >8. reload opac-course-details.pl, these statuses *are* reflected >9. apply patch >10. check notforloan and restricted, they should be reflect the correct status now >--- > .../bootstrap/en/includes/item-status.inc | 26 ++++++++++++------- > 1 file changed, 16 insertions(+), 10 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 cd04f9f4a5..7cf23f1621 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -62,17 +62,14 @@ > [% END %] > [% END %] > >- >-[% IF NOT ( item.isa('Koha::Item') ) AND item.itemnotforloan %] >+[% IF ( item.notforloan ) %] > [% SET itemavailable = 0 %] >- [% IF ( item.notforloanvalueopac ) %] >- <span class="item-status notforloan">[% item.notforloanvalueopac | html %] [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</span> >+ [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %] >+ [% IF av_lib_include %] >+ <span class="item-status notforloan">[% av_lib_include | html %]</span> > [% ELSE %] >- <span class="item-status notforloan">Not for loan [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</span> >+ <span class="item-status notforloan">Not for loan</span> > [% END %] >-[% ELSIF NOT ( item.isa('Koha::Item') ) AND item.notforloan_per_itemtype %] >- [% SET itemavailable = 0 %] >- <span class="item-status notforloan">Not for loan [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</span> > [% END %] > > [% IF ( item.damaged ) %] >@@ -85,6 +82,16 @@ > [% END %] > [% END %] > >+[% IF (item.restricted ) %] >+ [% SET itemavailable = 0 %] >+ [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted, opac => 1 ) %] >+ [% IF av_lib_include %] >+ <span class="item-status restricted">[% av_lib_include | html %]</span> >+ [% ELSE %] >+ <span class="item-status restricted">Item restricted</span> >+ [% END %] >+[% END %] >+ > [% IF NOT ( item.isa('Koha::Item') ) AND item.on_order %][%# on_order is only set from opac-detail.pl %] > [% SET itemavailable = 0 %] > <span class="item-status onorder">On order</span> >@@ -96,6 +103,5 @@ > [% END %] > > [% IF ( itemavailable ) %] >- [% IF NOT item.isa('Koha::Item') %][% SET restrictedvalueopac = item.restrictedvalueopac %][% END %] >- <span class="item-status available">Available [% IF restrictedvalueopac %]<span class="restricted">([% restrictedvalueopac | html %])</span>[% END %]</span> >+ <span class="item-status available">Available</span> > [% END %] >-- >2.20.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 28761
:
123232
|
123235
|
123246
|
123351