From a694b244579fb54e86324ef93354972fe240dc7e 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. Signed-off-by: Jose-Mario --- 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 955a2f4..8cd8dca 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1247,7 +1247,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 %] @@ -1272,7 +1277,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 a7c24ef..794f8c1 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -694,9 +694,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.7.4