From 5297711fba4b42d47d4dc4ecc8b78bcb6b5aeec8 Mon Sep 17 00:00:00 2001 From: kados Date: Wed, 8 Mar 2006 18:55:04 +0000 Subject: [PATCH] adds support for branch selection to opac-main.pl (for recent acquisitions search). --- opac/opac-main.pl | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/opac/opac-main.pl b/opac/opac-main.pl index b1423cb209..b58c1730df 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -17,6 +17,8 @@ my $sth=$dbh->prepare($query); $sth->execute; my @itemtype; my %itemtypes; +push @itemtype, ""; +$itemtypes{''}="Any Document Type"; while (my ($value,$lib) = $sth->fetchrow_array) { push @itemtype, $value; $itemtypes{$value}=$lib; @@ -29,6 +31,20 @@ my $CGIitemtype=CGI::scrolling_list( -name => 'value', -multiple => 0 ); $sth->finish; +my @branches; +my @select_branch; +my %select_branches; +my $branches = getallbranches(); +my @branchloop; +foreach my $thisbranch (keys %$branches) { + my $selected = 1 if (C4::Context->userenv && ($thisbranch eq C4::Context->userenv->{branch})); + my %row =(value => $thisbranch, + selected => $selected, + branchname => $branches->{$thisbranch}->{'branchname'}, + ); + push @branchloop, \%row; +} + my ($template, $borrowernumber, $cookie) = get_template_and_user({template_name => "opac-main.tmpl", type => "opac", @@ -55,7 +71,7 @@ if($languages_count > 1){ $template->param(languages => \@options); } $template->param(CGIitemtype => $CGIitemtype, - + branchloop=>\@branchloop, suggestion => C4::Context->preference("suggestion"), virtualshelves => C4::Context->preference("virtualshelves"), textmessaging => $borrower->{textmessaging}, -- 2.39.5