3 # Copyright Pat Eyler 2003
4 # Copyright Biblibre 2006
5 # Parts Copyright Liblime 2008
6 # Parts Copyright Chris Nighswonger 2010
8 # This file is part of Koha.
10 # Koha is free software; you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 3 of the License, or
13 # (at your option) any later version.
15 # Koha is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with Koha; if not, see <http://www.gnu.org/licenses>.
36 #use Smart::Comments '####';
39 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
41 template_name
=> "about.tt",
45 flagsrequired
=> { catalogue
=> 1 },
50 my $kohaVersion = C4
::Context
::KOHAVERSION
;
51 my $osVersion = `uname -a`;
54 $perl_path .= $Config{_exe
} unless $perl_path =~ m/$Config{_exe}$/i;
57 my $mysqlVersion = `mysql -V`;
58 my $apacheVersion = `httpd -v 2> /dev/null`;
59 $apacheVersion = `httpd2 -v 2> /dev/null` unless $apacheVersion;
60 $apacheVersion = (`/usr/sbin/apache2 -V`)[0] unless $apacheVersion;
61 my $zebraVersion = `zebraidx -V`;
63 # Additional system information for warnings
64 my $prefAutoCreateAuthorities = C4
::Context
->preference('AutoCreateAuthorities');
65 my $prefBiblioAddsAuthorities = C4
::Context
->preference('BiblioAddsAuthorities');
66 my $warnPrefBiblioAddsAuthorities = ( $prefAutoCreateAuthorities && ( !$prefBiblioAddsAuthorities) );
68 my $prefEasyAnalyticalRecords = C4
::Context
->preference('EasyAnalyticalRecords');
69 my $prefUseControlNumber = C4
::Context
->preference('UseControlNumber');
70 my $warnPrefEasyAnalyticalRecords = ( $prefEasyAnalyticalRecords && $prefUseControlNumber );
71 my $warnPrefAnonymousPatron = (
72 C4
::Context
->preference('OPACPrivacy')
73 and not C4
::Context
->preference('AnonymousPatron')
76 my $errZebraConnection = C4
::Context
->Zconn("biblioserver",0)->errcode();
78 my $warnIsRootUser = (! $loggedinuser);
80 my $warnNoActiveCurrency = (! defined C4
::Budgets
->GetCurrency());
81 my @xml_config_warnings;
83 my $context = new C4
::Context
;
85 if ( ! defined C4
::Context
->config('zebra_bib_index_mode') ) {
86 push @xml_config_warnings, {
87 error
=> 'zebra_bib_index_mode_warn'
89 if ($context->{'server'}->{'biblioserver'}->{'config'} !~ /zebra-biblios-dom.cfg/) {
90 push @xml_config_warnings, {
91 error
=> 'zebra_bib_mode_seems_grs1'
95 push @xml_config_warnings, {
96 error
=> 'zebra_bib_mode_seems_dom'
100 push @xml_config_warnings, { error
=> 'zebra_bib_grs_warn' }
101 if C4
::Context
->config('zebra_bib_index_mode') eq 'grs1';
104 if ( (C4
::Context
->config('zebra_bib_index_mode') eq 'dom') &&
105 ($context->{'server'}->{'biblioserver'}->{'config'} !~ /zebra-biblios-dom.cfg/) ) {
107 push @xml_config_warnings, {
108 error
=> 'zebra_bib_index_mode_mismatch_warn'
112 if ( (C4
::Context
->config('zebra_bib_index_mode') eq 'grs1') &&
113 ($context->{'server'}->{'biblioserver'}->{'config'} =~ /zebra-biblios-dom.cfg/) ) {
115 push @xml_config_warnings, {
116 error
=> 'zebra_bib_index_mode_mismatch_warn'
120 if ( ! defined C4
::Context
->config('zebra_auth_index_mode') ) {
121 push @xml_config_warnings, {
122 error
=> 'zebra_auth_index_mode_warn'
124 if ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) {
125 push @xml_config_warnings, {
126 error
=> 'zebra_auth_mode_seems_grs1'
130 push @xml_config_warnings, {
131 error
=> 'zebra_auth_mode_seems_dom'
135 push @xml_config_warnings, { error
=> 'zebra_auth_grs_warn' }
136 if C4
::Context
->config('zebra_auth_index_mode') eq 'grs1';
139 if ( (C4
::Context
->config('zebra_auth_index_mode') eq 'dom') && ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) ) {
140 push @xml_config_warnings, {
141 error
=> 'zebra_auth_index_mode_mismatch_warn'
145 if ( (C4
::Context
->config('zebra_auth_index_mode') eq 'grs1') && ($context->{'server'}->{'authorityserver'}->{'config'} =~ /zebra-authorities-dom.cfg/) ) {
146 push @xml_config_warnings, {
147 error
=> 'zebra_auth_index_mode_mismatch_warn'
151 # Test QueryParser configuration sanity
152 if ( C4
::Context
->preference( 'UseQueryParser' ) ) {
153 # Get the QueryParser configuration file name
154 my $queryparser_file = C4
::Context
->config( 'queryparser_config' );
155 my $queryparser_fallback_file = '/etc/koha/searchengine/queryparser.yaml';
156 # Check QueryParser is functional
157 my $QParser = C4
::Context
->queryparser();
158 my $queryparser_error = {};
159 if ( ! defined $QParser || ref($QParser) ne 'Koha::QueryParser::Driver::PQF' ) {
160 # Error initializing the QueryParser object
161 # Get the used queryparser.yaml file path to report the user
162 $queryparser_error->{ fallback
} = ( defined $queryparser_file ) ?
0 : 1;
163 $queryparser_error->{ file
} = ( defined $queryparser_file )
165 : $queryparser_fallback_file;
166 # Report error data to the template
167 $template->param( QueryParserError
=> $queryparser_error );
169 # Check for an absent queryparser_config entry in koha-conf.xml
170 if ( ! defined $queryparser_file ) {
171 # Not an error but a warning for the missing entry in koha-conf-xml
172 push @xml_config_warnings, {
173 error
=> 'queryparser_entry_missing',
174 file
=> $queryparser_fallback_file
180 # Test Zebra facets configuration
181 if ( !defined C4
::Context
->config('use_zebra_facets') ) {
182 push @xml_config_warnings, { error
=> 'use_zebra_facets_entry_missing' };
184 if ( C4
::Context
->config('use_zebra_facets') &&
185 C4
::Context
->config('zebra_bib_index_mode') ) {
186 # use_zebra_facets works with DOM
187 push @xml_config_warnings, {
188 error
=> 'use_zebra_facets_needs_dom'
189 } if C4
::Context
->config('zebra_bib_index_mode') ne 'dom' ;
194 kohaVersion
=> $kohaVersion,
195 osVersion
=> $osVersion,
196 perlPath
=> $perl_path,
197 perlVersion
=> $perlVersion,
198 perlIncPath
=> [ map { perlinc
=> $_ }, @INC ],
199 mysqlVersion
=> $mysqlVersion,
200 apacheVersion
=> $apacheVersion,
201 zebraVersion
=> $zebraVersion,
202 prefBiblioAddsAuthorities
=> $prefBiblioAddsAuthorities,
203 prefAutoCreateAuthorities
=> $prefAutoCreateAuthorities,
204 warnPrefBiblioAddsAuthorities
=> $warnPrefBiblioAddsAuthorities,
205 warnPrefEasyAnalyticalRecords
=> $warnPrefEasyAnalyticalRecords,
206 warnPrefAnonymousPatron
=> $warnPrefAnonymousPatron,
207 errZebraConnection
=> $errZebraConnection,
208 warnIsRootUser
=> $warnIsRootUser,
209 warnNoActiveCurrency
=> $warnNoActiveCurrency,
210 xml_config_warnings
=> \
@xml_config_warnings,
215 my $perl_modules = C4
::Installer
::PerlModules
->new;
216 $perl_modules->version_info;
218 my @pm_types = qw(missing_pm upgrade_pm current_pm);
220 foreach my $pm_type(@pm_types) {
221 my $modules = $perl_modules->get_attr($pm_type);
222 foreach (@
$modules) {
223 my ($module, $stats) = each %$_;
228 version
=> $stats->{'cur_ver'},
229 missing
=> ($pm_type eq 'missing_pm' ?
1 : 0),
230 upgrade
=> ($pm_type eq 'upgrade_pm' ?
1 : 0),
231 current
=> ($pm_type eq 'current_pm' ?
1 : 0),
232 require => $stats->{'required'},
233 reqversion
=> $stats->{'min_ver'},
239 @components = sort {$a->{'name'} cmp $b->{'name'}} @components;
244 foreach (@components) {
246 unless (++$counter % 4) {
247 push (@
$table, {row
=> $row});
251 # Processing the last line (if there are any modules left)
252 if (scalar(@
$row) > 0) {
253 # Extending $row to the table size
255 # Pushing the last line
256 push (@
$table, {row
=> $row});
260 $template->param( table
=> $table );
263 ## ------------------------------------------
264 ## Koha time line code
268 if ( defined C4
::Context
->config('docdir') ) {
269 $docdir = C4
::Context
->config('docdir');
271 # if no <docdir> is defined in koha-conf.xml, use the default location
272 # this is a work-around to stop breakage on upgraded Kohas, bug 8911
273 $docdir = C4
::Context
->config('intranetdir') . '/docs';
276 if ( open( my $file, "<:encoding(UTF-8)", "$docdir" . "/history.txt" ) ) {
286 shift @lines; #remove header row
289 my ( $date, $desc, $tag ) = split(/\t/);
290 if(!$desc && $date=~ /(?<=\d{4})\s+/) {
291 ($date, $desc)= ($`, $');
303 #foreach my $row2 (@rows2) {
306 push( @$table2, { row2 => $row2 } );
310 $template->param( table2 => $table2 );
312 $template->param( timeline_read_error => 1 );
315 output_html_with_http_headers $query, $cookie, $template->output;