X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=boraccount.pl;h=b30ef5df2b4e30c8e7b27866d7d5f032c49b5880;hb=e49f99e9dbb377b2719f6c28f07ad63c9bfc81df;hp=e1ec28e8c6105eb0a0b8aaaa5bd7b31ea5128542;hpb=7197a3735b36b22261776f93f3aa2407dcf55ba6;p=koha.git diff --git a/boraccount.pl b/boraccount.pl index e1ec28e8c6..b30ef5df2b 100755 --- a/boraccount.pl +++ b/boraccount.pl @@ -24,7 +24,9 @@ # Suite 330, Boston, MA 02111-1307 USA use strict; +use C4::Auth; use C4::Output; +use C4::Interface::CGI::Output; use CGI; use C4::Search; use HTML::Template; @@ -32,8 +34,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 @@ -62,12 +72,11 @@ for (my $i=0;$i<$numaccts;$i++){ push(@accountrows, \%row); } -$template->param( startmenumember => startmenu('member'), - endmenumember => endmenu('member'), +$template->param( firstname => $data->{'firstname'}, surname => $data->{'surname'}, bornum => $bornum, total => $total, accounts => \@accountrows ); -print "Content-Type: text/html\n\n", $template->output; +output_html_with_http_headers $input, $cookie, $template->output;