Bugzilla – Attachment 164191 Details for
Bug 36281
Restricted info is displayed even if item is not restricted (OPAC details)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36281: Display restricted info only if item is not restricted (OPAC details)
Bug-36281-Display-restricted-info-only-if-item-is-.patch (text/plain), 3.50 KB, created by
Nick Clemens (kidclamp)
on 2024-04-01 13:52:36 UTC
(
hide
)
Description:
Bug 36281: Display restricted info only if item is not restricted (OPAC details)
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-04-01 13:52:36 UTC
Size:
3.50 KB
patch
obsolete
>From 90153a7a9884390d6b4bcbed708940fec00ce29f Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 8 Mar 2024 11:29:19 +0100 >Subject: [PATCH] Bug 36281: Display restricted info only if item is not > restricted (OPAC details) > >If you define a description for restricted = 0 : >In OPAC details, restricted info is displayed even if item is not restricted (value 0). > >This patch fixes by adding 'IF item.restricted'. >Also creates a BLOCK to avoid code duplication. >Also adds span around status text to create easier translation. > >Test plan : >1) Create a description in restricted autorised values category for value 0 >2) Create a description in restricted autorised values category for value 1 >3) Edit an biblio record to add an item with restricted=0 and an item with restricted=1 >4) Display this biblio on OPAC details page >=> Check you see resticted info only for restricted item > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../bootstrap/en/includes/item-status.inc | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 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 2d19d918cea..f98cf180eb5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -90,19 +90,26 @@ > [% END %] > [% END %] > >+[% BLOCK restricted_info %] >+ [% IF item.restricted %] >+ [% SET restricted_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted, opac => 1 ) %] >+ [% IF restricted_lib %] >+ <span class="restricted">([% restricted_lib | html %])</span> >+ [% END %] >+ [% END %] >+[% END %] > >-[% SET restricted_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted, opac => 1 ) %] > [% IF item.notforloan %] > [% SET itemavailable = 0 %] > [% notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan, opac => 1 ) %] > [% IF notforloan_lib %] >- <span class="item-status notforloan">[% notforloan_lib | html %] [% IF restricted_lib %]<span class="restricted">([% restricted_lib | html %])</span>[% END %]</span> >+ <span class="item-status notforloan"><span>[% notforloan_lib | html %]</span> [% PROCESS restricted_info %]</span> > [% ELSE %] >- <span class="item-status notforloan">Not for loan [% IF restricted_lib %]<span class="restricted">([% restricted_lib | html %])</span>[% END %]</span> >+ <span class="item-status notforloan"><span>Not for loan</span> [% PROCESS restricted_info %]</span> > [% END %] > [% ELSIF item.itemtype.notforloan %] > [% SET itemavailable = 0 %] >- <span class="item-status notforloan">Not for loan [% IF restricted_lib %]<span class="restricted">([% restricted_lib | html %])</span>[% END %]</span> >+ <span class="item-status notforloan"><span>Not for loan</span> [% PROCESS restricted_info %]</span> > [% END %] > > [% IF ( item.bundle_host ) %] >@@ -135,5 +142,5 @@ > [% END %] > > [% IF ( itemavailable ) %] >- <span class="item-status available">Available [% IF restricted_lib %]<span class="restricted">([% restricted_lib | html %])</span>[% END %]</span> >+ <span class="item-status available"><span>Available</span> [% PROCESS restricted_info %]</span> > [% END %] >-- >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 36281
:
162950
|
163009
| 164191