X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=reports%2Fitemtypes.plugin;h=e4164a5a76f77013d0d7d902b58c07de4fe0d630;hb=9c5e40e4923179bf0b2b630d3e09797dc4c1fdb0;hp=813435440beff3cc5589311db34715dc8d9efed5;hpb=2202ee78c3abf41aa46d131036b1a4162c8faf35;p=koha.git diff --git a/reports/itemtypes.plugin b/reports/itemtypes.plugin index 813435440b..e4164a5a76 100755 --- a/reports/itemtypes.plugin +++ b/reports/itemtypes.plugin @@ -31,30 +31,15 @@ use C4::Branch; # GetBranches =cut sub set_parameters { - my ($template) = @_; - my $dbh = C4::Context->dbh; - my $branches=GetBranches(); - my @branches; - my $default; - my @select_branch; - my %select_branches; - push @select_branch,""; - $select_branches{""} = ""; - for my $branch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { - push @select_branch, $branch; - $select_branches{$branch} = $branches->{$branch}->{'branchname'}; - $default = C4::Context->userenv->{'branch'} if (C4::Context->userenv && C4::Context->userenv->{'branch'}); - } - my $CGIbranch=CGI::scrolling_list( -name => 'value', - -id => 'value', - -values => \@select_branch, - -labels => \%select_branches, - -size => 1, - -multiple => 0, - -default => $default, ); - $template->param(CGIbranch => $CGIbranch); - return $template; + my ($template) = @_; + my $userbranch = ''; + if (C4::Context->userenv && C4::Context->userenv->{'branch'}) { + $userbranch = C4::Context->userenv->{'branch'}; + } + $template->param( branchloop => GetBranchesLoop($userbranch) ); + return $template; } + sub calculate { my ($parameters) = @_; my @results =();