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 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');
(-)a/installer/data/mysql/atomicupdate/bug_12949-add_syspref_to_control_removal_of_guarantor_information_upon_update_to_adult.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('RemoveGuarantorDataFromGuaranteeWhenUpdatedToAdult', 0, NULL, 'If enabled when a guarantee is updated to an Adult patron category all guarantor information will be removed from guarantee 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
('RemoveGuarantorDataFromGuaranteeWhenUpdatedToAdult', 0, NULL, 'If Enabled when a guarantee is updated to an Adult patron category all guarantor information will be removed from guarantee 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 (-2 / +2 lines)
Lines 228-238 Patrons: Link Here
228
         - "to access/change superlibrarian privileges."
228
         - "to access/change superlibrarian privileges."
229
         - "<br><strong>NOTE:</strong> A permitted user needs to have the 'permissions' flag (if no superlibrarian)."
229
         - "<br><strong>NOTE:</strong> A permitted user needs to have the 'permissions' flag (if no superlibrarian)."
230
     -
230
     -
231
         - pref: GuarantorsMustBeLinkedToPatronAccount
231
         - pref: RemoveGuarantorDataFromGuaranteeWhenUpdatedToAdult
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
         - when a guarantee is updated to an Adult patron category all guarantor information will be removed from guarantee account
236
236
237
    Privacy:
237
    Privacy:
238
     -
238
     -
(-)a/members/memberentry.pl (+12 lines)
Lines 527-532 if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ Link Here
527
        $newdata{debarredcomment} = $newdata{debarred_comment};
527
        $newdata{debarredcomment} = $newdata{debarred_comment};
528
        delete $newdata{debarred_comment};
528
        delete $newdata{debarred_comment};
529
        delete $newdata{password2};
529
        delete $newdata{password2};
530
531
        #If changing to a patron category whose category type is not child then remove guarantor id
532
        my $borrowercategory = Koha::Patron::Categories->find($newdata{categorycode});
533
        if (( $borrowercategory->category_type ne 'C' ) && ( $borrowercategory->category_type ne 'P' )) {
534
            $newdata{guarantorid} = '';
535
            if (C4::Context->preference('RemoveGuarantorDataFromGuaranteeWhenUpdatedToAdult')) {
536
                $newdata{contactname} = '';
537
                $newdata{contactfirstname} = '';
538
                $newdata{relationship} = '';
539
            }
540
        }
541
530
        $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
531
                                                                # updating any columns in the borrowers table,
543
                                                                # updating any columns in the borrowers table,
532
                                                                # which can happen if we're only editing the
544
                                                                # which can happen if we're only editing the
(-)a/members/moremember.pl (-1 / +1 lines)
Lines 103-109 if ( my $guarantor = $patron->guarantor ) { Link Here
103
    $template->param( guarantor => $guarantor );
103
    $template->param( guarantor => $guarantor );
104
    push @relatives, $guarantor->borrowernumber;
104
    push @relatives, $guarantor->borrowernumber;
105
    push @relatives, $_->borrowernumber for $patron->siblings;
105
    push @relatives, $_->borrowernumber for $patron->siblings;
106
} elsif (( !C4::Context->preference('GuarantorsMustBeLinkedToPatronAccount')) && ( $patron->contactname || $patron->contactfirstname )) {
106
} elsif (( !C4::Context->preference('RemoveGuarantorDataFromGuaranteeWhenUpdatedToAdult')) && ( $patron->contactname || $patron->contactfirstname )) {
107
    $template->param(
107
    $template->param(
108
        guarantor => {
108
        guarantor => {
109
            firstname => $patron->contactfirstname,
109
            firstname => $patron->contactfirstname,
(-)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('RemoveGuarantorDataFromGuaranteeWhenUpdatedToAdult')) {
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