[Koha-cvs] koha/bull statecollection.pl [rel_2_2]
Henri-Damien LAURENT
laurenthdl at alinto.com
Tue Feb 7 17:21:32 CET 2006
CVSROOT: /cvsroot/koha
Module name: koha
Branch: rel_2_2
Changes by: Henri-Damien LAURENT <hdl at savannah.gnu.org> 06/02/07 16:21:32
Modified files:
bull : statecollection.pl
Log message:
Bug Fixing empty loops would provide ppl with a bug. Fixing it
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/bull/statecollection.pl.diff?only_with_tag=rel_2_2&tr1=1.3.2.11&tr2=1.3.2.12&r1=text&r2=text
Patches:
Index: koha/bull/statecollection.pl
diff -u koha/bull/statecollection.pl:1.3.2.11 koha/bull/statecollection.pl:1.3.2.12
--- koha/bull/statecollection.pl:1.3.2.11 Tue Feb 7 15:33:35 2006
+++ koha/bull/statecollection.pl Tue Feb 7 16:21:32 2006
@@ -116,21 +116,29 @@
);
push @itemlocationloop, \%row;
}
-
-foreach my $data (@serialslist){
- $data->{"itemstatusloop"}=\@itemstatusloop if ((C4::Context->preference("serialsadditems")) && scalar(@itemstatusloop));
- $data->{"itemlocationloop"}=\@itemlocationloop if ((C4::Context->preference("serialsadditems")) && scalar(@itemlocationloop));
- $data->{"branchloop"}=\@branchloop;
- }
+
+if (C4::Context->preference("serialsadditems")){
+ foreach my $data (@serialslist){
+ $data->{"itemstatusloop"}=\@itemstatusloop if (scalar(@itemstatusloop));
+ $data->{"itemlocationloop"}=\@itemlocationloop if (scalar(@itemlocationloop));
+ $data->{"branchloop"}=\@branchloop ;
+ }
+}
+
my $sth=$dbh->prepare("select * from subscriptionhistory where subscriptionid = ?");
$sth->execute($subscriptionid);
my $solhistory = $sth->fetchrow_hashref;
-$template->param(serialadditems =>C4::Context->preference("serialsadditems"),
+if (C4::Context->preference("serialsadditems")){
+ $template->param(serialadditems =>C4::Context->preference("serialsadditems"),
branchloop => \@branchloop,
- ) if (C4::Context->preference("serialsadditems"));
-$template->param(itemstatus=>1,itemstatusloop=>\@itemstatusloop) if ((C4::Context->preference("serialsadditems")) && scalar(@itemstatusloop));
-$template->param(itemlocation=>1,itemlocationloop=>\@itemlocationloop) if ((C4::Context->preference("serialsadditems")) && scalar(@itemlocationloop));
+ ) ;
+ $template->param(itemstatus=>1,itemstatusloop=>\@itemstatusloop) if (scalar(@itemstatusloop));
+ $template->param(itemlocation=>1,itemlocationloop=>\@itemlocationloop) if (scalar(@itemlocationloop));
+}else{
+ $template->param(branchloop=>[],itemstatusloop=>[],itemlocationloop=>[]) ;
+}
+
$template->param(
serialslist => \@serialslist,
biblionumber => $subscription->{biblionumber},
More information about the Koha-cvs
mailing list