@@ -, +, @@ ... /tmp/files-access ... --- debian/templates/koha-conf-site.xml.in | 3 ++ etc/koha-conf.xml | 3 ++ .../prog/en/modules/reports/report_files.tt | 21 ++++++----- .../prog/en/modules/reports/reports-home.tt | 1 - .../prog/en/modules/tools/tools-home.tt | 3 ++ reports/report_files.pl | 42 +++++++++++++--------- 6 files changed, 44 insertions(+), 29 deletions(-) --- a/debian/templates/koha-conf-site.xml.in +++ a/debian/templates/koha-conf-site.xml.in @@ -290,6 +290,9 @@ __END_SRU_PUBLICSERVER__ Use a comma-separated list of levels to include. --> + + + /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf --- a/etc/koha-conf.xml +++ a/etc/koha-conf.xml @@ -120,6 +120,9 @@ __PAZPAR2_TOGGLE_XML_POST__ CHANGEME + + + __FONT_DIR__/DejaVuSerif.ttf --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/report_files.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/report_files.tt @@ -2,12 +2,11 @@ Report/log files [% INCLUDE 'doc-head-close.inc' %] - +[% INCLUDE 'datatables.inc' %] [% INCLUDE 'datatables-strings.inc' %] - @@ -27,13 +26,13 @@
-
-
+
+
-

Report/log files

+

Report/log files

-[% IF ( error_no_publiclogdir ) %] -
Error : Report/log files could not be found because the "publiclogdir" option was not set in "koha-conf.xml". Contact your system administrator to add this option.
+[% IF ( error_no_dir ) %] +
Error : Report/log files could not be found because the "accessdir" option was not set in "koha-conf.xml". Contact your system administrator to add this option.
[% ELSE %] [% IF ( files_loop ) %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt @@ -66,7 +66,6 @@
  • Koha database schema
  • Koha reports library
  • -
  • Report/log files
  • --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt @@ -109,6 +109,9 @@
    Manage EDIfact transmissions
    [% END %] +
    Report/log files
    +
    Report/log files
    +
    --- a/reports/report_files.pl +++ a/reports/report_files.pl @@ -3,14 +3,14 @@ # Frédérick Capovilla, 2011 - Libéo # # Show a list of all the files in the directory specified by the option -# "publiclogdir" in koha-conf.xml so they can be downloaded by users with the +# "accessdir" in koha-conf.xml so they can be downloaded by users with the # "reports" permission. # # This file is part of Koha. # # Koha is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later +# Foundation; either version 3 of the License, or (at your option) any later # version. # # Koha is distributed in the hope that it will be useful, but WITHOUT ANY @@ -33,32 +33,39 @@ use Digest::MD5 qw(md5_hex); my $input = new CGI; my $file_id = $input->param("id"); -my $directory = C4::Context->config('publiclogdir'); +my $directory = C4::Context->config('accessdir'); my ($template, $borrowernumber, $cookie) - = get_template_and_user({template_name => "reports/report_files.tt", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => {reports => '*'}, - }); + = get_template_and_user({template_name => "reports/report_files.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {reports => '*'}, + }); unless($directory) { - $template->param(error_no_publiclogdir => 1); + $template->param(error_no_dir => 1); } else { #Get the files list my @files_list; - opendir(DIR, $directory); + opendir(DIR, $directory); foreach my $filename (readdir(DIR)) { - my $id = md5_hex($filename); + my $id = md5_hex($filename); my $full_path = "$directory/$filename"; next if ($filename =~ /^\./ or -d $full_path); my $st = stat($full_path); + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime($st->mtime); + my $dt=DateTime->new(year => $year + 1900, + month => $mon + 1, + day => $mday, + hour => $hour, + minute => $min, + ); push(@files_list, {name => $filename, - date => scalar localtime($st->mtime), + date =>Koha::DateUtils::output_pref($dt), size => $st->size, id => $id}); } @@ -75,14 +82,15 @@ else { -Content_length => -s "$directory/$filename", -attachment => "$filename"); - open FILE, "<:utf8", "$directory/$filename"; - binmode FILE; + my $fh; + open $fh, "<:encoding(UTF-8)", "$directory/$filename"; + binmode $fh; my $buf; - while(read(FILE, $buf, 65536)) { + while(read($fh, $buf, 65536)) { print $buf; } - close FILE; + close $fh; exit(1); } --