Bugzilla – Attachment 65517 Details for
Bug 19028
Add 'shelving location' to holdings table in detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19028: Add 'shelving location' to holdings table in detail page
Bug-19028-Add-shelving-location-to-holdings-table-.patch (text/plain), 8.13 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-08-04 19:41:09 UTC
(
hide
)
Description:
Bug 19028: Add 'shelving location' to holdings table in detail page
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-08-04 19:41:09 UTC
Size:
8.13 KB
patch
obsolete
>From e9f9c97cfededca40c02c11ea2d65e5504a9a39c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 3 Aug 2017 12:55:07 -0300 >Subject: [PATCH] Bug 19028: Add 'shelving location' to holdings table in > detail page > >This patch adds the option to show shelving locations on a separate >column. This is controlled by a new syspref, 'OpacLocationOnDetail', >which replaces 'OpacLocationBranchToDisplayShelving', adding a >conveniente 'column' option. > >The new 'Shelving location' column is conveniently added to the columns >configuration entry added by bug 16759 for this purpose. > >The current behaviour is preserved. > >To test: >- Apply this patches >- Run the upgrade: > $ sudo koha-shell kohadev > k$ cd kohaclone > k$ perl installer/data/mysql/updatedatabase.pl >=> SUCCESS: Upgrade doesn't fail >- 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 >=> SUCCESS: Both home and holding libraries are displayed. >- Loop through all OpacLocationOnDetail options (except from 'column', we leave it for later). >=> SUCCESS: Works as expected. >- Go to Administration > Columns settings >- Make item_shelving_location available in the OPAC section >- Reload the OPAC detail page >=> SUCCESS: No change >- Set OpacLocationOnDetail to 'on a separate column' >- Reload the OPAC detail page >=> SUCCESS: Shelving location is displayed on a separate column >- Sign off :-D > >Sponsored-by: Dover > >[*] For testing purposes >--- > 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(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index ab23de9603..e0708fc4c6 100644 >--- a/admin/columns_settings.yml >+++ b/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 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index b6954ef667..7c822449d0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/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 >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 decc5773a9..6796552f4b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1190,6 +1190,8 @@ > <th id="item_home_location" data-colname="item_home_location" class="item_location">Home library</th>[% END %] > [% IF ( itemdata_ccode ) %] > <th id="item_ccode" data-colname="item_ccode" class="collection">Collection</th>[% END %] >+ [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %] >+ <th id="item_shelving_location" data-colname="item_shelving_location" class="shelving_location">Shelving location</th>[% END %] > <th id="item_callnumber" data-colname="item_callnumber" class="call_no">Call number</th> > [% IF ( itemdata_enumchron ) %] > <th id="item_enumchron" data-colname="item_enumchron" class="vol_info">Vol info</th>[% END %] >@@ -1242,7 +1244,7 @@ > </span> > <div class="branch-info-tooltip">[% ITEM_RESULT.holding_branch_opac_info %]</div> > >- [% IF ( OpacLocationBranchToDisplayShelving == 'holding' || OpacLocationBranchToDisplayShelving == 'both' ) %] >+ [% IF ( Koha.Preference('OpacLocationOnDetail') == 'holding' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %] > <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span> > [% END %] > >@@ -1267,7 +1269,7 @@ > </span> > <div class="branch-info-tooltip">[% ITEM_RESULT.home_branch_opac_info %]</div> > >- [% IF ( OpacLocationBranchToDisplayShelving == 'home' || OpacLocationBranchToDisplayShelving == 'both' ) %] >+ [% IF ( Koha.Preference('OpacLocationOnDetail') == 'home' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %] > <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span> > [% END %] > >@@ -1277,6 +1279,11 @@ > [% IF ( itemdata_ccode ) %] > <td class="collection">[% ITEM_RESULT.ccode %]</td> > [% END %] >+ >+ [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %] >+ <td class="shelving_location">[% ITEM_RESULT.location_description %]</td> >+ [% END %] >+ > <td class="call_no" property="sku"> > [% IF ( ITEM_RESULT.itemcallnumber ) %] > [% ITEM_RESULT.itemcallnumber %] >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index ae89f825d7..c400a487d9 100755 >--- a/opac/opac-detail.pl >+++ b/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; >-- >2.13.4
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 19028
:
65480
|
65481
|
65516
|
65517
|
65565
|
65566
|
68466
|
68467
|
68535