From 0a7c849997b691dc821f175c7a2ec359bb3211c5 Mon Sep 17 00:00:00 2001 From: bob_lyon Date: Wed, 7 Jun 2006 04:56:55 +0000 Subject: [PATCH] merging katipo changes... Added the ability to display all branches opening/closing times on the opac homepage --- opac/opac-main.pl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/opac/opac-main.pl b/opac/opac-main.pl index 755652d371..0cc07cf2ab 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -66,6 +66,32 @@ my $languages_count = @options; if($languages_count > 1){ $template->param(languages => \@options); } + +my $branchinfo = getbranchinfo(); +my @loop_data =(); +foreach my $branch (@$branchinfo) { + my %row =(); + $row{'branch_name'} = $branch->{'branchname'}; + $row{'branch_hours'} = $branch->{'branchhours'}; + $row{'branch_hours'} =~ s^\n^
^g; + push (@loop_data, \%row); + } + +sub getbranchinfo { + my $dbh = C4::Context->dbh; + my $sth; + $sth = $dbh->prepare("Select * from branches order by branchcode"); + $sth->execute(); + + my @results; + while(my $data = $sth->fetchrow_hashref) { + push(@results, $data); + } + $sth->finish; + return \@results; +} + + $template->param(CGIitemtype => $CGIitemtype, suggestion => C4::Context->preference("suggestion"), virtualshelves => C4::Context->preference("virtualshelves"), @@ -79,6 +105,7 @@ $template->param(CGIitemtype => $CGIitemtype, opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"), opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"), opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"), + branches => \@loop_data, ); $template->param('Disable_Dictionary'=>C4::Context->preference("Disable_Dictionary")) if (C4::Context->preference("Disable_Dictionary")); -- 2.39.5