# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
-# $Id$
=head1 NAME
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::Interface::CGI::Output;
use C4::Context;
use C4::Serials;
use C4::Branch; # GetBranches
$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=MARCfind_frameworkcode($subscription->{biblionumber});
+ my $fwk=GetFrameworkCode($subscription->{biblionumber});
my $branches = GetBranches;
my @branchloop;
}
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);
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,
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,