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>.
26 use DateTime::TimeZone;
27 use File::Slurp qw( read_file );
28 use List::MoreUtils qw( any );
29 use Module::Load::Conditional qw( can_load );
30 use Config qw( %Config );
31 use Search::Elasticsearch;
32 use Try::Tiny qw( catch try );
36 use C4::Output qw( output_html_with_http_headers );
37 use C4::Auth qw( get_template_and_user get_user_subpermissions );
39 use C4::Installer::PerlModules;
42 use Koha::DateUtils qw( dt_from_string output_pref );
43 use Koha::Acquisition::Currencies;
44 use Koha::Authorities;
45 use Koha::BackgroundJob;
46 use Koha::BiblioFrameworks;
49 use Koha::Patron::Categories;
52 use Koha::Config::SysPrefs;
53 use Koha::Illrequest::Config;
54 use Koha::SearchEngine::Elasticsearch;
56 use Koha::Filter::MARC::ViewPolicy;
58 use C4::Members::Statistics;
61 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
63 template_name => "about.tt",
66 flagsrequired => { catalogue => 1 },
70 my $config_timezone = C4::Context->config('timezone') // '';
71 my $config_invalid = !DateTime::TimeZone->is_valid_name( $config_timezone );
72 my $env_timezone = $ENV{TZ} // '';
73 my $env_invalid = !DateTime::TimeZone->is_valid_name( $env_timezone );
74 my $actual_bad_tz_fallback = 0;
76 if ( $config_timezone ne '' &&
79 $actual_bad_tz_fallback = 1;
81 elsif ( $config_timezone eq '' &&
82 $env_timezone ne '' &&
84 # No config, but bad ENV{TZ}
85 $actual_bad_tz_fallback = 1;
89 actual => C4::Context->tz->name,
90 actual_bad_tz_fallback => $actual_bad_tz_fallback,
91 config => $config_timezone,
92 config_invalid => $config_invalid,
93 environment => $env_timezone,
94 environment_invalid => $env_invalid
98 my $log4perl_config = C4::Context->config("log4perl_conf");
100 if ( ! $log4perl_config ) {
101 push @log4perl_errors, 'missing_config_entry'
104 my @lines = read_file($log4perl_config) or push @log4perl_errors, 'cannot_read_config_file';
105 for my $line ( @lines ) {
106 next unless $line =~ m|log4perl.appender.\w+.filename=(.*)|;
107 push @log4perl_errors, 'logfile_not_writable' unless -w $1;
110 eval {Koha::Logger->get};
111 push @log4perl_errors, 'cannot_init_module' and warn $@ if $@;
112 $template->param( log4perl_errors => @log4perl_errors );
116 time_zone => $time_zone,
117 current_date_and_time => output_pref({ dt => dt_from_string(), dateformat => 'iso' })
122 $perl_path .= $Config{_exe} unless $perl_path =~ m/$Config{_exe}$/i;
125 my $zebraVersion = `zebraidx -V`;
127 # Check running PSGI env
128 if ( C4::Context->psgi_env ) {
131 psgi_server => ($ENV{ PLACK_ENV }) ? "Plack ($ENV{PLACK_ENV})" :
132 ($ENV{ MOD_PERL }) ? "mod_perl ($ENV{MOD_PERL})" :
137 # Memcached configuration
138 my $memcached_servers = $ENV{MEMCACHED_SERVERS} || C4::Context->config('memcached_servers');
139 my $memcached_namespace = $ENV{MEMCACHED_NAMESPACE} || C4::Context->config('memcached_namespace') // 'koha';
141 my $cache = Koha::Caches->get_instance;
142 my $effective_caching_method = ref($cache->cache);
143 # Memcached may have been running when plack has been initialized but could have been stopped since
144 # FIXME What are the consequences of that??
145 my $is_memcached_still_active = $cache->set_in_cache('test_for_about_page', "just a simple value");
147 my $where_is_memcached_config = 'nowhere';
148 if ( $ENV{MEMCACHED_SERVERS} and C4::Context->config('memcached_servers') ) {
149 $where_is_memcached_config = 'both';
150 } elsif ( $ENV{MEMCACHED_SERVERS} and not C4::Context->config('memcached_servers') ) {
151 $where_is_memcached_config = 'ENV_only';
152 } elsif ( C4::Context->config('memcached_servers') ) {
153 $where_is_memcached_config = 'config_only';
157 effective_caching_method => $effective_caching_method,
158 memcached_servers => $memcached_servers,
159 memcached_namespace => $memcached_namespace,
160 is_memcached_still_active => $is_memcached_still_active,
161 where_is_memcached_config => $where_is_memcached_config,
162 memcached_running => Koha::Caches->get_instance->memcached_cache,
165 # Additional system information for warnings
167 my $warnStatisticsFieldsError;
168 my $prefStatisticsFields = C4::Context->preference('StatisticsFields');
169 if ($prefStatisticsFields) {
170 $warnStatisticsFieldsError = $prefStatisticsFields
171 unless ( $prefStatisticsFields eq C4::Members::Statistics->get_fields() );
174 my $prefAutoCreateAuthorities = C4::Context->preference('AutoCreateAuthorities');
175 my $prefRequireChoosingExistingAuthority = C4::Context->preference('RequireChoosingExistingAuthority');
176 my $warnPrefRequireChoosingExistingAuthority = ( !$prefAutoCreateAuthorities && ( !$prefRequireChoosingExistingAuthority) );
178 my $prefEasyAnalyticalRecords = C4::Context->preference('EasyAnalyticalRecords');
179 my $prefUseControlNumber = C4::Context->preference('UseControlNumber');
180 my $warnPrefEasyAnalyticalRecords = ( $prefEasyAnalyticalRecords && $prefUseControlNumber );
182 my $AnonymousPatron = C4::Context->preference('AnonymousPatron');
183 my $warnPrefAnonymousPatronOPACPrivacy = (
184 C4::Context->preference('OPACPrivacy')
185 and not $AnonymousPatron
187 my $warnPrefAnonymousPatronAnonSuggestions = (
188 C4::Context->preference('AnonSuggestions')
189 and not $AnonymousPatron
192 my $anonymous_patron = Koha::Patrons->find( $AnonymousPatron );
193 my $warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist = ( $AnonymousPatron && C4::Context->preference('AnonSuggestions') && not $anonymous_patron );
195 my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count );
197 my $warnPrefKohaAdminEmailAddress = !Koha::Email->is_valid(C4::Context->preference('KohaAdminEmailAddress'));
199 my $c = Koha::Items->filter_by_visible_in_opac->count;
200 my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS');
201 my $warnPrefOpacHiddenItems = $warnings[2];
203 my $invalid_yesno = Koha::Config::SysPrefs->search(
206 value => { -or => { 'is' => undef, -not_in => [ "1", "0" ] } }
209 $template->param( invalid_yesno => $invalid_yesno );
211 my $errZebraConnection = C4::Context->Zconn("biblioserver",0)->errcode();
213 my $warnIsRootUser = (! $loggedinuser);
215 my $warnNoActiveCurrency = (! defined Koha::Acquisition::Currencies->get_active);
217 my @xml_config_warnings;
219 if ( C4::Context->config('zebra_bib_index_mode')
220 and C4::Context->config('zebra_bib_index_mode') eq 'grs1' )
222 push @xml_config_warnings, { error => 'zebra_bib_index_mode_is_grs1' };
225 if ( C4::Context->config('zebra_auth_index_mode')
226 and C4::Context->config('zebra_auth_index_mode') eq 'grs1' )
228 push @xml_config_warnings, { error => 'zebra_auth_index_mode_is_grs1' };
231 my $authorityserver = C4::Context->zebraconfig('authorityserver');
232 if( ( C4::Context->config('zebra_auth_index_mode')
233 and C4::Context->config('zebra_auth_index_mode') eq 'dom' )
234 && ( $authorityserver->{config} !~ /zebra-authorities-dom.cfg/ ) )
236 push @xml_config_warnings, {
237 error => 'zebra_auth_index_mode_mismatch_warn'
241 if ( ! defined C4::Context->config('log4perl_conf') ) {
242 push @xml_config_warnings, {
243 error => 'log4perl_entry_missing'
247 if ( ! defined C4::Context->config('lockdir') ) {
248 push @xml_config_warnings, {
249 error => 'lockdir_entry_missing'
253 unless ( -w C4::Context->config('lockdir') ) {
254 push @xml_config_warnings, {
255 error => 'lockdir_not_writable',
256 lockdir => C4::Context->config('lockdir')
261 if ( ! defined C4::Context->config('upload_path') ) {
262 if ( Koha::Config::SysPrefs->find('OPACBaseURL')->value ) {
263 # OPACBaseURL seems to be set
264 push @xml_config_warnings, {
265 error => 'uploadpath_entry_missing'
268 push @xml_config_warnings, {
269 error => 'uploadpath_and_opacbaseurl_entry_missing'
274 if ( ! C4::Context->config('tmp_path') ) {
275 my $temporary_directory = C4::Context::temporary_directory;
276 push @xml_config_warnings, {
277 error => 'tmp_path_missing',
278 effective_tmp_dir => $temporary_directory,
282 if( ! C4::Context->config('encryption_key') ) {
283 push @xml_config_warnings, { error => 'encryption_key_missing' };
286 # Test Zebra facets configuration
287 if ( !defined C4::Context->config('use_zebra_facets') ) {
288 push @xml_config_warnings, { error => 'use_zebra_facets_entry_missing' };
292 if ( C4::Context->preference('ILLModule') ) {
293 my $warnILLConfiguration = 0;
294 my $ill_config_from_file = C4::Context->config("interlibrary_loans");
295 my $ill_config = Koha::Illrequest::Config->new;
297 my $available_ill_backends =
298 ( scalar @{ $ill_config->available_backends } > 0 );
301 if ( !$available_ill_backends ) {
302 $template->param( no_ill_backends => 1 );
303 $warnILLConfiguration = 1;
307 if ( !Koha::Patron::Categories->find($ill_config->partner_code) ) {
308 $template->param( ill_partner_code_doesnt_exist => $ill_config->partner_code );
309 $warnILLConfiguration = 1;
312 if ( !$ill_config_from_file->{partner_code} ) {
313 # partner code not defined
314 $template->param( ill_partner_code_not_defined => 1 );
315 $warnILLConfiguration = 1;
319 if ( !$ill_config_from_file->{branch} ) {
321 $template->param( ill_branch_not_defined => 1 );
322 $warnILLConfiguration = 1;
325 $template->param( warnILLConfiguration => $warnILLConfiguration );
331 OPACXSLTDetailsDisplay
333 OPACXSLTResultsDisplay
339 for my $p ( @xslt_prefs ) {
340 my $xsl_filename = C4::XSLT::get_xsl_filename( $p );
341 next if -e $xsl_filename;
345 value => C4::Context->preference("$p"),
346 filename => $xsl_filename
350 $template->param( warnXSLT => \@warnXSLT ) if @warnXSLT;
353 if ( C4::Context->preference('SearchEngine') eq 'Elasticsearch' ) {
354 # Check ES configuration health and runtime status
359 my $es_has_missing = 0;
363 $es_conf = Koha::SearchEngine::Elasticsearch::_read_configuration();
366 if ( ref($_) eq 'Koha::Exceptions::Config::MissingEntry' ) {
367 $template->param( elasticsearch_fatal_config_error => $_->message );
368 $es_config_error = 1;
371 if ( !$es_config_error ) {
373 my $biblios_index_name = $es_conf->{index_name} . "_" . $Koha::SearchEngine::BIBLIOS_INDEX;
374 my $authorities_index_name = $es_conf->{index_name} . "_" . $Koha::SearchEngine::AUTHORITIES_INDEX;
376 my @indexes = ($biblios_index_name, $authorities_index_name);
377 # TODO: When new indexes get added, we could have other ways to
378 # fetch the list of available indexes (e.g. plugins, etc)
379 $es_status->{nodes} = $es_conf->{nodes};
380 my $es = Search::Elasticsearch->new({ nodes => $es_conf->{nodes} });
381 my $es_status->{version} = $es->info->{version}->{number};
383 foreach my $index ( @indexes ) {
386 $index_count = $es->indices->stats( index => $index )
387 ->{_all}{primaries}{docs}{count};
390 if ( ref($_) eq 'Search::Elasticsearch::Error::Missing' ) {
391 push @{ $es_status->{errors} }, "Index not found ($index)";
394 elsif ( ref($_) eq 'Search::Elasticsearch::Error::NoNodes' ) {
398 # TODO: when time comes, we will cover more use cases
404 my $missing_count = 0;
405 if ( $index eq $biblios_index_name ) {
406 $db_count = Koha::Biblios->search->count;
407 } elsif ( $index eq $authorities_index_name ) {
408 $db_count = Koha::Authorities->search->count;
410 if ( $db_count != -1 && $index_count != -1 ) {
411 $missing_count = $db_count - $index_count;
412 $es_has_missing = 1 if $missing_count > 0;
414 push @{ $es_status->{indexes} },
416 index_name => $index,
417 index_count => $index_count,
418 db_count => $db_count,
419 missing_count => $missing_count,
422 $es_status->{running} = $es_running;
425 elasticsearch_status => $es_status,
426 elasticsearch_has_missing => $es_has_missing,
431 if ( C4::Context->preference('RESTOAuth2ClientCredentials') ) {
432 # Do we have the required deps?
433 unless ( can_load( modules => { 'Net::OAuth2::AuthorizationServer' => undef }) ) {
434 $template->param( oauth2_missing_deps => 1 );
438 # Sco Patron should not contain any other perms than circulate => self_checkout
439 if ( C4::Context->preference('WebBasedSelfCheck')
440 and C4::Context->preference('AutoSelfCheckAllowed')
442 my $userid = C4::Context->preference('AutoSelfCheckID');
443 my $all_permissions = C4::Auth::get_user_subpermissions( $userid );
444 my ( $has_self_checkout_perm, $has_other_permissions );
445 while ( my ( $module, $permissions ) = each %$all_permissions ) {
446 if ( $module eq 'self_check' ) {
447 while ( my ( $permission, $flag ) = each %$permissions ) {
448 if ( $permission eq 'self_checkout_module' ) {
449 $has_self_checkout_perm = 1;
451 $has_other_permissions = 1;
455 $has_other_permissions = 1;
459 AutoSelfCheckPatronDoesNotHaveSelfCheckPerm => not ( $has_self_checkout_perm ),
460 AutoSelfCheckPatronHasTooManyPerm => $has_other_permissions,
464 # Test YAML system preferences
465 # FIXME: This is list of current YAML formatted prefs, should by type of preference
467 "UpdateNotForLoanStatusOnCheckin",
469 "BibtexExportAdditionalFields",
470 "RisExportAdditionalFields",
471 "UpdateItemWhenLostFromHoldList",
473 "MarcItemFieldsToOrder",
474 "UpdateitemLocationOnCheckin",
478 foreach my $syspref (@yaml_prefs) {
479 my $yaml = C4::Context->preference( $syspref );
481 eval { YAML::XS::Load( Encode::encode_utf8("$yaml\n\n") ); };
483 push @bad_yaml_prefs, $syspref;
487 $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs;
490 my $dbh = C4::Context->dbh;
491 my $patrons = $dbh->selectall_arrayref(
492 q|select b.borrowernumber from borrowers b join deletedborrowers db on b.borrowernumber=db.borrowernumber|,
495 my $biblios = $dbh->selectall_arrayref(
496 q|select b.biblionumber from biblio b join deletedbiblio db on b.biblionumber=db.biblionumber|,
499 my $items = $dbh->selectall_arrayref(
500 q|select i.itemnumber from items i join deleteditems di on i.itemnumber=di.itemnumber|,
503 my $checkouts = $dbh->selectall_arrayref(
504 q|select i.issue_id from issues i join old_issues oi on i.issue_id=oi.issue_id|,
507 my $holds = $dbh->selectall_arrayref(
508 q|select r.reserve_id from reserves r join old_reserves o on r.reserve_id=o.reserve_id|,
511 if ( @$patrons or @$biblios or @$items or @$checkouts or @$holds ) {
514 ai_patrons => $patrons,
515 ai_biblios => $biblios,
517 ai_checkouts => $checkouts,
525 my $dbh = C4::Context->dbh;
526 my $units = Koha::CirculationRules->search({ rule_name => 'lengthunit', rule_value => { -not_in => ['days', 'hours'] } });
528 if ( $units->count ) {
530 warnIssuingRules => 1,
536 # Guarantor relationships warnings
538 my $dbh = C4::Context->dbh;
539 my ($bad_relationships_count) = $dbh->selectall_arrayref(q{
542 SELECT relationship FROM borrower_relationships WHERE relationship='_bad_data'
544 SELECT relationship FROM borrowers WHERE relationship='_bad_data') a
547 $bad_relationships_count = $bad_relationships_count->[0]->[0];
549 my $existing_relationships = $dbh->selectall_arrayref(q{
550 SELECT DISTINCT(relationship)
552 SELECT relationship FROM borrower_relationships WHERE relationship IS NOT NULL
554 SELECT relationship FROM borrowers WHERE relationship IS NOT NULL) a
557 my %valid_relationships = map { $_ => 1 } split( /,|\|/, C4::Context->preference('borrowerRelationship') );
558 $valid_relationships{ _bad_data } = 1; # we handle this case in another way
560 my $wrong_relationships = [ grep { !$valid_relationships{ $_->[0] } } @{$existing_relationships} ];
561 if ( @$wrong_relationships or $bad_relationships_count ) {
564 warnRelationships => 1,
567 if ( $wrong_relationships ) {
569 wrong_relationships => $wrong_relationships
572 if ($bad_relationships_count) {
574 bad_relationships_count => $bad_relationships_count,
581 # Test 'bcrypt_settings' config for Pseudonymization
582 $template->param( config_bcrypt_settings_no_set => 1 )
583 if C4::Context->preference('Pseudonymization')
584 and not C4::Context->config('bcrypt_settings');
588 my @frameworkcodes = Koha::BiblioFrameworks->search->get_column('frameworkcode');
589 my @hidden_biblionumbers;
590 push @frameworkcodes, ""; # it's not in the biblio_frameworks table!
591 for my $frameworkcode ( @frameworkcodes ) {
592 my $shouldhidemarc_opac = Koha::Filter::MARC::ViewPolicy->should_hide_marc(
594 frameworkcode => $frameworkcode,
598 push @hidden_biblionumbers, { frameworkcode => $frameworkcode, interface => 'opac' }
599 if $shouldhidemarc_opac->{biblionumber};
601 my $shouldhidemarc_intranet = Koha::Filter::MARC::ViewPolicy->should_hide_marc(
603 frameworkcode => $frameworkcode,
604 interface => "intranet"
607 push @hidden_biblionumbers, { frameworkcode => $frameworkcode, interface => 'intranet' }
608 if $shouldhidemarc_intranet->{biblionumber};
610 $template->param( warnHiddenBiblionumbers => \@hidden_biblionumbers );
614 # BackgroundJob - test connection to message broker
616 Koha::BackgroundJob->connect;
620 $template->param( warnConnectBroker => $@ );
624 my %versions = C4::Context::get_versions();
627 kohaVersion => $versions{'kohaVersion'},
628 osVersion => $versions{'osVersion'},
629 perlPath => $perl_path,
630 perlVersion => $versions{'perlVersion'},
631 perlIncPath => [ map { perlinc => $_ }, @INC ],
632 mysqlVersion => $versions{'mysqlVersion'},
633 apacheVersion => $versions{'apacheVersion'},
634 zebraVersion => $zebraVersion,
635 prefRequireChoosingExistingAuthority => $prefRequireChoosingExistingAuthority,
636 prefAutoCreateAuthorities => $prefAutoCreateAuthorities,
637 warnPrefRequireChoosingExistingAuthority => $warnPrefRequireChoosingExistingAuthority,
638 warnPrefEasyAnalyticalRecords => $warnPrefEasyAnalyticalRecords,
639 warnPrefAnonymousPatronOPACPrivacy => $warnPrefAnonymousPatronOPACPrivacy,
640 warnPrefAnonymousPatronAnonSuggestions => $warnPrefAnonymousPatronAnonSuggestions,
641 warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist => $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist,
642 warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist => $warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist,
643 warnPrefKohaAdminEmailAddress => $warnPrefKohaAdminEmailAddress,
644 warnPrefOpacHiddenItems => $warnPrefOpacHiddenItems,
645 errZebraConnection => $errZebraConnection,
646 warnIsRootUser => $warnIsRootUser,
647 warnNoActiveCurrency => $warnNoActiveCurrency,
648 warnNoTemplateCaching => ( C4::Context->config('template_cache_dir') ? 0 : 1 ),
649 xml_config_warnings => \@xml_config_warnings,
650 warnStatisticsFieldsError => $warnStatisticsFieldsError,
655 my $perl_modules = C4::Installer::PerlModules->new;
656 $perl_modules->versions_info;
658 my @pm_types = qw(missing_pm upgrade_pm current_pm);
660 foreach my $pm_type(@pm_types) {
661 my $modules = $perl_modules->get_attr($pm_type);
662 foreach (@$modules) {
663 my ($module, $stats) = each %$_;
668 version => $stats->{'cur_ver'},
669 missing => ($pm_type eq 'missing_pm' ? 1 : 0),
670 upgrade => ($pm_type eq 'upgrade_pm' ? 1 : 0),
671 current => ($pm_type eq 'current_pm' ? 1 : 0),
672 require => $stats->{'required'},
673 reqversion => $stats->{'min_ver'},
674 maxversion => $stats->{'max_ver'},
675 excversion => $stats->{'exc_ver'}
681 @components = sort {$a->{'name'} cmp $b->{'name'}} @components;
686 foreach (@components) {
688 unless (++$counter % 4) {
689 push (@$table, {row => $row});
693 # Processing the last line (if there are any modules left)
694 if (scalar(@$row) > 0) {
695 # Extending $row to the table size
697 # Pushing the last line
698 push (@$table, {row => $row});
702 $template->param( table => $table );
705 ## ------------------------------------------
706 ## Koha contributions
708 if ( defined C4::Context->config('docdir') ) {
709 $docdir = C4::Context->config('docdir');
711 # if no <docdir> is defined in koha-conf.xml, use the default location
712 # this is a work-around to stop breakage on upgraded Kohas, bug 8911
713 $docdir = C4::Context->config('intranetdir') . '/docs';
718 -e "$docdir" . "/teams.yaml"
719 ? YAML::XS::LoadFile( "$docdir" . "/teams.yaml" )
721 my $dev_team = (sort {$b <=> $a} (keys %{$teams->{team}}))[0];
722 my $short_version = substr($versions{'kohaVersion'},0,5);
723 my $minor = substr($versions{'kohaVersion'},3,2);
724 my $development_version = ( $minor eq '05' || $minor eq '11' ) ? 0 : 1;
725 $template->param( short_version => $short_version );
726 $template->param( development_version => $development_version );
730 -e "$docdir" . "/contributors.yaml"
731 ? YAML::XS::LoadFile( "$docdir" . "/contributors.yaml" )
733 delete $contributors->{_others_};
734 for my $version ( sort { $a <=> $b } keys %{$teams->{team}} ) {
735 for my $role ( keys %{ $teams->{team}->{$version} } ) {
736 my $normalized_role = "$role";
737 $normalized_role =~ s/s$//;
738 if ( ref( $teams->{team}->{$version}->{$role} ) eq 'ARRAY' ) {
739 for my $contributor ( @{ $teams->{team}->{$version}->{$role} } ) {
740 my $name = $contributor->{name};
741 # Add role to contributors
742 push @{ $contributors->{$name}->{roles}->{$normalized_role} },
744 # Add openhub to teams
745 if ( exists( $contributors->{$name}->{openhub} ) ) {
746 $contributor->{openhub} = $contributors->{$name}->{openhub};
750 elsif ( $role ne 'release_date' ) {
751 my $name = $teams->{team}->{$version}->{$role}->{name};
752 # Add role to contributors
753 push @{ $contributors->{$name}->{roles}->{$normalized_role} },
755 # Add openhub to teams
756 if ( exists( $contributors->{$name}->{openhub} ) ) {
757 $teams->{team}->{$version}->{$role}->{openhub} =
758 $contributors->{$name}->{openhub};
762 $teams->{team}->{$version}->{$role} = DateTime->from_epoch( epoch => $teams->{team}->{$version}->{$role});
767 ## Create last name ordered array of people from contributors
769 { name => $_, ( $contributors->{$_} ? %{ $contributors->{$_} } : () ) }
771 my ($alast) = $a =~ /(\S+)$/;
772 my ($blast) = $b =~ /(\S+)$/;
773 my $cmp = lc($alast||"") cmp lc($blast||"");
776 my ($a2last) = $a =~ /(\S+)\s\S+$/;
777 my ($b2last) = $b =~ /(\S+)\s\S+$/;
778 lc($a2last||"") cmp lc($b2last||"");
779 } keys %$contributors;
781 $template->param( contributors => \@people );
782 $template->param( maintenance_team => $teams->{team}->{$dev_team} );
783 $template->param( release_team => $teams->{team}->{$short_version} );
786 if ( open( my $file, "<:encoding(UTF-8)", "$docdir" . "/history.txt" ) ) {
796 shift @lines; #remove header row
799 my ( $epoch, $date, $desc, $tag ) = split(/\t/);
800 if(!$desc && $date=~ /(?<=\d{4})\s+/) {
801 ($date, $desc)= ($`, $');
813 #foreach my $row2 (@rows2) {
816 push( @$table2, { row2 => $row2 } );
820 $template->param( table2 => $table2 );
822 $template->param( timeline_read_error => 1 );
825 output_html_with_http_headers $query, $cookie, $template->output;