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;
66 if($languages_count > 1){
67 $template->param(languages => \@options);
70 my $branchinfo = getbranchinfo();
72 foreach my $branch (@$branchinfo) {
74 $row{'branch_name'} = $branch->{'branchname'};
75 $row{'branch_hours'} = $branch->{'branchhours'};
76 $row{'branch_hours'} =~ s^\n^<br />^g;
77 push (@loop_data, \%row);
81 my $dbh = C4::Context->dbh;
83 $sth = $dbh->prepare("Select * from branches order by branchcode");
87 while(my $data = $sth->fetchrow_hashref) {
88 push(@results, $data);
95 $template->param(CGIitemtype => $CGIitemtype,
96 suggestion => C4::Context->preference("suggestion"),
97 virtualshelves => C4::Context->preference("virtualshelves"),
98 textmessaging => $borrower->{textmessaging},
99 opaclargeimage => C4::Context->preference("opaclargeimage"),
100 LibraryName => C4::Context->preference("LibraryName"),
101 OpacNav => C4::Context->preference("OpacNav"),
102 opaccredits => C4::Context->preference("opaccredits"),
103 opacreadinghistory => C4::Context->preference("opacreadinghistory"),
104 opacsmallimage => C4::Context->preference("opacsmallimage"),
105 opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
106 opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"),
107 opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
108 branches => \@loop_data,
111 $template->param('Disable_Dictionary'=>C4::Context->preference("Disable_Dictionary")) if (C4::Context->preference("Disable_Dictionary"));
113 output_html_with_http_headers $input, $cookie, $template->output;