Bugzilla – Attachment 58598 Details for
Bug 17825
Remove C4::Members::AttributeTypes::AttributeTypeExists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 17825: Remove the use of AttributeTypeExists from opac-user.pl
SIGNED-OFF-Bug-17825-Remove-the-use-of-AttributeTy.patch (text/plain), 1.99 KB, created by
Owen Leonard
on 2017-01-04 17:20:15 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 17825: Remove the use of AttributeTypeExists from opac-user.pl
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2017-01-04 17:20:15 UTC
Size:
1.99 KB
patch
obsolete
>From 097858d0264854458b6d776a4f19bed9c32517f3 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 29 Dec 2016 11:32:27 -0300 >Subject: [PATCH] [SIGNED-OFF] Bug 17825: Remove the use of AttributeTypeExists > from opac-user.pl > >With the introducion of Koha::Object-based >Koha::Patron::Attribute::Type(s) there's no need for using this >function. > >This patch replaces it with a regular ->search + ->count call. > >To test: >- Have a user with checkouts logged into the OPAC on the opac-user.pl >page >- Set the SHOW_BCODE attribute to 'no' on the staff interface for the >user. >- Reload opac-user.pl >=> SUCCESS: The barcode is not shown for checked out items. >- Set the SHOW_BCODE atttribute to 'yes' on the staff interface for the >user. >- Reload opac-user.pl >=> SUCCESS: The barcode is shown for checked out items. >- Delete the Patron attribute type SHOW_BCODE >- Reload opac-user.pl >=> SUCCESS: No barcode is shown for checked out items >- Sign off :-D > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > opac/opac-user.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 04a94c0..0835f47 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -36,6 +36,7 @@ use C4::Letters; > use Koha::DateUtils; > use Koha::Holds; > use Koha::Database; >+use Koha::Patron::Attribute::Types; > use Koha::Patron::Messages; > use Koha::Patron::Discharge; > use Koha::Patrons; >@@ -268,7 +269,8 @@ $template->param( canrenew => $canrenew ); > $template->param( OVERDUES => \@overdues ); > $template->param( overdues_count => $overdues_count ); > >-my $show_barcode = C4::Members::AttributeTypes::AttributeTypeExists( ATTRIBUTE_SHOW_BARCODE ); >+my $show_barcode = Koha::Patron::Attribute::Types->search( >+ { code => ATTRIBUTE_SHOW_BARCODE } )->count; > if ($show_barcode) { > my $patron_show_barcode = GetBorrowerAttributeValue($borrowernumber, ATTRIBUTE_SHOW_BARCODE); > undef $show_barcode if defined($patron_show_barcode) && !$patron_show_barcode; >-- >2.1.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 17825
:
58491
|
58492
|
58598
|
58599
|
61713
|
61714