From 86a9c7fb9f9d0d931d2cd47401f03cd889fcdfb8 Mon Sep 17 00:00:00 2001 From: tipaul Date: Wed, 18 Jan 2006 14:52:07 +0000 Subject: [PATCH] bugfixes xhtml & prog templates --- acqui/lateorders.pl | 24 +++++++++--------------- acqui/newbiblio.pl | 28 +++++++++++----------------- acqui/supplier.pl | 4 ++-- 3 files changed, 22 insertions(+), 34 deletions(-) diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl index 18af7afef0..86bd232542 100755 --- a/acqui/lateorders.pl +++ b/acqui/lateorders.pl @@ -4,6 +4,7 @@ use strict; use CGI; use C4::Acquisition; use C4::Auth; +use C4::Koha; use C4::Output; use C4::Interface::CGI::Output; use C4::Context; @@ -43,21 +44,14 @@ my $CGIsupplier=CGI::scrolling_list( -name => 'supplierid', $template->param(Supplier=>$supplierlist{$supplierid}) if ($supplierid); -my @select_branches; -my %select_branches; -push @select_branches,""; -$select_branches{""}=""; -my ($count, @branches) = branches(); -#branches is IndependantBranches aware -foreach my $branch (@branches){ - push @select_branches, $branch->{branchcode}; - $select_branches{$branch->{branchcode}}=$branch->{branchname}; +my $branches = getbranches; +my @branchloop; +foreach my $thisbranch (sort keys %$branches) { + my %row =(value => $thisbranch, + branchname => $branches->{$thisbranch}->{'branchname'}, + ); + push @branchloop, \%row; } -my $CGIbranch=CGI::scrolling_list( -name => 'branch', - -values => \@select_branches, - -labels => \%select_branches, - -size => 1, - -multiple => 0 ); my ($count, @lateorders) = getlateorders($delay,$supplierid,$branch); my $total; @@ -66,7 +60,7 @@ foreach my $lateorder (@lateorders){ } $template->param(delay=>$delay) if ($delay); $template->param( - CGIbranch => $CGIbranch, + branchloop => \@branchloop, CGIsupplier => $CGIsupplier, lateorders => \@lateorders, total=>$total, diff --git a/acqui/newbiblio.pl b/acqui/newbiblio.pl index 021484160b..2b19a838a3 100755 --- a/acqui/newbiblio.pl +++ b/acqui/newbiblio.pl @@ -29,9 +29,11 @@ use C4::Database; use C4::Auth; use C4::Acquisition; use C4::Suggestions; +use C4::Biblio; use C4::Search; use C4::Output; use C4::Input; +use C4::Koha; use C4::Interface::CGI::Output; use HTML::Template; @@ -111,29 +113,22 @@ my $CGIitemtype=CGI::scrolling_list( -name => 'format', $sth->finish; # build branches list -my @branches; -my @select_branch; -my %select_branches; -my ($count2,@branches)=branches(); -for (my $i=0;$i<$count2;$i++){ - if ((!C4::Context->preference('IndependantBranches'))||(C4::Context->preference('IndependantBranches') && (C4::Context->userenv->{flags} ==1)) - ||((C4::Context->preference('IndependantBranches') && (C4::Context->userenv->{flags} !=1) && (C4::Context->userenv->{branch} eq $branches[$i]->{'branchcode'})))){ - push @select_branch, $branches[$i]->{'branchcode'};# - $select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'}; - } +my $branches = getbranches; +my @branchloop; +foreach my $thisbranch (sort keys %$branches) { + my %row =(value => $thisbranch, + branchname => $branches->{$thisbranch}->{'branchname'}, + ); + push @branchloop, \%row; } -my $CGIbranch=CGI::scrolling_list( -name => 'branch', - -values => \@select_branch, - -default => $data->{'branchcode'}, - -labels => \%select_branches, - -size => 1, - -multiple => 0 ); +$template->param(branchloop =>\@branchloop); # build bookfund list my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?"); $sthtemp->execute($loggedinuser); my ($flags, $homebranch)=$sthtemp->fetchrow; +my $count2; my @bookfund; my @select_bookfund; my %select_bookfunds; @@ -199,7 +194,6 @@ $template->param( existing => $biblio, author => $data->{'author'}, copyrightdate => $data->{'copyrightdate'}, CGIitemtype => $CGIitemtype, - CGIbranch => $CGIbranch, CGIbookfund => $CGIbookfund, isbn => $data->{'isbn'}, seriestitle => $data->{'seriestitle'}, diff --git a/acqui/supplier.pl b/acqui/supplier.pl index e8c872b906..e7fb9b4068 100755 --- a/acqui/supplier.pl +++ b/acqui/supplier.pl @@ -50,12 +50,12 @@ my @loop_pricescurrency; my @loop_invoicecurrency; for (my $i=0;$i<$count;$i++) { if ($booksellers[0]->{'listprice'} eq $currencies->[$i]->{'currency'}) { - push @loop_pricescurrency, { currency => "" }; + push @loop_pricescurrency, { currency => "" }; } else { push @loop_pricescurrency, { currency => ""}; } if ($booksellers[0]->{'invoiceprice'} eq $currencies->[$i]->{'currency'}) { - push @loop_invoicecurrency, { currency => ""}; + push @loop_invoicecurrency, { currency => ""}; } else { push @loop_invoicecurrency, { currency => ""}; } -- 2.39.5