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

(-)a/installer/data/mysql/atomicupdate/bug_12949-add_syspref_to_control_display_of_unlinked_guarantor.sql (-1 / +1 lines)
Line 1 Link Here
1
INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('GuarantorsMustBeLinkedToPatronAccount', 1, NULL, 'When adding a guarantor to a borrower Koha will enforce that the guarantor must be linked to a patron account', 'YesNo');
1
INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('GuarantorsMustBeLinkedToPatronAccount', 0, NULL, 'If enabled when adding a guarantor to a borrower Koha will enforce that the guarantor must be linked to a patron account', 'YesNo');
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 199-205 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
199
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
199
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
200
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
200
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
201
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
201
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
202
('GuarantorsMustBeLinkedToPatronAccount', 1, NULL, 'When adding a guarantor to a borrower Koha will enforce that the guarantor must be linked to a patron account', 'YesNo'),
202
('GuarantorsMustBeLinkedToPatronAccount', 0, NULL, 'If enabled when adding a guarantor to a borrower Koha will enforce that the guarantor must be linked to a patron account', 'YesNo'),
203
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
203
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
204
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
204
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
205
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
205
('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 (-1 / +1 lines)
Lines 232-238 Patrons: Link Here
232
           choices:
232
           choices:
233
               yes: 'Enable'
233
               yes: 'Enable'
234
               no: 'Disable'
234
               no: 'Disable'
235
         - When adding a guarantor to a borrower Koha will enforce that the guarantor must be linked to a patron account
235
         - If enabled when adding a guarantor to a borrower Koha will enforce that the guarantor must be linked to a patron account
236
236
237
    Privacy:
237
    Privacy:
238
     -
238
     -
(-)a/members/memberentry.pl (+5 lines)
Lines 532-537 if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ Link Here
532
        my $borrowercategory = Koha::Patron::Categories->find($newdata{categorycode});
532
        my $borrowercategory = Koha::Patron::Categories->find($newdata{categorycode});
533
        if (( $borrowercategory->category_type ne 'C' ) && ( $borrowercategory->category_type ne 'P' )) {
533
        if (( $borrowercategory->category_type ne 'C' ) && ( $borrowercategory->category_type ne 'P' )) {
534
            $newdata{guarantorid} = '';
534
            $newdata{guarantorid} = '';
535
            if (C4::Context->preference('GuarantorsMustBeLinkedToPatronAccount')) {
536
                $newdata{contactname} = '';
537
                $newdata{contactfirstname} = '';
538
                $newdata{relationship} = '';
539
            }
535
        }
540
        }
536
541
537
        $patron->set(\%newdata)->store if scalar(keys %newdata) > 1; # bug 4508 - avoid crash if we're not
542
        $patron->set(\%newdata)->store if scalar(keys %newdata) > 1; # bug 4508 - avoid crash if we're not
(-)a/members/update-child.pl (-1 / +6 lines)
Lines 85-90 elsif ( $op eq 'update' ) { Link Here
85
    die "You are doing something wrong updating this child" unless $adult_category;
85
    die "You are doing something wrong updating this child" unless $adult_category;
86
86
87
    $patron->guarantorid(undef);
87
    $patron->guarantorid(undef);
88
    if (C4::Context->preference('GuarantorsMustBeLinkedToPatronAccount')) {
89
        $patron->contactname(undef);
90
        $patron->contactfirstname(undef);
91
        $patron->relationship(undef);
92
    }
93
88
    $patron->categorycode($adult_category->categorycode);
94
    $patron->categorycode($adult_category->categorycode);
89
    $patron->store;
95
    $patron->store;
90
96
91
- 

Return to bug 12949