@@ -, +, @@ --- C4/Utils/DataTables/Members.pm | 14 ++++++++++---- .../atomicupdate/bug_12446-EnableAdultGarantee.sql | 3 --- members/memberentry.pl | 2 +- members/moremember.pl | 5 ----- 4 files changed, 11 insertions(+), 13 deletions(-) --- a/C4/Utils/DataTables/Members.pm +++ a/C4/Utils/DataTables/Members.pm @@ -34,12 +34,18 @@ sub search { my $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() }){ - my %seen = (); - @columns = grep { ! $seen{ $_ }++ } ( @columns, @guarantor_attributes ); + foreach my $item (@guarantor_attributes) { + if (! grep {$_ eq $item} @columns) { + push @columns, $item; + } + } }; - $_ = "borrowers.".$dbh->quote_identifier($_) for (@columns); + my $borrowers_columns = ""; + foreach my $item (@columns) { + $borrowers_columns .= "borrowers." . $item . ", "; + } - my $select = "SELECT ${ \join(',', @columns) }, + my $select = "SELECT " . $borrowers_columns . " categories.description AS category_description, categories.category_type, branches.branchname"; my $from = "FROM borrowers --- a/installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql +++ a/installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql @@ -9,6 +9,3 @@ VALUES ('AdditionalGuarantorField','',NULL,'Additional fields name to be transfe -- ********* -- ALTER TABLE categories ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0'; --- Set defaults for new column -UPDATE categories set canbeguarantee = 1 WHERE category_type IN ('C', 'P'); - --- a/members/memberentry.pl +++ a/members/memberentry.pl @@ -251,7 +251,7 @@ if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P')) { foreach (qw(streetnumber address streettype address2 zipcode country city state phone phonepro mobile fax email emailpro branchcode B_streetnumber B_streettype B_address B_address2 - B_city B_state B_zipcode B_country B_email B_phone)) { + B_city B_state B_zipcode B_country B_email B_phone)) { $newdata{$_} = $guarantordata->{$_}; } my $additionalGuarantorField=C4::Context->preference("AdditionalGuarantorField"); --- a/members/moremember.pl +++ a/members/moremember.pl @@ -201,11 +201,6 @@ if ( $count ) { ( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' || $category_type eq 'I' ); } -else { - #if ($category_type eq 'C'){ - # $template->param('C' => 1); - #} -} if ($data->{'guarantorid'}){ my ($guarantor) = GetMember( 'borrowernumber' =>$data->{'guarantorid'}); $template->param(guarantor => 1); --