From 6f5877731347c8ce90c6f4b3d0f475a7bf9d1216 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Tue, 5 Jan 2010 14:10:29 +0000 Subject: [PATCH] Bug 766 Remove scrolling list from serials claims Let templating system do what its designed for pass an array ref with the suppliers --- .../prog/en/modules/serials/claims.tmpl | 7 ++++- serials/claims.pl | 30 ++++++++----------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tmpl index dc482a4c7f..15e059d96d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tmpl @@ -166,7 +166,12 @@
No claims notice defined. Please define one.
- + Phone: Fax: diff --git a/serials/claims.pl b/serials/claims.pl index 6d9f172ac9..d6a7ce70a0 100755 --- a/serials/claims.pl +++ b/serials/claims.pl @@ -18,7 +18,7 @@ my $claimletter = $input->param('claimletter'); my $supplierid = $input->param('supplierid'); my $suppliername = $input->param('suppliername'); my $order = $input->param('order'); -my %supplierlist = GetSuppliersWithLateIssues; +my %supplierlist = GetSuppliersWithLateIssues(); my @select_supplier; # open template first (security & userenv set here) @@ -30,15 +30,19 @@ my ($template, $loggedinuser, $cookie) flagsrequired => {serials => 1}, debug => 1, }); -foreach my $supplierid (sort {$supplierlist{$a} cmp $supplierlist{$b} } keys %supplierlist){ - my ($count, @dummy) = GetLateOrMissingIssues($supplierid,"",$order); - my $counting = $count; - $supplierlist{$supplierid} = $supplierlist{$supplierid}." ($counting)"; - push @select_supplier, $supplierid +my $supplier_loop = []; +foreach my $s_id (sort {$supplierlist{$a} cmp $supplierlist{$b} } keys %supplierlist){ + my ($count) = GetLateOrMissingIssues($supplierid,q{},$order); + push @{$supplier_loop}, { + id => $s_id, + name => $supplierlist{$s_id} . "($count)", + selected => ( $supplierid && $supplierid == $s_id ), + }; } -my $letters = GetLetters("claimissues"); + +my $letters = GetLetters('claimissues'); my @letters; -foreach (keys %$letters){ +foreach (keys %{$letters}){ push @letters ,{code=>$_,name=> $letters->{$_}}; } @@ -48,14 +52,6 @@ if ($supplierid) { ($count2, @missingissues) = GetLateOrMissingIssues($supplierid,$serialid,$order); } -my $CGIsupplier=CGI::scrolling_list( -name => 'supplierid', - -id => 'supplierid', - -values => \@select_supplier, - -default => $supplierid, - -labels => \%supplierlist, - -size => 1, - -multiple => 0 ); - my ($singlesupplier,@supplierinfo); if($supplierid){ (@supplierinfo)=GetBookSeller($supplierid); @@ -81,7 +77,7 @@ if ($op eq "send_alert"){ $template->param('letters'=>\@letters,'letter'=>$letter); $template->param( order =>$order, - CGIsupplier => $CGIsupplier, + supplier_loop => $supplier_loop, phone => $supplierinfo[0]->{phone}, booksellerfax => $supplierinfo[0]->{booksellerfax}, bookselleremail => $supplierinfo[0]->{bookselleremail}, -- 2.39.5