Bugzilla – Attachment 83630 Details for
Bug 10676
OpacHiddenItems not working for restricted on OPAC detail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10676: Fix behaviour of OpacHiddenItems for items.restricted
Bug-10676-Fix-behaviour-of-OpacHiddenItems-for-ite.patch (text/plain), 5.27 KB, created by
Katrin Fischer
on 2019-01-04 10:15:54 UTC
(
hide
)
Description:
Bug 10676: Fix behaviour of OpacHiddenItems for items.restricted
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-01-04 10:15:54 UTC
Size:
5.27 KB
patch
obsolete
>From 42c8a9da20e588891cfad8a6c6907aaafd313730 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >Date: Fri, 4 Jan 2019 10:11:03 +0000 >Subject: [PATCH] Bug 10676: Fix behaviour of OpacHiddenItems for > items.restricted > >The numerical restricted value was overwritten in GetItemsInfo >with the description. So OpacHiddenItems would only work for >restricted using the description, not the numerical value >of the authorised value like for other similar status fields. > >This changes GetItemsInfo to use a separate variable for >the description, as it's already done for notforloan and >changes the template files where the variable is used >accordingly. > >To test >- Before applying patch >- Configure OpacHiddenItems with: > restricted: [1] >- Find a record with more than one item and mark one of the items > as "Restricted Access" > (assume standard sample data - check authorised value if status doesn't exist) >- Verify the item is still shown in OPAC. >- Apply patch >- Verify that the item is now hidden >- Verify that the status still displays nicely in the staff detail page >- Delete OpacHiddenItems >- Verify that the status is showing nicely in the OPAC detail page >--- > C4/Items.pm | 4 ++-- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc | 10 +++++----- > 3 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 3b006c686e..b334d1f5a3 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1047,8 +1047,8 @@ sub GetItemsInfo { > > # get restricted status and description if applicable > $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.restricted', authorised_value => $data->{restricted} }); >- $data->{restricted} = $descriptions->{lib} // ''; >- $data->{restrictedopac} = $descriptions->{opac_description} // ''; >+ $data->{restrictedvalue} = $descriptions->{lib} // ''; >+ $data->{restrictedvalueopac} = $descriptions->{opac_description} // ''; > > # my stack procedures > $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.stack', authorised_value => $data->{stack} }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index bfab7727aa..dde81042fc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -497,7 +497,7 @@ > [% END %] > > [% IF ( item.restricted ) %] >- <span class="restricted">([% item.restricted | html %])</span> >+ <span class="restricted">([% item.restrictedvalue | html %])</span> > [% END %] > > </td> >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 99bdeed344..1fb9278da7 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -65,13 +65,13 @@ > [% IF NOT ( item.isa('Koha::Item') ) AND item.itemnotforloan %] > [% SET itemavailable = 0 %] > [% IF ( item.notforloanvalueopac ) %] >- <span class="item-status notforloan">[% item.notforloanvalueopac | html %] [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac | html %])</span>[% END %]</span> >+ <span class="item-status notforloan">[% item.notforloanvalueopac | html %] [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</span> > [% ELSE %] >- <span class="item-status notforloan">Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac | html %])</span>[% END %]</span> >+ <span class="item-status notforloan">Not for loan [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</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.restrictedopac ) %]<span class="restricted">([% item.restrictedopac | html %])</span>[% END %]</span> >+ <span class="item-status notforloan">Not for loan [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</span> > [% END %] > > [% IF ( item.damaged ) %] >@@ -90,6 +90,6 @@ > [% END %] > > [% IF ( itemavailable ) %] >- [% IF NOT item.isa('Koha::Item') %][% SET restrictedopac = item.restrictedopac %][% END %] >- <span class="item-status available">Available [% IF restrictedopac %]<span class="restricted">([% restrictedopac | html %])</span>[% END %]</span> >+ [% 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> > [% END %] >-- >2.11.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 10676
:
83630
|
83631
|
83668
|
83669
|
83670
|
83671
|
85122
|
85123