8 use C4::Auth; # get_template_and_user
9 use C4::Interface::CGI::Output;
15 my $kohaVersion = C4::Context->config("kohaversion");
16 my $dbh = C4::Context->dbh;
17 my $query="Select itemtype,description from itemtypes order by description";
18 my $sth=$dbh->prepare($query);
22 while (my ($value,$lib) = $sth->fetchrow_array) {
23 my %row =( value => $value,
26 push @itemtypeloop, \%row;
33 my $branches = getallbranches();
35 foreach my $thisbranch (keys %$branches) {
36 my $selected = 1 if (C4::Context->userenv && ($thisbranch eq C4::Context->userenv->{branch}));
37 my %row =(value => $thisbranch,
38 selected => $selected,
39 branchname => $branches->{$thisbranch}->{'branchname'},
41 push @branchloop, \%row;
44 my ($template, $borrowernumber, $cookie)
45 = get_template_and_user({template_name => "opac-main.tmpl",
49 flagsrequired => {borrow => 1},
51 my $borrower = getmember('',$borrowernumber);
54 foreach my $language (getalllanguages()) {
55 next if $language eq 'images';
56 next if $language eq 'CVS';
57 next if $language=~ /png$/;
58 next if $language=~ /css$/;
60 # next if $currently_selected_languages->{$language};
61 push @options, { language => $language, counter => $counter };
64 my $languages_count = @options;
65 if($languages_count > 1){
66 $template->param(languages => \@options);
69 my $branchinfo = getbranchinfo();
71 foreach my $branch (@$branchinfo) {
73 $row{'branch_name'} = $branch->{'branchname'};
74 $row{'branch_hours'} = $branch->{'branchhours'};
75 $row{'branch_hours'} =~ s^\n^<br />^g;
76 push (@loop_data, \%row);
80 my $dbh = C4::Context->dbh;
82 $sth = $dbh->prepare("Select * from branches order by branchcode");
86 while(my $data = $sth->fetchrow_hashref) {
87 push(@results, $data);
94 $template->param( suggestion => C4::Context->preference("suggestion"),
95 virtualshelves => C4::Context->preference("virtualshelves"),
96 textmessaging => $borrower->{textmessaging},
97 opaclargeimage => C4::Context->preference("opaclargeimage"),
98 LibraryName => C4::Context->preference("LibraryName"),
99 OpacNav => C4::Context->preference("OpacNav"),
100 opaccredits => C4::Context->preference("opaccredits"),
101 opacreadinghistory => C4::Context->preference("opacreadinghistory"),
102 opacsmallimage => C4::Context->preference("opacsmallimage"),
103 opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
104 opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"),
105 opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
106 branches => \@loop_data,
109 $template->param('Disable_Dictionary'=>C4::Context->preference("Disable_Dictionary")) if (C4::Context->preference("Disable_Dictionary"));
111 output_html_with_http_headers $input, $cookie, $template->output;