Bugzilla – Attachment 123351 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.50 KB, created by
Lucas Gass (lukeg)
on 2021-07-31 13:40:54 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-31 13:40:54 UTC
Size:
3.50 KB
patch
obsolete
>From 93ffb960b56f726b9af06ab89a6477482de400b6 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 >11. restricted status should NOT cause the item to become unavailable >11. The item-status.inc also effects opac-detail and opac-cart >12. look at those and make sure everything looks correct and statuses are properly reflected >--- > .../bootstrap/en/includes/item-status.inc | 25 +++++++++++-------- > 1 file changed, 15 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..19853287a7 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 ) %] >@@ -96,6 +93,14 @@ > [% 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 %] >+ >+[% IF (item.restricted ) %] >+ [% 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 %] >-- >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