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

(-)a/installer/data/mysql/atomicupdate/AutoApprovePatronProfileSettings.sql (+2 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type`) VALUES
2
('AutoApprovePatronProfileSettings', '0', '', 'Automatically approve Patron profile changes.', 'YesNo');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+6 lines)
Lines 200-205 Patrons: Link Here
200
               no: "Don't"
200
               no: "Don't"
201
         - track last patron activity.
201
         - track last patron activity.
202
         - Everytime a patron will connect, the borrowers.lastseen will be updated with the current time.
202
         - Everytime a patron will connect, the borrowers.lastseen will be updated with the current time.
203
     -
204
         - pref: AutoApprovePatronProfileSettings
205
           choices:
206
               yes: Enable
207
               no: Disable
208
         - "Automatically approve Patron profile changes."
203
    "Norwegian patron database":
209
    "Norwegian patron database":
204
     -
210
     -
205
         - pref: NorwegianPatronDBEnable
211
         - pref: NorwegianPatronDBEnable
(-)a/opac/opac-memberentry.pl (-1 / +9 lines)
Lines 25-30 use String::Random qw( random_string ); Link Here
25
25
26
use C4::Auth;
26
use C4::Auth;
27
use C4::Output;
27
use C4::Output;
28
use C4::Context;
28
use C4::Members;
29
use C4::Members;
29
use C4::Members::Attributes qw( GetBorrowerAttributes );
30
use C4::Members::Attributes qw( GetBorrowerAttributes );
30
use C4::Form::MessagingPreferences;
31
use C4::Form::MessagingPreferences;
Lines 281-286 elsif ( $action eq 'update' ) { Link Here
281
            }
282
            }
282
283
283
            my $m = Koha::Patron::Modification->new( \%borrower_changes )->store();
284
            my $m = Koha::Patron::Modification->new( \%borrower_changes )->store();
285
            #Automatically approve patron profile changes if set in syspref
286
287
            if (C4::Context->preference('AutoApprovePatronProfileSettings')) {
288
                # Need to get the object from database, otherwise it is not complete enough to allow deletion
289
                # when approval has been performed.
290
                my $tmp_m = Koha::Patron::Modifications->find({borrowernumber => $borrowernumber});
291
                $tmp_m->approve() if $tmp_m;
292
            }
284
293
285
            my $patron = Koha::Patrons->find( $borrowernumber );
294
            my $patron = Koha::Patrons->find( $borrowernumber );
286
            $template->param( borrower => $patron->unblessed );
295
            $template->param( borrower => $patron->unblessed );
287
- 

Return to bug 20057