Bugzilla – Attachment 44859 Details for
Bug 11317
Add a way to access files from the intranet
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Test case :
Test-case-.patch (text/plain), 4.97 KB, created by
Bouzid Fergani
on 2015-11-13 21:18:05 UTC
(
hide
)
Description:
Test case :
Filename:
MIME Type:
Creator:
Bouzid Fergani
Created:
2015-11-13 21:18:05 UTC
Size:
4.97 KB
patch
obsolete
>From 39f8f8c0cf26daaa121c36f765fed337179b51fb Mon Sep 17 00:00:00 2001 >From: Bouzid Fergani <bouzid.fergani@inlibro.com> >Date: Fri, 13 Nov 2015 16:07:17 -0500 >Subject: [PATCH] Test case : > >Preparation : >* Add the "filesaccess" preference to your "koha-conf.xml" file. This >* preference should be in the "config" section. For this test cas, we >* will use the "/tmp/files-access" directory : ><config> > ... > <filesaccess>/tmp/files-access</filesaccess> > ... ></config> >* Create the log directory on your server. Make sure this directory >* is readable by your web server : >$ mkdir /tmp/files-access >* Add a test file in the log directory : >$ cd /tmp/files-access >$ echo "Hello world!" > test.txt > >Test : >* Go in the "tools/Additional tools" section in the intranet and select "Report/log >* files" >* The "test.txt" should appear in the files list. >* Click on the "test.txt" file, a download dialog should appear. >* Download the file and verify its content. It should contain the >* text "Hello world!". > >http://bugs.koha-community.org/show_bug.cgi?id=11317 >--- > .../prog/en/modules/reports/report_files.tt | 4 ++-- > .../prog/en/modules/reports/reports-home.tt | 1 - > .../prog/en/modules/tools/tools-home.tt | 3 +++ > reports/report_files.pl | 13 ++++++++++--- > 4 files changed, 15 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/report_files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/report_files.tt >index d17c2dd..416f98b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/report_files.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/report_files.tt >@@ -31,8 +31,8 @@ > > <h1>Report/log files</h1> > >-[% IF ( error_no_publicdir ) %] >- <div class="dialog alert"><strong>Error : </strong>Report/log files could not be found because the "publicdir" option was not set in "koha-conf.xml". Contact your system administrator to add this option.</div> >+[% IF ( error_no_dir ) %] >+ <div class="dialog alert"><strong>Error : </strong>Report/log files could not be found because the "filesaccess" option was not set in "koha-conf.xml". Contact your system administrator to add this option.</div> > [% ELSE %] > [% IF ( files_loop ) %] > <table id="files"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt >index d74e25f..fde9ad3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt >@@ -66,7 +66,6 @@ > <li><a href="http://schema.koha-community.org/" target="blank">Koha database schema</a></li> > <li><a href="http://wiki.koha-community.org/wiki/SQL_Reports_Library" target="blank">Koha reports library</a></li> > <!--<li><a href="/cgi-bin/koha/reports/stats.screen.pl">Till reconciliation</a></li> --> >- <li><a href="/cgi-bin/koha/reports/report_files.pl">Report/log files</a></li> > </ul></div> > </div> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >index 7b2e14e..2b8c498 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >@@ -111,6 +111,9 @@ > <dd>Use tool plugins</dd> > [% END %] > >+ <dt><a href="/cgi-bin/koha/reports/report_files.pl">Report/log files </a></dt> >+ <dd>Report/log files</dd> >+ > </dl> > </div> > <div class="yui-u"> >diff --git a/reports/report_files.pl b/reports/report_files.pl >index 6a37396..2d30773 100755 >--- a/reports/report_files.pl >+++ b/reports/report_files.pl >@@ -33,7 +33,7 @@ use Digest::MD5 qw(md5_hex); > > my $input = new CGI; > my $file_id = $input->param("id"); >-my $directory = C4::Context->config('publicdir'); >+my $directory = C4::Context->config('filesaccess'); > > my ($template, $borrowernumber, $cookie) > = get_template_and_user({template_name => "reports/report_files.tt", >@@ -44,7 +44,7 @@ my ($template, $borrowernumber, $cookie) > }); > > unless($directory) { >- $template->param(error_no_publicdir => 1); >+ $template->param(error_no_dir => 1); > } > else { > #Get the files list >@@ -57,8 +57,15 @@ else { > 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}); > } >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11317
:
23203
|
25387
|
27492
|
27579
|
27604
|
35938
|
35939
|
35940
|
36844
|
39783
|
39784
|
39785
|
39786
|
44859
|
44860
|
48629
|
48635
|
49941
|
49942
|
49943
|
49944
|
49945
|
49946
|
49947
|
50421
|
50424
|
50425
|
50440
|
53446
|
58220
|
58221
|
58222
|
58223
|
58224
|
58225
|
58226
|
62971
|
62972
|
62973
|
62974
|
62975
|
64088
|
64089
|
65691
|
65851
|
65855
|
65856
|
65857
|
65909
|
65910
|
65911
|
65912
|
65913
|
65914
|
65915
|
65918
|
66091
|
66092
|
66093
|
66094
|
66095
|
66096
|
66097
|
66098
|
66099
|
66100
|
72097
|
72309
|
72456
|
72457
|
72458
|
72459
|
72460
|
72461
|
72462
|
72463
|
72464
|
72465
|
74119
|
74379
|
74756
|
74911
|
74912
|
74916
|
74917
|
74918
|
74919
|
75019