X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=serials%2Fserials-recieve.pl;h=89e86be05222d4c77965ecead8af264edee1b731;hb=99b84d69b693e8b016a18289010e36cf4639f46d;hp=830c56a9752dbba3b2da874882f64e1affc721a2;hpb=100e6a9808ead4ee8d951da59ead1550e75bb4c3;p=koha.git diff --git a/serials/serials-recieve.pl b/serials/serials-recieve.pl index 830c56a975..89e86be052 100755 --- a/serials/serials-recieve.pl +++ b/serials/serials-recieve.pl @@ -17,7 +17,6 @@ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA -# $Id$ =head1 NAME @@ -66,8 +65,9 @@ op can be : use strict; use CGI; use C4::Auth; -use C4::Date; +use C4::Dates qw/format_date format_date_in_iso/; use C4::Biblio; +use C4::Items; use C4::Koha; use C4::Output; use C4::Context; @@ -196,8 +196,8 @@ my $sth= C4::Serials::GetSubscriptionHistoryFromSubscriptionId(); $sth->execute($subscriptionid); my $solhistory = $sth->fetchrow_hashref; -my $subs = &GetSubscription($subscriptionid); -my ($totalissues,@serialslist) = GetSerials($subscriptionid); +$subs = &GetSubscription($subscriptionid); +($totalissues,@serialslist) = GetSerials($subscriptionid); if (C4::Context->preference("serialsadditems")){ my $fwk=GetFrameworkCode($subscription->{biblionumber}); @@ -217,13 +217,13 @@ if (C4::Context->preference("serialsadditems")){ } my $itemstatushash = GetItemStatus($fwk); my @itemstatusloop; - my $itemstatusloopcount=0; + my $itemstatusloopcount=0; foreach my $thisitemstatus (keys %$itemstatushash) { my %row =(itemval => $thisitemstatus, itemlib => $itemstatushash->{$thisitemstatus}, ); # warn "".$row{'itemval'}.", ". $row{"itemlib"}; - $itemstatusloopcount++; + $itemstatusloopcount++; push @itemstatusloop, \%row; } my $itemlocationhash = GetItemLocation($fwk); @@ -235,29 +235,26 @@ if (C4::Context->preference("serialsadditems")){ push @itemlocationloop, \%row; } - my $choice = 0; - if($itemstatusloopcount == 1){ $choice = 1;} - foreach my $data (@serialslist){ - if (scalar(@itemstatusloop)){$data->{"itemstatusloop"}=\@itemstatusloop;} - else { $data->{"itemstatusloop"}=[];} - if (scalar(@itemlocationloop)){$data->{"itemlocationloop"}=\@itemlocationloop;} - else {$data->{"itemlocationloop"}=[];} - $data->{"branchloop"}=\@branchloop ; - } + my $choice = ($itemstatusloopcount == 1) ? 1 : 0; + foreach my $data (@serialslist){ + $data->{"itemstatusloop"} = (scalar(@itemstatusloop )) ? \@itemstatusloop : []; + $data->{"itemlocationloop"} = (scalar(@itemlocationloop)) ? \@itemlocationloop : []; + $data->{"branchloop"} = \@branchloop ; + } # warn "Choice: $choice"; $template->param(choice => $choice); $template->param(serialadditems =>C4::Context->preference("serialsadditems"), branchloop => \@branchloop, ) ; - $template->param(itemstatus=>1,itemstatusloop=>\@itemstatusloop) if (scalar(@itemstatusloop)); - $template->param(itemlocation=>1,itemlocationloop=>\@itemlocationloop) if (scalar(@itemlocationloop)); -}else{ + $template->param( itemstatus=>1, itemstatusloop=>\@itemstatusloop ) if (scalar(@itemstatusloop )); + $template->param(itemlocation=>1,itemlocationloop=>\@itemlocationloop) if (scalar(@itemlocationloop)); +} else { $template->param(branchloop=>[],itemstatusloop=>[],itemlocationloop=>[]) ; } -my $sth= C4::Serials::GetSubscriptionHistoryFromSubscriptionId(); +$sth= C4::Serials::GetSubscriptionHistoryFromSubscriptionId(); $sth->execute($subscriptionid); -my $solhistory = $sth->fetchrow_hashref; +$solhistory = $sth->fetchrow_hashref; $template->param( user => $auser, @@ -275,9 +272,6 @@ $template->param( biblionumber => $subs->{biblionumber}, hassubscriptionexpired =>$hassubscriptionexpired, abouttoexpire =>$abouttoexpire, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), routing => $routing, missingseq => $manualissue, frommissing => $manualstatus,