From 3d85461127f8176ea816355b55a8c2bf6210f01d Mon Sep 17 00:00:00 2001 From: Christopher Brannon Date: Fri, 5 Oct 2018 22:45:45 +0000 Subject: [PATCH] Bug 18355: Update opac-detail.pl/tt to show both Adding dependancy of bug 21503 for templates to fully fail correctly. To Test this patch: 1) Apply patch / restart_all 2) Check out an item. 3) Check item in with ReturnToShelvingCart set to Move. 4) View the item in opac-detail.pl and see the permanent location, and the cart location in parentesis. 5) Try removing opac description from the cart and item sleving location. Refresh opac-detail.pl. Should default to regular description. (If not, may need patch 21503 to test.) 6) To test for code replacement if regular and opac description are missing, you WILL need patch 21503. --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 14 ++++++++++++-- opac/opac-detail.pl | 3 --- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index c451d8d..a0a8731 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1240,7 +1240,12 @@
[% ITEM_RESULT.holding_branch_opac_info | $raw %]
[% IF ( Koha.Preference('OpacLocationOnDetail') == 'holding' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %] - [% ITEM_RESULT.location_description | html %] + + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.permanent_location, opac => '1' ) | html %] + [% IF ITEM_RESULT.location AND ITEM_RESULT.location != ITEM_RESULT.permanent_location %] + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => '1' ) | html %]) + [% END %] + [% END %] @@ -1265,7 +1270,12 @@
[% ITEM_RESULT.home_branch_opac_info | $raw %]
[% IF ( Koha.Preference('OpacLocationOnDetail') == 'home' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %] - [% ITEM_RESULT.location_description | html %] + + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.permanent_location, opac => '1' ) | html %] + [% IF ITEM_RESULT.location AND ITEM_RESULT.location != ITEM_RESULT.permanent_location %] + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => '1' ) | html %]) + [% END %] + [% END %] diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 6f10c6b..8afce61 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -682,9 +682,6 @@ if ( not $viewallitems and @items > $max_items_to_display ) { $itm->{'ccode'} = $collections->{$ccode} if defined($ccode) && $collections && exists( $collections->{$ccode} ); my $copynumber = $itm->{'copynumber'}; $itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) ); - if ( defined $itm->{'location'} ) { - $itm->{'location_description'} = $shelflocations->{ $itm->{'location'} }; - } if (exists $itm->{itype} && defined($itm->{itype}) && exists $itemtypes->{ $itm->{itype} }) { $itm->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} ); $itm->{'description'} = $itemtypes->{ $itm->{itype} }->{translated_description}; -- 2.1.4