X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=opac%2Fopac-privacy.pl;h=a6f0e6df6d323815b9f28088b843eb54ffdfa2db;hb=a43917e2efd78e57cb33e7edbb4fb48c7740deaf;hp=8796a7a8dd6128ab9d77a3e4dd17a63ccfab1c95;hpb=0a49e3bf92ae3fa4b03067199d1e860f1fe0b274;p=koha.git diff --git a/opac/opac-privacy.pl b/opac/opac-privacy.pl index 8796a7a8dd..a6f0e6df6d 100755 --- a/opac/opac-privacy.pl +++ b/opac/opac-privacy.pl @@ -16,12 +16,11 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; # checkauth, getborrowernumber. use C4::Context; -use C4::Members; use C4::Output; use Koha::Patrons; @@ -50,12 +49,14 @@ my $privacy = $query->param("privacy"); my $privacy_guarantor_checkouts = $query->param("privacy_guarantor_checkouts"); if ( $op eq "update_privacy" ) { - ModMember( - borrowernumber => $borrowernumber, - privacy => $privacy, - privacy_guarantor_checkouts => $privacy_guarantor_checkouts, - ); - $template->param( 'privacy_updated' => 1 ); + my $patron = Koha::Patrons->find( $borrowernumber ); + if ( $patron ) { + $patron->set({ + privacy => $privacy, + privacy_guarantor_checkouts => $privacy_guarantor_checkouts, + })->store; + $template->param( 'privacy_updated' => 1 ); + } } elsif ( $op eq "delete_record" ) {