@@ -, +, @@
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)
---
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 16 ++++++++++++++++
opac/opac-user.pl | 12 ++++++++++++
2 files changed, 28 insertions(+)
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
@@ -198,6 +198,9 @@
Barcode |
[% END %]
Call no. |
+ [% IF ( show_library ) %]
+ Library |
+ [% END %]
[% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
Renew |
[% END %]
@@ -293,6 +296,12 @@
Call no.:
[% ISSUE.itemcallnumber | html %]
+ [% IF ( show_library ) %]
+
+ Library:
+ [% ISSUE.library | html %]
+ |
+ [% END %]
[% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
[% IF ISSUE.renewed %]Renewed! [% END %]
@@ -498,6 +507,7 @@
[% UNLESS ( item_level_itypes ) %] | Item type | [% END %]
[% IF ( show_barcode ) %]Barcode | [% END %]
Call no. |
+ [% IF ( show_library ) %]Library | [% END %]
Due |
[% IF ( OpacRenewalAllowed ) %]
Renew |
@@ -568,6 +578,12 @@
Call no.:
[% OVERDUE.itemcallnumber | html %]
+ [% IF ( show_library ) %]
+
+ Library:
+ [% OVERDUE.library | html %]
+ |
+ [% END %]
Date due:
--- a/opac/opac-user.pl
+++ a/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 } );
--
|