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 73-78 Patrons: Link Here
73
         - track last patron activity.
73
         - track last patron activity.
74
         - Every time a patron will connect, the borrowers.lastseen will be updated with the current time.
74
         - Every time a patron will connect, the borrowers.lastseen will be updated with the current time.
75
     -
75
     -
76
         - pref: AutoApprovePatronProfileSettings
77
           choices:
78
               yes: Enable
79
               no: Disable
80
         - "Automatically approve Patron profile changes."
81
     -
76
         - pref: ProtectSuperlibrarianPrivileges
82
         - pref: ProtectSuperlibrarianPrivileges
77
           choices:
83
           choices:
78
               yes: Allow only superlibrarians
84
               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