X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-messaging.pl;h=8ccc5006a326beeef5e9c8d7e0fa904a503f3027;hb=010a32d95f871853f5c597b2670f3de4c62cfa51;hp=b0c1cdedd221a9d83fb6f5c0299af7abdd4e83b5;hpb=e20270fec4f6d34f01050bea4c5765d5b3c4ed33;p=koha-ffzg.git diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl index b0c1cdedd2..8ccc5006a3 100755 --- a/opac/opac-messaging.pl +++ b/opac/opac-messaging.pl @@ -4,18 +4,18 @@ # # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . use strict; use warnings; @@ -27,7 +27,6 @@ use C4::Context; use C4::Koha; use C4::Circulation; use C4::Output; -use C4::Dates qw/format_date/; use C4::Members; use C4::Members::Messaging; use C4::Branch; @@ -41,21 +40,19 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( query => $query, type => 'opac', authnotrequired => 0, - flagsrequired => { borrow => 1 }, debug => 1, } ); -my $borrower = GetMemberDetails( $borrowernumber ); +my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber ); my $messaging_options = C4::Members::Messaging::GetMessagingOptions(); if ( defined $query->param('modify') && $query->param('modify') eq 'yes' ) { - - # If they've modified the SMS number, record it. - if ( ( defined $query->param('SMSnumber') ) && ( $query->param('SMSnumber') ne $borrower->{'mobile'} ) ) { + my $sms = $query->param('SMSnumber'); + if ( defined $sms && ( $borrower->{'smsalertnumber'} // '' ) ne $sms ) { ModMember( borrowernumber => $borrowernumber, - smsalertnumber => $query->param('SMSnumber') ); - $borrower = GetMemberDetails( $borrowernumber ); + smsalertnumber => $sms ); + $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber ); } C4::Form::MessagingPreferences::handle_form_action($query, { borrowernumber => $borrowernumber }, $template); @@ -63,11 +60,10 @@ if ( defined $query->param('modify') && $query->param('modify') eq 'yes' ) { C4::Form::MessagingPreferences::set_form_values({ borrowernumber => $borrower->{'borrowernumber'} }, $template); -# warn( Data::Dumper->Dump( [ $messaging_options ], [ 'messaging_options' ] ) ); -$template->param( BORROWER_INFO => [ $borrower ], +$template->param( BORROWER_INFO => $borrower, messagingview => 1, - SMSnumber => defined $borrower->{'smsalertnumber'} ? $borrower->{'smsalertnumber'} : $borrower->{'mobile'}, + SMSnumber => $borrower->{'smsalertnumber'}, SMSSendDriver => C4::Context->preference("SMSSendDriver"), TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification") ); -output_html_with_http_headers $query, $cookie, $template->output; +output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };