View | Details | Raw Unified | Return to bug 12446
Collapse All | Expand All

(-)a/C4/Utils/DataTables/Members.pm (-4 / +10 lines)
Lines 34-45 sub search { Link Here
34
    my $dbh = C4::Context->dbh;
34
    my $dbh = C4::Context->dbh;
35
    my @columns = qw( borrowernumber surname firstname streetnumber streettype address address2 city state zipcode country cardnumber dateexpiry borrowernotes branchcode email userid dateofbirth categorycode );
35
    my @columns = qw( borrowernumber surname firstname streetnumber streettype address address2 city state zipcode country cardnumber dateexpiry borrowernotes branchcode email userid dateofbirth categorycode );
36
    if( my @guarantor_attributes = @{ get_guarantor_shared_attributes() }){
36
    if( my @guarantor_attributes = @{ get_guarantor_shared_attributes() }){
37
        my %seen = ();
37
        foreach my $item (@guarantor_attributes) {
38
        @columns = grep { ! $seen{ $_ }++ } ( @columns, @guarantor_attributes );
38
             if (! grep {$_ eq $item} @columns) {
39
                 push @columns, $item;
40
	     }
41
	}
39
    };
42
    };
40
    $_ = "borrowers.".$dbh->quote_identifier($_) for (@columns);
43
    my $borrowers_columns = "";
44
    foreach my $item (@columns) {
45
        $borrowers_columns .= "borrowers." . $item . ", ";
46
    }
41
47
42
    my $select = "SELECT ${ \join(',', @columns) },
48
    my $select = "SELECT " . $borrowers_columns . "
43
        categories.description AS category_description, categories.category_type,
49
        categories.description AS category_description, categories.category_type,
44
        branches.branchname";
50
        branches.branchname";
45
    my $from = "FROM borrowers
51
    my $from = "FROM borrowers
(-)a/installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql (-3 lines)
Lines 9-14 VALUES ('AdditionalGuarantorField','',NULL,'Additional fields name to be transfe Link Here
9
-- ********* --
9
-- ********* --
10
ALTER TABLE categories ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0';
10
ALTER TABLE categories ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0';
11
11
12
-- Set defaults for new column
13
UPDATE categories set canbeguarantee = 1 WHERE category_type IN ('C', 'P');
14
(-)a/members/memberentry.pl (-1 / +1 lines)
Lines 251-257 if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P')) { Link Here
251
	        foreach (qw(streetnumber address streettype address2
251
	        foreach (qw(streetnumber address streettype address2
252
                        zipcode country city state phone phonepro mobile fax email emailpro branchcode
252
                        zipcode country city state phone phonepro mobile fax email emailpro branchcode
253
                        B_streetnumber B_streettype B_address B_address2
253
                        B_streetnumber B_streettype B_address B_address2
254
                        B_city B_state B_zipcode B_country B_email B_phone)) {		        
254
                        B_city B_state B_zipcode B_country B_email B_phone)) {
255
                        $newdata{$_} = $guarantordata->{$_};
255
                        $newdata{$_} = $guarantordata->{$_};
256
	        }
256
	        }
257
            my $additionalGuarantorField=C4::Context->preference("AdditionalGuarantorField");
257
            my $additionalGuarantorField=C4::Context->preference("AdditionalGuarantorField");
(-)a/members/moremember.pl (-6 lines)
Lines 201-211 if ( $count ) { Link Here
201
    ( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' || $category_type eq 'I' );
201
    ( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' || $category_type eq 'I' );
202
202
203
}
203
}
204
else {
205
	#if ($category_type eq 'C'){
206
	#	$template->param('C' => 1);
207
	#}
208
}
209
if ($data->{'guarantorid'}){
204
if ($data->{'guarantorid'}){
210
    my ($guarantor) = GetMember( 'borrowernumber' =>$data->{'guarantorid'});
205
    my ($guarantor) = GetMember( 'borrowernumber' =>$data->{'guarantorid'});
211
    $template->param(guarantor => 1);
206
    $template->param(guarantor => 1);
212
- 

Return to bug 12446