From 92051e44ddede2ef0b679c364ccc30d34a6ff664 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Tue, 24 Mar 2009 16:36:11 -0500 Subject: [PATCH] Convert opac-reserve to use GetBranchesLoop. Removed irrelevant and unused variables dealing with branches. Also pulled default branch from userenv when not specified as a param. Signed-off-by: Galen Charlton --- .../prog/en/modules/opac-reserve.tmpl | 4 +-- opac/opac-reserve.pl | 31 ++----------------- 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl index f02ef54e4c..214a7ba50f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl @@ -347,9 +347,9 @@ disabled="disabled" > - + - + diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 9394dfa78a..4395f38145 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -88,39 +88,14 @@ if (($#biblionumbers < 0) && (! $query->param('place_reserve'))) { } # pass the pickup branch along.... -my $branch = $query->param('branch'); +my $branch = $query->param('branch') || C4::Context->userenv->{branch} || '' ; +($branches->{$branch}) or $branch = ""; # Confirm branch is real $template->param( branch => $branch ); -# make sure it's a real branch -if ( !$branch || !$branches->{$branch} ) { - $branch = ''; -} -$template->param( branchname => $branches->{$branch}->{'branchname'} ); - # make branch selection options... -my @branches; -my @select_branch; -my %select_branches; - -my @CGIbranchlooparray; - -foreach my $branch ( keys %$branches ) { - if ($branch) { - my %line; - $line{branch} = $branches->{$branch}->{'branchname'}; - $line{value} = $branch; - if ($line{value} eq C4::Context->userenv->{'branch'}) { - $line{selected} = 1; - } - push @CGIbranchlooparray, \%line; - } -} -@CGIbranchlooparray = sort { $a->{branch} cmp $b->{branch} } @CGIbranchlooparray; - -my $CGIbranchloop = \@CGIbranchlooparray; +my $CGIbranchloop = GetBranchesLoop($branch); $template->param( CGIbranch => $CGIbranchloop ); - #Debug #output_html_with_http_headers($query,$cookie," @biblionumbers \n"); #exit; -- 2.39.5