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;
$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;
author => $data->{'author'},
copyrightdate => $data->{'copyrightdate'},
CGIitemtype => $CGIitemtype,
- CGIbranch => $CGIbranch,
CGIbookfund => $CGIbookfund,
isbn => $data->{'isbn'},
seriestitle => $data->{'seriestitle'},