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

(-)a/C4/Members/Attributes.pm (-4 / +3 lines)
Lines 374-383 sub _sort_by_code { Link Here
374
=cut
374
=cut
375
375
376
sub get_guarantor_shared_attributes{
376
sub get_guarantor_shared_attributes{
377
    my @attributes    = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax );
377
    my @attributes;
378
    if( my @additional = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){
378
    if( @attributes = split(/\|/, C4::Context->preference("GuarantorFields")) ){
379
        $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional); # Trim whitespaces
379
        $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@attributes); # Trim whitespaces
380
        @attributes = ( @attributes, @additional);
381
    }
380
    }
382
    return \@attributes;
381
    return \@attributes;
383
}
382
}
(-)a/installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql (-1 / +1 lines)
Lines 2-8 Link Here
2
-- SYSPREFS --
2
-- SYSPREFS --
3
-- ******** --
3
-- ******** --
4
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
4
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
5
VALUES ('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free');
5
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')
6
6
7
-- ********* --
7
-- ********* --
8
-- STRUCTURE --
8
-- STRUCTURE --
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 8-14 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
8
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
8
('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
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
9
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
10
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
10
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
11
('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free'),
12
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
11
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
13
('AdlibrisCoversEnabled','0',NULL,'Display cover images in OPAC results and detail listing from Swedish retailer Adlibris.','YesNo'),
12
('AdlibrisCoversEnabled','0',NULL,'Display cover images in OPAC results and detail listing from Swedish retailer Adlibris.','YesNo'),
14
('AdlibrisCoversURL','http://www.adlibris.com/se/organisationer/showimagesafe.aspx',NULL,'Base URL for Adlibris cover image web service.','Free'),
13
('AdlibrisCoversURL','http://www.adlibris.com/se/organisationer/showimagesafe.aspx',NULL,'Base URL for Adlibris cover image web service.','Free'),
Lines 205-210 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
205
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
204
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
206
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
205
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
207
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
206
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
207
('GuarantorFields', 'streetnumber|address|address2|city|state|zipcode|country|branchcode|phonepro|mobile|email|emailpro|fax', NULL, 'Fields to be transfered from guarantor to guarantee.', 'free'),
208
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
208
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
209
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
209
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
210
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
210
('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 234-241 Patrons: Link Here
234
         - "to access/change superlibrarian privileges."
234
         - "to access/change superlibrarian privileges."
235
         - "<br><strong>NOTE:</strong> A permitted user needs to have the 'permissions' flag (if no superlibrarian)."
235
         - "<br><strong>NOTE:</strong> A permitted user needs to have the 'permissions' flag (if no superlibrarian)."
236
     -
236
     -
237
         - "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:"
237
         - "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:"
238
         - pref: AdditionalGuarantorField
238
         - pref: GuarantorFields
239
           class: multi
239
           class: multi
240
         - (separate columns with |)
240
         - (separate columns with |)
241
241
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt (+2 lines)
Lines 221-226 Link Here
221
                var borrowernumber = $(this).data("borrowernumber");
221
                var borrowernumber = $(this).data("borrowernumber");
222
                var borrower_data = $("#borrower_data"+borrowernumber).val();
222
                var borrower_data = $("#borrower_data"+borrowernumber).val();
223
                var guarantor_attributes = $("#guarantor_attributes").val();
223
                var guarantor_attributes = $("#guarantor_attributes").val();
224
                if ( !guarantor_attributes )
225
                    guarantor_attributes = "{}";
224
                select_user( borrowernumber, JSON.parse(borrower_data), JSON.parse(guarantor_attributes) );
226
                select_user( borrowernumber, JSON.parse(borrower_data), JSON.parse(guarantor_attributes) );
225
            });
227
            });
226
228
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (-5 / +6 lines)
Lines 208-217 function select_user(borrowernumber, borrower, attributes) { Link Here
208
        $('#guarantor_relationships').append( fieldset );
208
        $('#guarantor_relationships').append( fieldset );
209
        fieldset.show();
209
        fieldset.show();
210
210
211
        for (var i = 0; i < parseInt(attributes.length, 10); i++) {
211
        if ( attributes ) {
212
            var attribute = attributes[i];
212
            for (var i = 0; i < parseInt(attributes.length, 10); i++) {
213
            if (borrower[attribute] != null){
213
                var attribute = attributes[i];
214
                document.forms.entryform[attribute].value = borrower[attribute];
214
                if (borrower[attribute] != null){
215
                    document.forms.entryform[attribute].value = borrower[attribute];
216
                }
215
            }
217
            }
216
        }
218
        }
217
    }
219
    }
218
- 

Return to bug 12446