From b2c5d320bf0fb3e35ca7beddf8b7bc0d84dfbed3 Mon Sep 17 00:00:00 2001 From: Philippe Date: Fri, 5 May 2017 16:32:29 -0400 Subject: [PATCH] ID change for jQuery listener In modules/common/patron_search.tt, jQuery was listenning for #borrower_data but should have listen for #guarantor_data. https://bugs.koha-community.org/show_bug.cgi?id=12446 --- C4/Members/Attributes.pm | 2 ++ C4/Utils/DataTables/Members.pm | 8 ++++---- koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt | 4 ++-- members/moremember.pl | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/C4/Members/Attributes.pm b/C4/Members/Attributes.pm index b4f37e0..2f3bd49 100644 --- a/C4/Members/Attributes.pm +++ b/C4/Members/Attributes.pm @@ -388,7 +388,9 @@ sub _sort_by_code { $guarantor_attributes = get_guarantor_attributes(); returns an array reference containing attributes to be shared between guarantor and guarantee. + =cut + sub get_guarantor_shared_attributes{ my @attributes = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax ); if( my @additional = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){ diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm index f151cd1..846bcb3 100644 --- a/C4/Utils/DataTables/Members.pm +++ b/C4/Utils/DataTables/Members.pm @@ -2,7 +2,7 @@ package C4::Utils::DataTables::Members; use Modern::Perl; use C4::Context; -use C4::Members qw/GetMemberIssuesAndFines/; +use C4::Members; use C4::Members::Attributes qw/get_guarantor_shared_attributes/; use C4::Utils::DataTables; use Koha::DateUtils; @@ -49,14 +49,14 @@ sub search { } - my $dbh = C4::Context->dbh; + $dbh = C4::Context->dbh; my @columns = qw( borrowernumber surname firstname streetnumber streettype address address2 city state zipcode country cardnumber dateexpiry borrowernotes branchcode email userid dateofbirth categorycode ); if( my @guarantor_attributes = @{ get_guarantor_shared_attributes() }){ foreach my $item (@guarantor_attributes) { if (! grep {$_ eq $item} @columns) { push @columns, $item; - } - } + } + } }; my $borrowers_columns = ""; foreach my $item (@columns) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt index ab0d15e..46d044d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt @@ -112,9 +112,9 @@ $(document).ready(function(){ $("body").on("click",".select_user",function(e){ e.preventDefault(); var borrowernumber = $(this).data("borrowernumber"); - var borrower_data = $("#borrower_data"+borrowernumber).val(); + var borrower_data = $("#guarantor_data"+borrowernumber).val(); var guarantor_attributes = $("#guarantor_attributes").val(); - select_user( borrowernumber, JSON.parse(borrower_data), JSON.parse(guarantor_attributes) ); + select_user( borrowernumber, JSON.parse(borrower_data), JSON.parse(guarantor_attributes) ); }); }); diff --git a/members/moremember.pl b/members/moremember.pl index 5fddbeb..7b18fdb 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -218,7 +218,7 @@ if ( $count ) { ( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' || $category_type eq 'I' ); if (my $guarantor = $patron->guarantor){ - $template->param(isguarantor => 1); + $template->param(isguarantor => 1); $template->param(guarantor => $guarantor); } -- 1.9.1