@@ -, +, @@
table in detail page
- Apply this patches
- Run the upgrade:
$ sudo koha-shell kohadev
k$ cd kohaclone
k$ perl installer/data/mysql/updatedatabase.pl
- Have an item with shelving location set to something not void
- Have the item set home and holding libraries for testing purposes.
- Set 'OpacLocationBranchToDisplay' to 'home and holding libraries' [*]
- Visit the OPAC detail page for the record containing the item
- Loop through all OpacLocationOnDetail options (except from 'column', we leave it for later).
- Go to Administration > Columns settings
- Make item_shelving_location available in the OPAC section
- Reload the OPAC detail page
- Set OpacLocationOnDetail to 'on a separate column'
- Reload the OPAC detail page
- Sign off :-D
---
admin/columns_settings.yml | 3 +++
.../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 11 ++++++-----
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 11 +++++++++--
opac/opac-detail.pl | 8 ++++----
4 files changed, 22 insertions(+), 11 deletions(-)
--- a/admin/columns_settings.yml
+++ a/admin/columns_settings.yml
@@ -265,6 +265,9 @@ modules:
-
columnname: item_home_location
-
+ columnname: item_shelving_location
+ is_hidden: 1
+ -
columnname: item_ccode
-
columnname: item_callnumber
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
@@ -143,12 +143,13 @@ OPAC:
both: "home and holding libraries"
- for items on the OPAC record details page.
-
- - Display the shelving location under the
- - pref: OpacLocationBranchToDisplayShelving
+ - 'Display the shelving location '
+ - pref: OpacLocationOnDetail
choices:
- home: "home library"
- holding: "holding library"
- both: "home and holding libraries"
+ home: "below the home library"
+ holding: "below the holding library"
+ both: "below both home and holding libraries"
+ column: "on a separate column"
- for items on the OPAC record details page.
-
- pref: OpacKohaUrl
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
@@ -1190,6 +1190,8 @@
Home library | [% END %]
[% IF ( itemdata_ccode ) %]
Collection | [% END %]
+ [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %]
+ Shelving location | [% END %]
Call number |
[% IF ( itemdata_enumchron ) %]
Vol info | [% END %]
@@ -1242,7 +1244,7 @@
[% ITEM_RESULT.holding_branch_opac_info %]
- [% IF ( OpacLocationBranchToDisplayShelving == 'holding' || OpacLocationBranchToDisplayShelving == 'both' ) %]
+ [% IF ( Koha.Preference('OpacLocationOnDetail') == 'holding' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %]
[% ITEM_RESULT.location_description %]
[% END %]
@@ -1267,7 +1269,7 @@
[% ITEM_RESULT.home_branch_opac_info %]
- [% IF ( OpacLocationBranchToDisplayShelving == 'home' || OpacLocationBranchToDisplayShelving == 'both' ) %]
+ [% IF ( Koha.Preference('OpacLocationOnDetail') == 'home' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %]
[% ITEM_RESULT.location_description %]
[% END %]
@@ -1277,6 +1279,11 @@
[% IF ( itemdata_ccode ) %]
[% ITEM_RESULT.ccode %] |
[% END %]
+
+ [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %]
+ [% ITEM_RESULT.location_description %] |
+ [% END %]
+
[% IF ( ITEM_RESULT.itemcallnumber ) %]
[% ITEM_RESULT.itemcallnumber %]
--- a/opac/opac-detail.pl
+++ a/opac/opac-detail.pl
@@ -685,7 +685,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) {
$itm->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} );
$itm->{'description'} = $itemtypes->{ $itm->{itype} }->{translated_description};
}
- foreach (qw(ccode enumchron copynumber itemnotes uri)) {
+ foreach (qw(ccode enumchron copynumber itemnotes location_description uri)) {
$itemfields{$_} = 1 if ($itm->{$_});
}
@@ -759,7 +759,8 @@ my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib
itemdata_enumchron => $itemfields{enumchron},
itemdata_uri => $itemfields{uri},
itemdata_copynumber => $itemfields{copynumber},
- itemdata_itemnotes => $itemfields{itemnotes},
+ itemdata_itemnotes => $itemfields{itemnotes},
+ itemdata_location => $itemfields{location_description},
subtitle => $subtitle,
OpacStarRatings => C4::Context->preference("OpacStarRatings"),
);
@@ -1190,8 +1191,7 @@ if ( C4::Context->preference('UseCourseReserves') ) {
}
$template->param(
- 'OpacLocationBranchToDisplay' => C4::Context->preference('OpacLocationBranchToDisplay') ,
- 'OpacLocationBranchToDisplayShelving' => C4::Context->preference('OpacLocationBranchToDisplayShelving'),
+ 'OpacLocationBranchToDisplay' => C4::Context->preference('OpacLocationBranchToDisplay'),
);
output_html_with_http_headers $query, $cookie, $template->output;
--
|