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>.
37 use Koha
::Config
::SysPrefs
;
39 #use Smart::Comments '####';
42 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
44 template_name
=> "about.tt",
48 flagsrequired
=> { catalogue
=> 1 },
53 my $kohaVersion = Koha
::version
();
54 my $osVersion = `uname -a`;
57 $perl_path .= $Config{_exe
} unless $perl_path =~ m/$Config{_exe}$/i;
60 my $mysqlVersion = `mysql -V`;
62 my $apacheVersion = (`apache2ctl -v`)[0];
63 $apacheVersion = `httpd2 -v 2> /dev/null` unless $apacheVersion;
64 $apacheVersion = `httpd -v 2> /dev/null` unless $apacheVersion;
65 my $zebraVersion = `zebraidx -V`;
67 # Additional system information for warnings
68 my $prefAutoCreateAuthorities = C4
::Context
->preference('AutoCreateAuthorities');
69 my $prefBiblioAddsAuthorities = C4
::Context
->preference('BiblioAddsAuthorities');
70 my $warnPrefBiblioAddsAuthorities = ( $prefAutoCreateAuthorities && ( !$prefBiblioAddsAuthorities) );
72 my $prefEasyAnalyticalRecords = C4
::Context
->preference('EasyAnalyticalRecords');
73 my $prefUseControlNumber = C4
::Context
->preference('UseControlNumber');
74 my $warnPrefEasyAnalyticalRecords = ( $prefEasyAnalyticalRecords && $prefUseControlNumber );
75 my $warnPrefAnonymousPatron = (
76 C4
::Context
->preference('OPACPrivacy')
77 and not C4
::Context
->preference('AnonymousPatron')
80 my $errZebraConnection = C4
::Context
->Zconn("biblioserver",0)->errcode();
82 my $warnIsRootUser = (! $loggedinuser);
84 my $warnNoActiveCurrency = (! defined C4
::Budgets
->GetCurrency());
85 my @xml_config_warnings;
87 my $context = new C4
::Context
;
89 if ( ! defined C4
::Context
->config('zebra_bib_index_mode') ) {
90 push @xml_config_warnings, {
91 error
=> 'zebra_bib_index_mode_warn'
93 if ($context->{'server'}->{'biblioserver'}->{'config'} !~ /zebra-biblios-dom.cfg/) {
94 push @xml_config_warnings, {
95 error
=> 'zebra_bib_mode_seems_grs1'
99 push @xml_config_warnings, {
100 error
=> 'zebra_bib_mode_seems_dom'
104 push @xml_config_warnings, { error
=> 'zebra_bib_grs_warn' }
105 if C4
::Context
->config('zebra_bib_index_mode') eq 'grs1';
108 if ( (C4
::Context
->config('zebra_bib_index_mode') eq 'dom') &&
109 ($context->{'server'}->{'biblioserver'}->{'config'} !~ /zebra-biblios-dom.cfg/) ) {
111 push @xml_config_warnings, {
112 error
=> 'zebra_bib_index_mode_mismatch_warn'
116 if ( (C4
::Context
->config('zebra_bib_index_mode') eq 'grs1') &&
117 ($context->{'server'}->{'biblioserver'}->{'config'} =~ /zebra-biblios-dom.cfg/) ) {
119 push @xml_config_warnings, {
120 error
=> 'zebra_bib_index_mode_mismatch_warn'
124 if ( ! defined C4
::Context
->config('zebra_auth_index_mode') ) {
125 push @xml_config_warnings, {
126 error
=> 'zebra_auth_index_mode_warn'
128 if ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) {
129 push @xml_config_warnings, {
130 error
=> 'zebra_auth_mode_seems_grs1'
134 push @xml_config_warnings, {
135 error
=> 'zebra_auth_mode_seems_dom'
139 push @xml_config_warnings, { error
=> 'zebra_auth_grs_warn' }
140 if C4
::Context
->config('zebra_auth_index_mode') eq 'grs1';
143 if ( (C4
::Context
->config('zebra_auth_index_mode') eq 'dom') && ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) ) {
144 push @xml_config_warnings, {
145 error
=> 'zebra_auth_index_mode_mismatch_warn'
149 if ( (C4
::Context
->config('zebra_auth_index_mode') eq 'grs1') && ($context->{'server'}->{'authorityserver'}->{'config'} =~ /zebra-authorities-dom.cfg/) ) {
150 push @xml_config_warnings, {
151 error
=> 'zebra_auth_index_mode_mismatch_warn'
155 if ( ! defined C4
::Context
->config('log4perl_conf') ) {
156 push @xml_config_warnings, {
157 error
=> 'log4perl_entry_missing'
161 if ( ! defined C4
::Context
->config('upload_path') ) {
162 if ( Koha
::Config
::SysPrefs
->find('OPACBaseURL')->value ) {
163 # OPACBaseURL seems to be set
164 push @xml_config_warnings, {
165 error
=> 'uploadpath_entry_missing'
168 push @xml_config_warnings, {
169 error
=> 'uploadpath_and_opacbaseurl_entry_missing'
174 # Test QueryParser configuration sanity
175 if ( C4
::Context
->preference( 'UseQueryParser' ) ) {
176 # Get the QueryParser configuration file name
177 my $queryparser_file = C4
::Context
->config( 'queryparser_config' );
178 my $queryparser_fallback_file = '/etc/koha/searchengine/queryparser.yaml';
179 # Check QueryParser is functional
180 my $QParser = C4
::Context
->queryparser();
181 my $queryparser_error = {};
182 if ( ! defined $QParser || ref($QParser) ne 'Koha::QueryParser::Driver::PQF' ) {
183 # Error initializing the QueryParser object
184 # Get the used queryparser.yaml file path to report the user
185 $queryparser_error->{ fallback
} = ( defined $queryparser_file ) ?
0 : 1;
186 $queryparser_error->{ file
} = ( defined $queryparser_file )
188 : $queryparser_fallback_file;
189 # Report error data to the template
190 $template->param( QueryParserError
=> $queryparser_error );
192 # Check for an absent queryparser_config entry in koha-conf.xml
193 if ( ! defined $queryparser_file ) {
194 # Not an error but a warning for the missing entry in koha-conf-xml
195 push @xml_config_warnings, {
196 error
=> 'queryparser_entry_missing',
197 file
=> $queryparser_fallback_file
203 # Test Zebra facets configuration
204 if ( !defined C4
::Context
->config('use_zebra_facets') ) {
205 push @xml_config_warnings, { error
=> 'use_zebra_facets_entry_missing' };
207 if ( C4
::Context
->config('use_zebra_facets') &&
208 C4
::Context
->config('zebra_bib_index_mode') ) {
209 # use_zebra_facets works with DOM
210 push @xml_config_warnings, {
211 error
=> 'use_zebra_facets_needs_dom'
212 } if C4
::Context
->config('zebra_bib_index_mode') ne 'dom' ;
217 kohaVersion
=> $kohaVersion,
218 osVersion
=> $osVersion,
219 perlPath
=> $perl_path,
220 perlVersion
=> $perlVersion,
221 perlIncPath
=> [ map { perlinc
=> $_ }, @INC ],
222 mysqlVersion
=> $mysqlVersion,
223 apacheVersion
=> $apacheVersion,
224 zebraVersion
=> $zebraVersion,
225 prefBiblioAddsAuthorities
=> $prefBiblioAddsAuthorities,
226 prefAutoCreateAuthorities
=> $prefAutoCreateAuthorities,
227 warnPrefBiblioAddsAuthorities
=> $warnPrefBiblioAddsAuthorities,
228 warnPrefEasyAnalyticalRecords
=> $warnPrefEasyAnalyticalRecords,
229 warnPrefAnonymousPatron
=> $warnPrefAnonymousPatron,
230 errZebraConnection
=> $errZebraConnection,
231 warnIsRootUser
=> $warnIsRootUser,
232 warnNoActiveCurrency
=> $warnNoActiveCurrency,
233 xml_config_warnings
=> \
@xml_config_warnings,
238 my $perl_modules = C4
::Installer
::PerlModules
->new;
239 $perl_modules->version_info;
241 my @pm_types = qw(missing_pm upgrade_pm current_pm);
243 foreach my $pm_type(@pm_types) {
244 my $modules = $perl_modules->get_attr($pm_type);
245 foreach (@
$modules) {
246 my ($module, $stats) = each %$_;
251 version
=> $stats->{'cur_ver'},
252 missing
=> ($pm_type eq 'missing_pm' ?
1 : 0),
253 upgrade
=> ($pm_type eq 'upgrade_pm' ?
1 : 0),
254 current
=> ($pm_type eq 'current_pm' ?
1 : 0),
255 require => $stats->{'required'},
256 reqversion
=> $stats->{'min_ver'},
262 @components = sort {$a->{'name'} cmp $b->{'name'}} @components;
267 foreach (@components) {
269 unless (++$counter % 4) {
270 push (@
$table, {row
=> $row});
274 # Processing the last line (if there are any modules left)
275 if (scalar(@
$row) > 0) {
276 # Extending $row to the table size
278 # Pushing the last line
279 push (@
$table, {row
=> $row});
283 $template->param( table
=> $table );
286 ## ------------------------------------------
287 ## Koha time line code
291 if ( defined C4
::Context
->config('docdir') ) {
292 $docdir = C4
::Context
->config('docdir');
294 # if no <docdir> is defined in koha-conf.xml, use the default location
295 # this is a work-around to stop breakage on upgraded Kohas, bug 8911
296 $docdir = C4
::Context
->config('intranetdir') . '/docs';
299 if ( open( my $file, "<:encoding(UTF-8)", "$docdir" . "/history.txt" ) ) {
309 shift @lines; #remove header row
312 my ( $date, $desc, $tag ) = split(/\t/);
313 if(!$desc && $date=~ /(?<=\d{4})\s+/) {
314 ($date, $desc)= ($`, $');
326 #foreach my $row2 (@rows2) {
329 push( @$table2, { row2 => $row2 } );
333 $template->param( table2 => $table2 );
335 $template->param( timeline_read_error => 1 );
338 output_html_with_http_headers $query, $cookie, $template->output;