Bugzilla – Attachment 105303 Details for
Bug 20057
Auto-approve option for borrower modifications
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20057: System preference for auto approval of patron profile changes
Bug-20057-System-preference-for-auto-approval-of-p.patch (text/plain), 3.77 KB, created by
Katrin Fischer
on 2020-05-23 14:49:46 UTC
(
hide
)
Description:
Bug 20057: System preference for auto approval of patron profile changes
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-05-23 14:49:46 UTC
Size:
3.77 KB
patch
obsolete
>From eaaa46ba097cf483c2b7ea1f22c4497dd5415a6e Mon Sep 17 00:00:00 2001 >From: David Gustafsson <glasklas@gmail.com> >Date: Tue, 19 May 2020 12:44:31 +0200 >Subject: [PATCH] Bug 20057: System preference for auto approval of patron > profile changes > >Testplan for this patch: > >1. Apply patch. >2. Make sure syspref "AutoApprovePatronProfileSettings" is set to "Disable". >3. Edit patron personal details via opac interface. >4. Expect modifications to require manual approval by staff via link on main page. >5. Set syspref "AutoApprovePatronProfileSettings" to "Enable". >6. Edit patron personal details via OPAC interface again. >7. Expect modifications to have been approved automatically. > >Signed-off-by: Liz Rea <liz@catalyst.net.nz> >This works, we may want some different text for this situation in the OPAC, it still says the librarian has to approve the change. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../data/mysql/atomicupdate/AutoApprovePatronProfileSettings.sql | 2 ++ > .../intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref | 6 ++++++ > opac/opac-memberentry.pl | 9 +++++++++ > 3 files changed, 17 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/AutoApprovePatronProfileSettings.sql > >diff --git a/installer/data/mysql/atomicupdate/AutoApprovePatronProfileSettings.sql b/installer/data/mysql/atomicupdate/AutoApprovePatronProfileSettings.sql >new file mode 100644 >index 0000000000..55f54def46 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/AutoApprovePatronProfileSettings.sql >@@ -0,0 +1,2 @@ >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type`) VALUES >+('AutoApprovePatronProfileSettings', '0', '', 'Automatically approve Patron profile changes.', 'YesNo'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 991de6668a..143433f523 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -73,6 +73,12 @@ Patrons: > - track last patron activity. > - Every time a patron will connect, the borrowers.lastseen will be updated with the current time. > - >+ - pref: AutoApprovePatronProfileSettings >+ choices: >+ yes: Enable >+ no: Disable >+ - "Automatically approve Patron profile changes." >+ - > - pref: ProtectSuperlibrarianPrivileges > choices: > yes: Allow only superlibrarians >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index faf32e8285..e7cd4ccec0 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -25,6 +25,7 @@ use String::Random qw( random_string ); > > use C4::Auth; > use C4::Output; >+use C4::Context; > use C4::Members; > use C4::Form::MessagingPreferences; > use Koha::AuthUtils; >@@ -299,6 +300,14 @@ elsif ( $action eq 'update' ) { > Koha::Patron::Modifications->search({ borrowernumber => $borrowernumber })->delete; > > my $m = Koha::Patron::Modification->new( \%borrower_changes )->store(); >+ #Automatically approve patron profile changes if set in syspref >+ >+ if (C4::Context->preference('AutoApprovePatronProfileSettings')) { >+ # Need to get the object from database, otherwise it is not complete enough to allow deletion >+ # when approval has been performed. >+ my $tmp_m = Koha::Patron::Modifications->find({borrowernumber => $borrowernumber}); >+ $tmp_m->approve() if $tmp_m; >+ } > > my $patron = Koha::Patrons->find( $borrowernumber ); > $template->param( borrower => $patron->unblessed ); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20057
:
70790
|
70925
|
70926
|
70927
|
105075
|
105076
|
105142
|
105303
|
105304
|
105305
|
109288
|
109289
|
109290