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

(-)a/C4/Utils/DataTables/Members.pm (-5 / +2 lines)
Lines 80-92 sub search { Link Here
80
80
81
    $dbh = C4::Context->dbh;
81
    $dbh = C4::Context->dbh;
82
    my @columns = qw( borrowernumber surname firstname othernames flags streetnumber streettype address address2 city state zipcode country cardnumber dateexpiry borrowernotes branchcode email userid dateofbirth categorycode phone phonepro mobile fax email emailpro);
82
    my @columns = qw( borrowernumber surname firstname othernames flags streetnumber streettype address address2 city state zipcode country cardnumber dateexpiry borrowernotes branchcode email userid dateofbirth categorycode phone phonepro mobile fax email emailpro);
83
    my @guarantor_attributes = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax );
83
    my @guarantor_attributes = split(/\|/, C4::Context->preference("GuarantorFields"));
84
    if( my @additional_guarantor_attributes = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){
85
        $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional_guarantor_attributes); # Trim whitespaces
86
        @guarantor_attributes = ( @guarantor_attributes, @additional_guarantor_attributes);
87
    }
88
    if( @guarantor_attributes ){
84
    if( @guarantor_attributes ){
89
        foreach my $item (@guarantor_attributes) {
85
        foreach my $item (@guarantor_attributes) {
86
            $item =~ s/(?:^\s+)|(?:\s+$)//g; # Trim whitespaces
90
             if (! grep {$_ eq $item} @columns) {
87
             if (! grep {$_ eq $item} @columns) {
91
                 push @columns, $item;
88
                 push @columns, $item;
92
            }
89
            }
(-)a/installer/data/mysql/atomicupdate/bug_12446.perl (-1 / +1 lines)
Lines 5-11 if( CheckVersion( $DBversion ) ) { Link Here
5
    ## ******** ##
5
    ## ******** ##
6
    $dbh->do(q{
6
    $dbh->do(q{
7
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
7
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
8
        VALUES ('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free');
8
        VALUES ('GuarantorFields', 'streetnumber|address|address2|city|state|zipcode|country|branchcode|phonepro|mobile|email|emailpro|fax', NULL, 'Fields to be transfered from guarantor to guarantee.', 'free')
9
    });
9
    });
10
10
11
    ## ********* ##
11
    ## ********* ##
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 9-15 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
9
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
9
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
10
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
10
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
11
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
11
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
12
('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free'),
13
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
12
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
14
('AdlibrisCoversEnabled','0',NULL,'Display cover images in OPAC results and detail listing from Swedish retailer Adlibris.','YesNo'),
13
('AdlibrisCoversEnabled','0',NULL,'Display cover images in OPAC results and detail listing from Swedish retailer Adlibris.','YesNo'),
15
('AdlibrisCoversURL','http://www.adlibris.com/se/organisationer/showimagesafe.aspx',NULL,'Base URL for Adlibris cover image web service.','Free'),
14
('AdlibrisCoversURL','http://www.adlibris.com/se/organisationer/showimagesafe.aspx',NULL,'Base URL for Adlibris cover image web service.','Free'),
Lines 216-221 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
216
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
215
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
217
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
216
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
218
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
217
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
218
('GuarantorFields', 'streetnumber|address|address2|city|state|zipcode|country|branchcode|phonepro|mobile|email|emailpro|fax', NULL, 'Fields to be transfered from guarantor to guarantee.', 'free'),
219
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
219
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
220
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
220
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
221
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
221
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-2 / +2 lines)
Lines 281-288 Patrons: Link Here
281
               no: "Don't allow"
281
               no: "Don't allow"
282
         - staff to set the ability for a patron's fines to be viewed by linked patrons in the OPAC.
282
         - staff to set the ability for a patron's fines to be viewed by linked patrons in the OPAC.
283
     -
283
     -
284
         - "These additional following <a href='http://schema.koha-community.org/__VERSION__/tables/borrowers.html' target='blank'>database columns</a> will be transferred from guarantor to guarantee:"
284
         - "These following <a href='http://schema.koha-community.org/__VERSION__/tables/borrowers.html' target='blank'>database columns</a> will be transferred from guarantor to guarantee:"
285
         - pref: AdditionalGuarantorField
285
         - pref: GuarantorFields
286
           class: multi
286
           class: multi
287
         - (separate columns with |)
287
         - (separate columns with |)
288
    Privacy:
288
    Privacy:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt (+2 lines)
Lines 226-231 Link Here
226
                var borrowernumber = $(this).data("borrowernumber");
226
                var borrowernumber = $(this).data("borrowernumber");
227
                var borrower_data = $("#borrower_data"+borrowernumber).val();
227
                var borrower_data = $("#borrower_data"+borrowernumber).val();
228
                var guarantor_attributes = $("#guarantor_attributes").val();
228
                var guarantor_attributes = $("#guarantor_attributes").val();
229
                if ( !guarantor_attributes )
230
                    guarantor_attributes = "{}";
229
                select_user( borrowernumber, JSON.parse(borrower_data), JSON.parse(guarantor_attributes) );
231
                select_user( borrowernumber, JSON.parse(borrower_data), JSON.parse(guarantor_attributes) );
230
            });
232
            });
