Bugzilla – Attachment 97145 Details for
Bug 24364
Display item holding library in opac issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Nice enchancement, thanks Matts!
Bug-24364-Display-item-holding-library-in-opac-iss.patch (text/plain), 5.89 KB, created by
Lucas Gass
on 2020-01-09 23:43:32 UTC
(
hide
)
Description:
Nice enchancement, thanks Matts!
Filename:
MIME Type:
Creator:
Lucas Gass
Created:
2020-01-09 23:43:32 UTC
Size:
5.89 KB
patch
obsolete
>From 2b3279bc3262aba0f7fa72e17512be563952d9e5 Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Thu, 1 Aug 2019 11:15:27 +0200 >Subject: [PATCH] Bug 24364: Display item holding library in opac issues > >Test plan: > > 1) Create a SHOW_LIB patron attribute type, with YES_NO as authorized value category. > (Administration -> Patron attribute types -> New patron attribute type) > Check 'Display in OPAC' and 'Editable in OPAC' if you want users to be able to > toggle library display themselves. > > 2) Set the SHOW_LIB attribute to yes for a given patron. > > 3) Check that the library is displayed in this patron's opac issues. > ('Your summary' -> 'Checked out' and 'Overdue' tabs) > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 16 ++++++++++++++++ > opac/opac-user.pl | 12 ++++++++++++ > 2 files changed, 28 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 96c494c949..845bb969c7 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -198,6 +198,9 @@ > <th>Barcode</th> > [% END %] > <th>Call no.</th> >+ [% IF ( show_library ) %] >+ <th>Library</th> >+ [% END %] > [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %] > <th class="nosort">Renew</th> > [% END %] >@@ -293,6 +296,12 @@ > <span class="tdlabel">Call no.:</span> > [% ISSUE.itemcallnumber | html %] > </td> >+ [% IF ( show_library ) %] >+ <td class="library"> >+ <span class="tdlabel">Library:</span> >+ [% ISSUE.library | html %] >+ </td> >+ [% END %] > [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %] > <td class="renew"> > [% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %] >@@ -498,6 +507,7 @@ > [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %] > [% IF ( show_barcode ) %]<th>Barcode</th>[% END %] > <th>Call no.</th> >+ [% IF ( show_library ) %]<th>Library</th>[% END %] > <th class="title-string psort">Due</th> > [% IF ( OpacRenewalAllowed ) %] > <th class="nosort">Renew</th> >@@ -568,6 +578,12 @@ > <span class="tdlabel">Call no.:</span> > [% OVERDUE.itemcallnumber | html %] > </td> >+ [% IF ( show_library ) %] >+ <td> >+ <span class="tdlabel">Library:</span> >+ [% OVERDUE.library | html %] >+ </td> >+ [% END %] > <td> > <span title="[% OVERDUE.date_due | html %]"> > <span class="tdlabel">Date due:</span> >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 6c55ad2965..c9a7cb15e6 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -46,6 +46,7 @@ use Koha::Patron::Discharge; > use Koha::Patrons; > > use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE'; >+use constant ATTRIBUTE_SHOW_LIBRARY => 'SHOW_LIB'; > > use Scalar::Util qw(looks_like_number); > use Date::Calc qw( >@@ -255,6 +256,9 @@ if ( $pending_checkouts->count ) { # Useless test > } > > $issue->{biblio_object} = Koha::Biblios->find($issue->{biblionumber}); >+ my $item = Koha::Items->find($issue->{'itemnumber'}); >+ my $library = Koha::Libraries->find($item->holdingbranch); >+ $issue->{'library'} = $library->branchname; > push @issuedat, $issue; > $count++; > >@@ -296,6 +300,14 @@ if ($show_barcode) { > } > $template->param( show_barcode => 1 ) if $show_barcode; > >+my $show_library = Koha::Patron::Attribute::Types->search( >+ { code => ATTRIBUTE_SHOW_LIBRARY } )->count; >+if ($show_library) { >+ my $patron_show_library = GetBorrowerAttributeValue($borrowernumber, ATTRIBUTE_SHOW_LIBRARY); >+ undef $show_library if defined($patron_show_library) && !$patron_show_library; >+} >+$template->param( show_library => 1 ) if $show_library; >+ > # now the reserved items.... > my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } ); > >-- >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 24364
:
96894
|
97145
|
97431
|
97440