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 under the
11 # terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at your option) any later
15 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License along
20 # with Koha; if not, write to the Free Software Foundation, Inc.,
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
36 #use Smart::Comments '####';
39 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
41 template_name
=> "about.tmpl",
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 if ( ! defined C4
::Context
->config('zebra_bib_index_mode') ) {
84 push @xml_config_warnings, {
85 error
=> 'zebra_bib_index_mode_warn'
89 if ( ! defined C4
::Context
->config('zebra_auth_index_mode') ) {
90 push @xml_config_warnings, {
91 error
=> 'zebra_auth_index_mode_warn'
96 kohaVersion
=> $kohaVersion,
97 osVersion
=> $osVersion,
98 perlPath
=> $perl_path,
99 perlVersion
=> $perlVersion,
100 perlIncPath
=> [ map { perlinc
=> $_ }, @INC ],
101 mysqlVersion
=> $mysqlVersion,
102 apacheVersion
=> $apacheVersion,
103 zebraVersion
=> $zebraVersion,
104 prefBiblioAddsAuthorities
=> $prefBiblioAddsAuthorities,
105 prefAutoCreateAuthorities
=> $prefAutoCreateAuthorities,
106 warnPrefBiblioAddsAuthorities
=> $warnPrefBiblioAddsAuthorities,
107 warnPrefEasyAnalyticalRecords
=> $warnPrefEasyAnalyticalRecords,
108 warnPrefAnonymousPatron
=> $warnPrefAnonymousPatron,
109 errZebraConnection
=> $errZebraConnection,
110 warnIsRootUser
=> $warnIsRootUser,
111 warnNoActiveCurrency
=> $warnNoActiveCurrency,
112 xml_config_warnings
=> \
@xml_config_warnings,
117 my $perl_modules = C4
::Installer
::PerlModules
->new;
118 $perl_modules->version_info;
120 my @pm_types = qw(missing_pm upgrade_pm current_pm);
122 foreach my $pm_type(@pm_types) {
123 my $modules = $perl_modules->get_attr($pm_type);
124 foreach (@
$modules) {
125 my ($module, $stats) = each %$_;
130 version
=> $stats->{'cur_ver'},
131 missing
=> ($pm_type eq 'missing_pm' ?
1 : 0),
132 upgrade
=> ($pm_type eq 'upgrade_pm' ?
1 : 0),
133 current
=> ($pm_type eq 'current_pm' ?
1 : 0),
134 require => $stats->{'required'},
140 @components = sort {$a->{'name'} cmp $b->{'name'}} @components;
145 foreach (@components) {
147 unless (++$counter % 4) {
148 push (@
$table, {row
=> $row});
152 # Processing the last line (if there are any modules left)
153 if (scalar(@
$row) > 0) {
154 # Extending $row to the table size
156 # Pushing the last line
157 push (@
$table, {row
=> $row});
161 $template->param( table
=> $table );
164 ## ------------------------------------------
165 ## Koha time line code
169 if ( defined C4
::Context
->config('docdir') ) {
170 $docdir = C4
::Context
->config('docdir');
172 # if no <docdir> is defined in koha-conf.xml, use the default location
173 # this is a work-around to stop breakage on upgraded Kohas, bug 8911
174 $docdir = C4
::Context
->config('intranetdir') . '/docs';
177 if ( open( my $file, "<", "$docdir" . "/history.txt" ) ) {
187 shift @lines; #remove header row
190 my ( $date, $desc, $tag ) = split(/\t/);
191 if(!$desc && $date=~ /(?<=\d{4})\s+/) {
192 ($date, $desc)= ($`, $');
204 #foreach my $row2 (@rows2) {
207 push( @$table2, { row2 => $row2 } );
211 $template->param( table2 => $table2 );
213 $template->param( timeline_read_error => 1 );
216 output_html_with_http_headers $query, $cookie, $template->output;