231
233
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (-4 / +6 lines)
Lines 210-219 function select_user(borrowernumber, borrower, relationship, attributes) { Link Here
210
            fieldset.find('.new_guarantor_relationship').val(relationship);
210
            fieldset.find('.new_guarantor_relationship').val(relationship);
211
        }
211
        }
212
212
213
        for (var i = 0; i < parseInt(attributes.length, 10); i++) {
213
        if ( attributes ) {
214
            var attribute = attributes[i];
214
            for (var i = 0; i < parseInt(attributes.length, 10); i++) {
215
            if (borrower[attribute] != null){
215
                var attribute = attributes[i];
216
                document.forms.entryform[attribute].value = borrower[attribute];
216
                if (borrower[attribute] != null){
217
                    document.forms.entryform[attribute].value = borrower[attribute];
218
                }
217
            }
219
            }
218
        }
220
        }
219
    }
221
    }
(-)a/members/memberentry.pl (-4 / +3 lines)
Lines 808-817 if (C4::Context->preference('EnhancedMessagingPreferences')) { Link Here
808
808
809
$template->param( "show_guarantor"  => $categorycode ? Koha::Patron::Categories->find($categorycode)->canbeguarantee : 1); # associate with step to know where you are
809
$template->param( "show_guarantor"  => $categorycode ? Koha::Patron::Categories->find($categorycode)->canbeguarantee : 1); # associate with step to know where you are
810
810
811
my @guarantor_attributes = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax );
811
my @guarantor_attributes = split(/\|/, C4::Context->preference("GuarantorFields"));
812
if( my @additional_guarantor_attributes = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){
812
if (@guarantor_attributes) {
813
    $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional_guarantor_attributes); # Trim whitespaces
813
    $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@guarantor_attributes); # Trim whitespaces
814
    @guarantor_attributes = ( @guarantor_attributes, @additional_guarantor_attributes);
815
}
814
}
816
$template->param( "guarantor_attributes" => \@guarantor_attributes );
815
$template->param( "guarantor_attributes" => \@guarantor_attributes );
817
$debug and warn "memberentry step: $step";
816
$debug and warn "memberentry step: $step";
(-)a/svc/members/search (-5 / +3 lines)
Lines 91-100 $results = C4::Utils::DataTables::Members::search( Link Here
91
    }
91
    }
92
) unless $results;
92
) unless $results;
93
93
94
my @attributes = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax );
94
my @attributes = split(/\|/, C4::Context->preference("GuarantorFields"));
95
if( my @additional = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){
95
if (@attributes) {
96
    $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional); # Trim whitespaces
96
    $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@attributes); # Trim whitespaces
97
    @attributes = ( @attributes, @additional);
98
}
97
}
99
$template->param(
98
$template->param(
100
    sEcho => $sEcho,
99
    sEcho => $sEcho,
101
- 

Return to bug 12446