From 6c50c3c83837792f7a06936249bc9be6c08bfb59 Mon Sep 17 00:00:00 2001 From: hdl Date: Wed, 13 Nov 2002 17:52:59 +0000 Subject: [PATCH] Bookcount Templating First template and commit --- bookcount.pl | 64 ++++++++++++++++------------------------------------ 1 file changed, 20 insertions(+), 44 deletions(-) diff --git a/bookcount.pl b/bookcount.pl index cc563a0885..74fd1ad493 100755 --- a/bookcount.pl +++ b/bookcount.pl @@ -29,6 +29,7 @@ use C4::Context; use C4::Search; use C4::Circulation::Circ2; use C4::Output; +use HTML::Template; # get all the data .... my %env; @@ -59,56 +60,31 @@ if (not $lastmove) { $count = issuessince($itm ,$lastdate); } - # make the page ... -print $input->header; - - -print startpage; -print startmenu('report'); -print center; - -print <<"EOF"; -
-$data->{'title'} ($data->{'author'})

-

- - - - - - - -
- BARCODE $idata->{'barcode'}
- -Home Branch: $homebranch
-Current Branch: $holdingbranch
-Date arrived at current branch: $lastdate
-Number of issues since since the above date : $count
- - - -EOF +my $template = gettemplate("bookcount.tmpl"); + +my @branchloop; foreach my $branchcode (keys %$branches) { - my $issues = issuesat($itm, $branchcode); + my %linebranch; + $linebranch{issues} = issuesat($itm, $branchcode); my $date = lastseenat($itm, $branchcode); - my $seen = slashdate($date); - print << "EOF"; - - -EOF + $linebranch{seen} = slashdate($date); + $linebranch{branchname}=$branches->{$branchcode}->{'branchname'}; + push(@branchloop,\%linebranch); } -print <<"EOF"; -
Branch No. of Issues Last seen at branch
$branches->{$branchcode}->{'branchname'} $issues $seen
-
-EOF - - -print endmenu('report'); -print endpage; +$template->param( bib => $bib, + title => $data->{'title'}, + author => $data->{'author'}, + barcode => $idata->{'barcode'}, + homebranch =>$homebranch, + holdingbranch => $holdingbranch, + lastdate => $lastdate, + count => $count, + branchloop => \@branchloop); + +print "Content-Type: text/html\n\n", $template->output; ############################################## # This stuff should probably go into C4::Search -- 2.39.5