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 74-79 Patrons: Link Here
74
         - track last patron activity.
74
         - track last patron activity.
75
         - Every time a patron will connect, the borrowers.lastseen will be updated with the current time.
75
         - Every time a patron will connect, the borrowers.lastseen will be updated with the current time.
76
     -
76
     -
77
         - pref: AutoApprovePatronProfileSettings
78
           choices:
79
               yes: Enable
80
               no: Disable
81
         - "Automatically approve Patron profile changes."
82
     -
77
         - pref: ProtectSuperlibrarianPrivileges
83
         - pref: ProtectSuperlibrarianPrivileges
78
           choices:
84
           choices:
79
               yes: Allow only superlibrarians
85
               yes: Allow only superlibrarians
(-)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::Form::MessagingPreferences;
30
use C4::Form::MessagingPreferences;
30
use Koha::AuthUtils;
31
use Koha::AuthUtils;
Lines 299-304 elsif ( $action eq 'update' ) { Link Here
299
            Koha::Patron::Modifications->search({ borrowernumber => $borrowernumber })->delete;
300
            Koha::Patron::Modifications->search({ borrowernumber => $borrowernumber })->delete;
300
301
301
            my $m = Koha::Patron::Modification->new( \%borrower_changes )->store();
302
            my $m = Koha::Patron::Modification->new( \%borrower_changes )->store();
303
            #Automatically approve patron profile changes if set in syspref
304
305
            if (C4::Context->preference('AutoApprovePatronProfileSettings')) {
306
                # Need to get the object from database, otherwise it is not complete enough to allow deletion
307
                # when approval has been performed.
308
                my $tmp_m = Koha::Patron::Modifications->find({borrowernumber => $borrowernumber});
309
                $tmp_m->approve() if $tmp_m;
310
            }
302
311
303
            my $patron = Koha::Patrons->find( $borrowernumber );
312
            my $patron = Koha::Patrons->find( $borrowernumber );
304
            $template->param( borrower => $patron->unblessed );
313
            $template->param( borrower => $patron->unblessed );
305
- 

Return to bug 20057