Bug 32336: (QA follow-up) Use $metadata->schema
[srvgit] / about.pl
index 06f4050..799cc51 100755 (executable)
--- a/about.pl
+++ b/about.pl
@@ -25,6 +25,7 @@ use Modern::Perl;
 use CGI qw ( -utf8 );
 use DateTime::TimeZone;
 use File::Slurp qw( read_file );
+use IPC::Cmd qw(can_run);
 use List::MoreUtils qw( any );
 use Module::Load::Conditional qw( can_load );
 use Config qw( %Config );
@@ -125,7 +126,7 @@ if ($^O ne 'VMS') {
 my $zebraVersion = `zebraidx -V`;
 
 # Check running PSGI env
-if ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) {
+if ( C4::Context->psgi_env ) {
     $template->param(
         is_psgi => 1,
         psgi_server => ($ENV{ PLACK_ENV }) ? "Plack ($ENV{PLACK_ENV})" :
@@ -172,8 +173,8 @@ if ($prefStatisticsFields) {
 }
 
 my $prefAutoCreateAuthorities = C4::Context->preference('AutoCreateAuthorities');
-my $prefBiblioAddsAuthorities = C4::Context->preference('BiblioAddsAuthorities');
-my $warnPrefBiblioAddsAuthorities = ( $prefAutoCreateAuthorities && ( !$prefBiblioAddsAuthorities) );
+my $prefRequireChoosingExistingAuthority = C4::Context->preference('RequireChoosingExistingAuthority');
+my $warnPrefRequireChoosingExistingAuthority = ( !$prefAutoCreateAuthorities && ( !$prefRequireChoosingExistingAuthority) );
 
 my $prefEasyAnalyticalRecords  = C4::Context->preference('EasyAnalyticalRecords');
 my $prefUseControlNumber  = C4::Context->preference('UseControlNumber');
@@ -324,6 +325,9 @@ if ( C4::Context->preference('ILLModule') ) {
 
     $template->param( warnILLConfiguration => $warnILLConfiguration );
 }
+unless ( can_run('weasyprint') ) {
+    $template->param( weasyprint_missing => 1 );
+}
 
 {
     # XSLT sysprefs
@@ -588,7 +592,9 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs;
     my @frameworkcodes = Koha::BiblioFrameworks->search->get_column('frameworkcode');
     my @hidden_biblionumbers;
     push @frameworkcodes, ""; # it's not in the biblio_frameworks table!
+    my $no_FA_framework = 1;
     for my $frameworkcode ( @frameworkcodes ) {
+        $no_FA_framework = 0 if $frameworkcode eq 'FA';
         my $shouldhidemarc_opac = Koha::Filter::MARC::ViewPolicy->should_hide_marc(
             {
                 frameworkcode => $frameworkcode,
@@ -608,6 +614,7 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs;
           if $shouldhidemarc_intranet->{biblionumber};
     }
     $template->param( warnHiddenBiblionumbers => \@hidden_biblionumbers );
+    $template->param( warnFastCataloging => $no_FA_framework );
 }
 
 {
@@ -632,9 +639,9 @@ $template->param(
     mysqlVersion  => $versions{'mysqlVersion'},
     apacheVersion => $versions{'apacheVersion'},
     zebraVersion  => $zebraVersion,
-    prefBiblioAddsAuthorities => $prefBiblioAddsAuthorities,
+    prefRequireChoosingExistingAuthority => $prefRequireChoosingExistingAuthority,
     prefAutoCreateAuthorities => $prefAutoCreateAuthorities,
-    warnPrefBiblioAddsAuthorities => $warnPrefBiblioAddsAuthorities,
+    warnPrefRequireChoosingExistingAuthority => $warnPrefRequireChoosingExistingAuthority,
     warnPrefEasyAnalyticalRecords  => $warnPrefEasyAnalyticalRecords,
     warnPrefAnonymousPatronOPACPrivacy        => $warnPrefAnonymousPatronOPACPrivacy,
     warnPrefAnonymousPatronAnonSuggestions    => $warnPrefAnonymousPatronAnonSuggestions,
@@ -722,6 +729,7 @@ my $dev_team = (sort {$b <=> $a} (keys %{$teams->{team}}))[0];
 my $short_version = substr($versions{'kohaVersion'},0,5);
 my $minor = substr($versions{'kohaVersion'},3,2);
 my $development_version = ( $minor eq '05' || $minor eq '11' ) ? 0 : 1;
+my $codename;
 $template->param( short_version => $short_version );
 $template->param( development_version => $development_version );
 
@@ -747,7 +755,16 @@ for my $version ( sort { $a <=> $b } keys %{$teams->{team}} ) {
                 }
             }
         }
-        elsif ( $role ne 'release_date' ) {
+        elsif ( $role eq 'release_date' ) {
+            $teams->{team}->{$version}->{$role} = DateTime->from_epoch( epoch => $teams->{team}->{$version}->{$role});
+        }
+        elsif ( $role eq 'codename' ) {
+            if ( $version == $short_version ) {
+                $codename = $teams->{team}->{$version}->{$role};
+            }
+            next;
+        }
+        else {
             my $name = $teams->{team}->{$version}->{$role}->{name};
             # Add role to contributors
             push @{ $contributors->{$name}->{roles}->{$normalized_role} },
@@ -758,9 +775,6 @@ for my $version ( sort { $a <=> $b } keys %{$teams->{team}} ) {
                   $contributors->{$name}->{openhub};
             }
         }
-        else {
-            $teams->{team}->{$version}->{$role} = DateTime->from_epoch( epoch => $teams->{team}->{$version}->{$role});
-        }
     }
 }
 
@@ -778,6 +792,7 @@ my @people = map {
   lc($a2last||"") cmp lc($b2last||"");
 } keys %$contributors;
 
+$template->param( kohaCodename  => $codename);
 $template->param( contributors => \@people );
 $template->param( maintenance_team => $teams->{team}->{$dev_team} );
 $template->param( release_team => $teams->{team}->{$short_version} );