Bug 12478 - more authority searching
[srvgit] / opac / opac-account.pl
index c3cb9b4..7512f2e 100755 (executable)
@@ -5,24 +5,23 @@
 #
 # 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 <http://www.gnu.org/licenses>.
 
 
 use strict;
-use CGI;
+use CGI qw ( -utf8 );
 use C4::Members;
-use C4::Circulation;
 use C4::Auth;
 use C4::Output;
 use warnings;
@@ -30,21 +29,16 @@ use warnings;
 my $query = new CGI;
 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
     {
-        template_name   => "opac-account.tmpl",
+        template_name   => "opac-account.tt",
         query           => $query,
         type            => "opac",
         authnotrequired => 0,
-        flagsrequired   => { borrow => 1 },
         debug           => 1,
     }
 );
 
-# get borrower information ....
-my $borr = GetMemberDetails( $borrowernumber );
-my @bordat;
-$bordat[0] = $borr;
-
-$template->param( BORROWER_INFO => \@bordat );
+my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber );
+$template->param( BORROWER_INFO => $borrower );
 
 #get account details
 my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
@@ -69,11 +63,14 @@ foreach my $row (@$accts) {
     $num++;
 }
 
-$template->param (
+$template->param(
     ACCOUNT_LINES => $accts,
-    total => sprintf( "%.2f", $total ),
-       accountview => 1
+    total         => sprintf( "%.2f", $total ),
+    accountview   => 1,
+    message       => $query->param('message') || q{},
+    message_value => $query->param('message_value') || q{},
+    payment       => $query->param('payment') || q{},
+    payment_error => $query->param('payment-error') || q{},
 );
 
-output_html_with_http_headers $query, $cookie, $template->output;
-
+output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };