X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=boraccount.pl;h=a7ab5146aa6149caea7e2e97672075fd73994c44;hb=ae8ed590331a151a657e3edebe6de17ad2e92bd2;hp=704f41200a087675896fb6c1f175dc83088ddd19;hpb=0f24c709006dd90652d3ccf26303b3a9ff355fcf;p=koha_gimpoz diff --git a/boraccount.pl b/boraccount.pl index 704f41200a..a7ab5146aa 100755 --- a/boraccount.pl +++ b/boraccount.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# $Id$ + #writen 11/1/2000 by chris@katipo.oc.nz #script to display borrowers account details @@ -22,6 +24,7 @@ # Suite 330, Boston, MA 02111-1307 USA use strict; +use C4::Auth; use C4::Output; use CGI; use C4::Search; @@ -30,8 +33,16 @@ use HTML::Template; my $input=new CGI; my $theme = $input->param('theme'); # only used if allowthemeoverride is set -my %tmpldata = pathtotemplate ( template => 'boraccount.tmpl', theme => $theme ); -my $template = HTML::Template->new(filename => $tmpldata{'path'}, die_on_bad_params => 0); +#my %tmpldata = pathtotemplate ( template => 'boraccount.tmpl', theme => $theme ); +#my $template = HTML::Template->new(filename => $tmpldata{'path'}, die_on_bad_params => 0); +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "boraccount.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {borrowers => 1}, + debug => 1, + }); my $bornum=$input->param('bornum'); #get borrower details @@ -39,8 +50,8 @@ my $data=borrdata('',$bornum); #get account details my %bor; -$bor{'borrowernumber'}=$bornum; -my ($numaccts,$accts,$total)=getboracctrecord('',\%bor); +$bor{'borrowernumber'}=$bornum; +my ($numaccts,$accts,$total)=getboracctrecord('',\%bor); my @accountrows; # this is for the tmpl-loop @@ -60,12 +71,12 @@ for (my $i=0;$i<$numaccts;$i++){ push(@accountrows, \%row); } -$template->param( startmenumember => startmenu('member'), - endmenumember => endmenu('member'), +$template->param( startmenumember => join('', startmenu('member')), + endmenumember => join('', endmenu('member')), firstname => $data->{'firstname'}, surname => $data->{'surname'}, bornum => $bornum, total => $total, - accounts => \@accountrows ); + accounts => \@accountrows ); -print "Content-Type: text/html\n\n", $template->output; \ No newline at end of file +print $input->header(-cookie => $cookie),$template->output;