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 ( any { /(^psgi\.|^plack\.)/i } keys %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 $prefBiblioAddsAuthorities = C4::Context->preference('BiblioAddsAuthorities');
176 my $warnPrefBiblioAddsAuthorities = ( $prefAutoCreateAuthorities && ( !$prefBiblioAddsAuthorities) );
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 # Test Zebra facets configuration
283 if ( !defined C4::Context->config('use_zebra_facets') ) {
284 push @xml_config_warnings, { error => 'use_zebra_facets_entry_missing' };
288 if ( C4::Context->preference('ILLModule') ) {
289 my $warnILLConfiguration = 0;
290 my $ill_config_from_file = C4::Context->config("interlibrary_loans");
291 my $ill_config = Koha::Illrequest::Config->new;
293 my $available_ill_backends =
294 ( scalar @{ $ill_config->available_backends } > 0 );
297 if ( !$available_ill_backends ) {
298 $template->param( no_ill_backends => 1 );
299 $warnILLConfiguration = 1;
303 if ( !Koha::Patron::Categories->find($ill_config->partner_code) ) {
304 $template->param( ill_partner_code_doesnt_exist => $ill_config->partner_code );
305 $warnILLConfiguration = 1;
308 if ( !$ill_config_from_file->{partner_code} ) {
309 # partner code not defined
310 $template->param( ill_partner_code_not_defined => 1 );
311 $warnILLConfiguration = 1;
315 if ( !$ill_config_from_file->{branch} ) {
317 $template->param( ill_branch_not_defined => 1 );
318 $warnILLConfiguration = 1;
321 $template->param( warnILLConfiguration => $warnILLConfiguration );
327 OPACXSLTDetailsDisplay
329 OPACXSLTResultsDisplay
335 for my $p ( @xslt_prefs ) {
336 my $xsl_filename = C4::XSLT::get_xsl_filename( $p );
337 next if -e $xsl_filename;
341 value => C4::Context->preference("$p"),
342 filename => $xsl_filename
346 $template->param( warnXSLT => \@warnXSLT ) if @warnXSLT;
349 if ( C4::Context->preference('SearchEngine') eq 'Elasticsearch' ) {
350 # Check ES configuration health and runtime status
355 my $es_has_missing = 0;
359 $es_conf = Koha::SearchEngine::Elasticsearch::_read_configuration();
362 if ( ref($_) eq 'Koha::Exceptions::Config::MissingEntry' ) {
363 $template->param( elasticsearch_fatal_config_error => $_->message );
364 $es_config_error = 1;
367 if ( !$es_config_error ) {
369 my $biblios_index_name = $es_conf->{index_name} . "_" . $Koha::SearchEngine::BIBLIOS_INDEX;
370 my $authorities_index_name = $es_conf->{index_name} . "_" . $Koha::SearchEngine::AUTHORITIES_INDEX;
372 my @indexes = ($biblios_index_name, $authorities_index_name);
373 # TODO: When new indexes get added, we could have other ways to
374 # fetch the list of available indexes (e.g. plugins, etc)
375 $es_status->{nodes} = $es_conf->{nodes};
376 my $es = Search::Elasticsearch->new({ nodes => $es_conf->{nodes} });
377 my $es_status->{version} = $es->info->{version}->{number};
379 foreach my $index ( @indexes ) {
382 $index_count = $es->indices->stats( index => $index )
383 ->{_all}{primaries}{docs}{count};
386 if ( ref($_) eq 'Search::Elasticsearch::Error::Missing' ) {
387 push @{ $es_status->{errors} }, "Index not found ($index)";
390 elsif ( ref($_) eq 'Search::Elasticsearch::Error::NoNodes' ) {
394 # TODO: when time comes, we will cover more use cases
400 my $missing_count = 0;
401 if ( $index eq $biblios_index_name ) {
402 $db_count = Koha::Biblios->search->count;
403 } elsif ( $index eq $authorities_index_name ) {
404 $db_count = Koha::Authorities->search->count;
406 if ( $db_count != -1 && $index_count != -1 ) {
407 $missing_count = $db_count - $index_count;
408 $es_has_missing = 1 if $missing_count > 0;
410 push @{ $es_status->{indexes} },
412 index_name => $index,
413 index_count => $index_count,
414 db_count => $db_count,
415 missing_count => $missing_count,
418 $es_status->{running} = $es_running;
421 elasticsearch_status => $es_status,
422 elasticsearch_has_missing => $es_has_missing,
427 if ( C4::Context->preference('RESTOAuth2ClientCredentials') ) {
428 # Do we have the required deps?
429 unless ( can_load( modules => { 'Net::OAuth2::AuthorizationServer' => undef }) ) {
430 $template->param( oauth2_missing_deps => 1 );
434 # Sco Patron should not contain any other perms than circulate => self_checkout
435 if ( C4::Context->preference('WebBasedSelfCheck')
436 and C4::Context->preference('AutoSelfCheckAllowed')
438 my $userid = C4::Context->preference('AutoSelfCheckID');
439 my $all_permissions = C4::Auth::get_user_subpermissions( $userid );
440 my ( $has_self_checkout_perm, $has_other_permissions );
441 while ( my ( $module, $permissions ) = each %$all_permissions ) {
442 if ( $module eq 'self_check' ) {
443 while ( my ( $permission, $flag ) = each %$permissions ) {
444 if ( $permission eq 'self_checkout_module' ) {
445 $has_self_checkout_perm = 1;
447 $has_other_permissions = 1;
451 $has_other_permissions = 1;
455 AutoSelfCheckPatronDoesNotHaveSelfCheckPerm => not ( $has_self_checkout_perm ),
456 AutoSelfCheckPatronHasTooManyPerm => $has_other_permissions,
460 # Test YAML system preferences
461 # FIXME: This is list of current YAML formatted prefs, should by type of preference
463 "UpdateNotForLoanStatusOnCheckin",
465 "BibtexExportAdditionalFields",
466 "RisExportAdditionalFields",
467 "UpdateItemWhenLostFromHoldList",
469 "MarcItemFieldsToOrder",
470 "UpdateitemLocationOnCheckin",
474 foreach my $syspref (@yaml_prefs) {
475 my $yaml = C4::Context->preference( $syspref );
477 eval { YAML::XS::Load( Encode::encode_utf8("$yaml\n\n") ); };
479 push @bad_yaml_prefs, $syspref;
483 $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs;
486 my $dbh = C4::Context->dbh;
487 my $patrons = $dbh->selectall_arrayref(
488 q|select b.borrowernumber from borrowers b join deletedborrowers db on b.borrowernumber=db.borrowernumber|,
491 my $biblios = $dbh->selectall_arrayref(
492 q|select b.biblionumber from biblio b join deletedbiblio db on b.biblionumber=db.biblionumber|,
495 my $items = $dbh->selectall_arrayref(
496 q|select i.itemnumber from items i join deleteditems di on i.itemnumber=di.itemnumber|,
499 my $checkouts = $dbh->selectall_arrayref(
500 q|select i.issue_id from issues i join old_issues oi on i.issue_id=oi.issue_id|,
503 my $holds = $dbh->selectall_arrayref(
504 q|select r.reserve_id from reserves r join old_reserves o on r.reserve_id=o.reserve_id|,
507 if ( @$patrons or @$biblios or @$items or @$checkouts or @$holds ) {
510 ai_patrons => $patrons,
511 ai_biblios => $biblios,
513 ai_checkouts => $checkouts,
521 my $dbh = C4::Context->dbh;
522 my $units = Koha::CirculationRules->search({ rule_name => 'lengthunit', rule_value => { -not_in => ['days', 'hours'] } });
524 if ( $units->count ) {
526 warnIssuingRules => 1,
532 # Guarantor relationships warnings
534 my $dbh = C4::Context->dbh;
535 my ($bad_relationships_count) = $dbh->selectall_arrayref(q{
538 SELECT relationship FROM borrower_relationships WHERE relationship='_bad_data'
540 SELECT relationship FROM borrowers WHERE relationship='_bad_data') a
543 $bad_relationships_count = $bad_relationships_count->[0]->[0];
545 my $existing_relationships = $dbh->selectall_arrayref(q{
546 SELECT DISTINCT(relationship)
548 SELECT relationship FROM borrower_relationships WHERE relationship IS NOT NULL
550 SELECT relationship FROM borrowers WHERE relationship IS NOT NULL) a
553 my %valid_relationships = map { $_ => 1 } split( /,|\|/, C4::Context->preference('borrowerRelationship') );
554 $valid_relationships{ _bad_data } = 1; # we handle this case in another way
556 my $wrong_relationships = [ grep { !$valid_relationships{ $_->[0] } } @{$existing_relationships} ];
557 if ( @$wrong_relationships or $bad_relationships_count ) {
560 warnRelationships => 1,
563 if ( $wrong_relationships ) {
565 wrong_relationships => $wrong_relationships
568 if ($bad_relationships_count) {
570 bad_relationships_count => $bad_relationships_count,
577 # Test 'bcrypt_settings' config for Pseudonymization
578 $template->param( config_bcrypt_settings_no_set => 1 )
579 if C4::Context->preference('Pseudonymization')
580 and not C4::Context->config('bcrypt_settings');
584 my @frameworkcodes = Koha::BiblioFrameworks->search->get_column('frameworkcode');
585 my @hidden_biblionumbers;
586 push @frameworkcodes, ""; # it's not in the biblio_frameworks table!
587 for my $frameworkcode ( @frameworkcodes ) {
588 my $shouldhidemarc_opac = Koha::Filter::MARC::ViewPolicy->should_hide_marc(
590 frameworkcode => $frameworkcode,
594 push @hidden_biblionumbers, { frameworkcode => $frameworkcode, interface => 'opac' }
595 if $shouldhidemarc_opac->{biblionumber};
597 my $shouldhidemarc_intranet = Koha::Filter::MARC::ViewPolicy->should_hide_marc(
599 frameworkcode => $frameworkcode,
600 interface => "intranet"
603 push @hidden_biblionumbers, { frameworkcode => $frameworkcode, interface => 'intranet' }
604 if $shouldhidemarc_intranet->{biblionumber};
606 $template->param( warnHiddenBiblionumbers => \@hidden_biblionumbers );
610 # BackgroundJob - test connection to message broker
612 Koha::BackgroundJob->connect;
616 $template->param( warnConnectBroker => $@ );
620 my %versions = C4::Context::get_versions();
623 kohaVersion => $versions{'kohaVersion'},
624 osVersion => $versions{'osVersion'},
625 perlPath => $perl_path,
626 perlVersion => $versions{'perlVersion'},
627 perlIncPath => [ map { perlinc => $_ }, @INC ],
628 mysqlVersion => $versions{'mysqlVersion'},
629 apacheVersion => $versions{'apacheVersion'},
630 zebraVersion => $zebraVersion,
631 prefBiblioAddsAuthorities => $prefBiblioAddsAuthorities,
632 prefAutoCreateAuthorities => $prefAutoCreateAuthorities,
633 warnPrefBiblioAddsAuthorities => $warnPrefBiblioAddsAuthorities,
634 warnPrefEasyAnalyticalRecords => $warnPrefEasyAnalyticalRecords,
635 warnPrefAnonymousPatronOPACPrivacy => $warnPrefAnonymousPatronOPACPrivacy,
636 warnPrefAnonymousPatronAnonSuggestions => $warnPrefAnonymousPatronAnonSuggestions,
637 warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist => $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist,
638 warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist => $warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist,
639 warnPrefKohaAdminEmailAddress => $warnPrefKohaAdminEmailAddress,
640 warnPrefOpacHiddenItems => $warnPrefOpacHiddenItems,
641 errZebraConnection => $errZebraConnection,
642 warnIsRootUser => $warnIsRootUser,
643 warnNoActiveCurrency => $warnNoActiveCurrency,
644 warnNoTemplateCaching => ( C4::Context->config('template_cache_dir') ? 0 : 1 ),
645 xml_config_warnings => \@xml_config_warnings,
646 warnStatisticsFieldsError => $warnStatisticsFieldsError,
651 my $perl_modules = C4::Installer::PerlModules->new;
652 $perl_modules->versions_info;
654 my @pm_types = qw(missing_pm upgrade_pm current_pm);
656 foreach my $pm_type(@pm_types) {
657 my $modules = $perl_modules->get_attr($pm_type);
658 foreach (@$modules) {
659 my ($module, $stats) = each %$_;
664 version => $stats->{'cur_ver'},
665 missing => ($pm_type eq 'missing_pm' ? 1 : 0),
666 upgrade => ($pm_type eq 'upgrade_pm' ? 1 : 0),
667 current => ($pm_type eq 'current_pm' ? 1 : 0),
668 require => $stats->{'required'},
669 reqversion => $stats->{'min_ver'},
670 maxversion => $stats->{'max_ver'},
671 excversion => $stats->{'exc_ver'}
677 @components = sort {$a->{'name'} cmp $b->{'name'}} @components;
682 foreach (@components) {
684 unless (++$counter % 4) {
685 push (@$table, {row => $row});
689 # Processing the last line (if there are any modules left)
690 if (scalar(@$row) > 0) {
691 # Extending $row to the table size
693 # Pushing the last line
694 push (@$table, {row => $row});
698 $template->param( table => $table );
701 ## ------------------------------------------
702 ## Koha contributions
704 if ( defined C4::Context->config('docdir') ) {
705 $docdir = C4::Context->config('docdir');
707 # if no <docdir> is defined in koha-conf.xml, use the default location
708 # this is a work-around to stop breakage on upgraded Kohas, bug 8911
709 $docdir = C4::Context->config('intranetdir') . '/docs';
714 -e "$docdir" . "/teams.yaml"
715 ? YAML::XS::LoadFile( "$docdir" . "/teams.yaml" )
717 my $dev_team = (sort {$b <=> $a} (keys %{$teams->{team}}))[0];
718 my $short_version = substr($versions{'kohaVersion'},0,5);
719 my $minor = substr($versions{'kohaVersion'},3,2);
720 my $development_version = ( $minor eq '05' || $minor eq '11' ) ? 0 : 1;
721 $template->param( short_version => $short_version );
722 $template->param( development_version => $development_version );
726 -e "$docdir" . "/contributors.yaml"
727 ? YAML::XS::LoadFile( "$docdir" . "/contributors.yaml" )
729 delete $contributors->{_others_};
730 for my $version ( sort { $a <=> $b } keys %{$teams->{team}} ) {
731 for my $role ( keys %{ $teams->{team}->{$version} } ) {
732 my $normalized_role = "$role";
733 $normalized_role =~ s/s$//;
734 if ( ref( $teams->{team}->{$version}->{$role} ) eq 'ARRAY' ) {
735 for my $contributor ( @{ $teams->{team}->{$version}->{$role} } ) {
736 my $name = $contributor->{name};
737 # Add role to contributors
738 push @{ $contributors->{$name}->{roles}->{$normalized_role} },
740 # Add openhub to teams
741 if ( exists( $contributors->{$name}->{openhub} ) ) {
742 $contributor->{openhub} = $contributors->{$name}->{openhub};
746 elsif ( $role ne 'release_date' ) {
747 my $name = $teams->{team}->{$version}->{$role}->{name};
748 # Add role to contributors
749 push @{ $contributors->{$name}->{roles}->{$normalized_role} },
751 # Add openhub to teams
752 if ( exists( $contributors->{$name}->{openhub} ) ) {
753 $teams->{team}->{$version}->{$role}->{openhub} =
754 $contributors->{$name}->{openhub};
758 $teams->{team}->{$version}->{$role} = DateTime->from_epoch( epoch => $teams->{team}->{$version}->{$role});
763 ## Create last name ordered array of people from contributors
765 { name => $_, ( $contributors->{$_} ? %{ $contributors->{$_} } : () ) }
767 my ($alast) = $a =~ /(\S+)$/;
768 my ($blast) = $b =~ /(\S+)$/;
769 my $cmp = lc($alast||"") cmp lc($blast||"");
772 my ($a2last) = $a =~ /(\S+)\s\S+$/;
773 my ($b2last) = $b =~ /(\S+)\s\S+$/;
774 lc($a2last||"") cmp lc($b2last||"");
775 } keys %$contributors;
777 $template->param( contributors => \@people );
778 $template->param( maintenance_team => $teams->{team}->{$dev_team} );
779 $template->param( release_team => $teams->{team}->{$short_version} );
782 if ( open( my $file, "<:encoding(UTF-8)", "$docdir" . "/history.txt" ) ) {
792 shift @lines; #remove header row
795 my ( $epoch, $date, $desc, $tag ) = split(/\t/);
796 if(!$desc && $date=~ /(?<=\d{4})\s+/) {
797 ($date, $desc)= ($`, $');
809 #foreach my $row2 (@rows2) {
812 push( @$table2, { row2 => $row2 } );
816 $template->param( table2 => $table2 );
818 $template->param( timeline_read_error => 1 );
821 output_html_with_http_headers $query, $cookie, $template->output;