Bugzilla – Attachment 106004 Details for
Bug 25801
Add itemnumber parameter to the OPAC detail page that allows to show a single item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25801: Add itemnumber parameter to opac-detail
Bug-25801-Add-itemnumber-parameter-to-opac-detail.patch (text/plain), 3.12 KB, created by
Owen Leonard
on 2020-06-18 12:19:08 UTC
(
hide
)
Description:
Bug 25801: Add itemnumber parameter to opac-detail
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-06-18 12:19:08 UTC
Size:
3.12 KB
patch
obsolete
>From 9b11ea642047909c3ef5df5b1f71e40f19b23b39 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 18 Jun 2020 11:34:27 +0000 >Subject: [PATCH] Bug 25801: Add itemnumber parameter to opac-detail > >Note: The GetItemsInfo call is now suboptimal. Leaving it as-is >for now in the hope that item refactoring picks it up ;) > >Test plan: >Test opac-detail via biblionumber (regular use). >Test opac-detail by passing an itemnumber in the URL. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- > opac/opac-detail.pl | 7 +++++++ > 2 files changed, 9 insertions(+), 2 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 8752824d8a..b4eb6b8725 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -479,8 +479,8 @@ > [% ELSE %] > <li id="tab_holdings"> > [% END %] >- [% BLOCK holding_tab_title %][% IF SeparateHoldings %]<span>[% LoginBranchname | html %] holdings</span>[% ELSE %]<span>Holdings</span>[% END %][% END %] >- <a href="#holdings">[% PROCESS holding_tab_title %] [% UNLESS too_many_items %][% ' ( ' _ (itemloop.size || 0) _ ' )' | html %][% END %]</a> >+ [% BLOCK holding_tab_title %][% IF SeparateHoldings %]<span>[% LoginBranchname | html %] holdings</span>[% ELSE %][% IF specific_item %]<span>Item details</span>[% ELSE %]<span>Holdings</span>[% END %][% END %][% END %] >+ <a href="#holdings">[% PROCESS holding_tab_title %] [% UNLESS too_many_items OR specific_item %][% ' ( ' _ (itemloop.size || 0) _ ' )' | html %][% END %]</a> > </li> > [% IF (SeparateHoldings) %] > <li><a href="#otherholdings">Other holdings [% ' ( ' _ (otheritemloop.size || 0) _ ' )' | html %]</a></li> >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 5c1880fbed..ce091b78fb 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -67,6 +67,9 @@ my $query = CGI->new(); > my $biblionumber = $query->param('biblionumber') || $query->param('bib') || 0; > $biblionumber = int($biblionumber); > >+my $specific_item = $query->param('itemnumber') ? Koha::Items->find( scalar $query->param('itemnumber') ) : undef; >+$biblionumber = $specific_item->biblionumber if $specific_item; >+ > my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > { > template_name => "opac-detail.tt", >@@ -77,6 +80,10 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > ); > > my @all_items = GetItemsInfo($biblionumber); >+if( $specific_item ) { >+ @all_items = grep { $_->{itemnumber} == $query->param('itemnumber') } @all_items; >+ $template->param( specific_item => 1 ); >+} > my @hiddenitems; > my $patron = Koha::Patrons->find( $borrowernumber ); > our $borcat= q{}; >-- >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 25801
:
106003
|
106004
|
106321
|
106322
|
106323
|
106366
|
106367
|
106368