View | Details | Raw Unified | Return to bug 6874
Collapse All | Expand All

(-)a/C4/UploadedFiles.pm (-4 / +4 lines)
Lines 61-68 use C4::Context; Link Here
61
sub _get_file_path {
61
sub _get_file_path {
62
    my ($id, $dirname, $filename) = @_;
62
    my ($id, $dirname, $filename) = @_;
63
63
64
    my $uploadPath = C4::Context->config('uploadPath');
64
    my $upload_path = C4::Context->config('upload_path');
65
    my $filepath = "$uploadPath/$dirname/${id}_$filename";
65
    my $filepath = "$upload_path/$dirname/${id}_$filename";
66
    $filepath =~ s|/+|/|g;
66
    $filepath =~ s|/+|/|g;
67
67
68
    return $filepath;
68
    return $filepath;
Lines 81-87 Hash keys are: Link Here
81
81
82
=item * filename: name of the file
82
=item * filename: name of the file
83
83
84
=item * dir: directory where file is stored (relative to config variable 'uploadPath')
84
=item * dir: directory where file is stored (relative to config variable 'upload_path')
85
85
86
=back
86
=back
87
87
Lines 123-129 Parameters: Link Here
123
123
124
=item * $filename: name of the file
124
=item * $filename: name of the file
125
125
126
=item * $dir: directory where to store the file (path relative to config variable 'uploadPath'
126
=item * $dir: directory where to store the file (path relative to config variable 'upload_path'
127
127
128
=item * $io_handle: valid IO::Handle object, can be retrieved with
128
=item * $io_handle: valid IO::Handle object, can be retrieved with
129
$cgi->upload('uploaded_file')->handle;
129
$cgi->upload('uploaded_file')->handle;
(-)a/cataloguing/value_builder/upload.pl (-3 / +3 lines)
Lines 108-114 sub plugin { Link Here
108
            }
108
            }
109
        }
109
        }
110
    } else {
110
    } else {
111
        my $upload_path = C4::Context->config('uploadPath');
111
        my $upload_path = C4::Context->config('upload_path');
112
        if ($upload_path) {
112
        if ($upload_path) {
113
            my $filefield = CGI::filefield(
113
            my $filefield = CGI::filefield(
114
                -name => 'uploaded_file',
114
                -name => 'uploaded_file',
Lines 141-147 sub plugin { Link Here
141
# Build a hierarchy of directories
141
# Build a hierarchy of directories
142
sub finddirs {
142
sub finddirs {
143
    my $base = shift;
143
    my $base = shift;
144
    my $upload_path = C4::Context->config('uploadPath');
144
    my $upload_path = C4::Context->config('upload_path');
145
    my $found = 0;
145
    my $found = 0;
146
    my @dirs;
146
    my @dirs;
147
    my @files = glob("$base/*");
147
    my @files = glob("$base/*");
Lines 175-181 Two system preference are used: Link Here
175
175
176
=over 4
176
=over 4
177
177
178
=item * uploadPath: the real absolute path where files will be stored
178
=item * upload_path: the real absolute path where files will be stored
179
179
180
=item * OPACBaseURL: for building URLs to be stored in MARC
180
=item * OPACBaseURL: for building URLs to be stored in MARC
181
181
(-)a/etc/koha-conf.xml (-1 / +1 lines)
Lines 279-285 __PAZPAR2_TOGGLE_XML_POST__ Link Here
279
 <authorityservershadow>1</authorityservershadow>
279
 <authorityservershadow>1</authorityservershadow>
280
 <pluginsdir>__PLUGINS_DIR__</pluginsdir>
280
 <pluginsdir>__PLUGINS_DIR__</pluginsdir>
281
 <enable_plugins>0</enable_plugins>
281
 <enable_plugins>0</enable_plugins>
282
 <uploadPath></uploadPath>
282
 <upload_path></upload_path>
283
 <intranetdir>__INTRANET_CGI_DIR__</intranetdir>
283
 <intranetdir>__INTRANET_CGI_DIR__</intranetdir>
284
 <opacdir>__OPAC_CGI_DIR__/opac</opacdir>
284
 <opacdir>__OPAC_CGI_DIR__/opac</opacdir>
285
 <opachtdocs>__OPAC_TMPL_DIR__</opachtdocs>
285
 <opachtdocs>__OPAC_TMPL_DIR__</opachtdocs>
(-)a/installer/data/mysql/updatedatabase.pl (-2 / +2 lines)
Lines 8085-8092 if ( CheckVersion($DBversion) ) { Link Here
8085
    ");
8085
    ");
8086
8086
8087
    print "Upgrade to $DBversion done (Bug 6874: New cataloging plugin upload.pl)\n";
8087
    print "Upgrade to $DBversion done (Bug 6874: New cataloging plugin upload.pl)\n";
8088
    print "This plugin comes with a new config variable (uploadPath) and a new table (uploaded_files)\n";
8088
    print "This plugin comes with a new config variable (upload_path) and a new table (uploaded_files)\n";
8089
    print "To use it, set 'uploadPath' config variable and 'OPACBaseURL' system preference and link this plugin to a subfield (856\$u for instance)\n";
8089
    print "To use it, set 'upload_path' config variable and 'OPACBaseURL' system preference and link this plugin to a subfield (856\$u for instance)\n";
8090
    SetVersion($DBversion);
8090
    SetVersion($DBversion);
8091
}
8091
}
8092
8092
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload.tt (-2 / +2 lines)
Lines 4-10 Link Here
4
<head>
4
<head>
5
    <title>Upload plugin</title>
5
    <title>Upload plugin</title>
6
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
    <script type="text/javascript" src="/intranet-tmpl/lib/jquery/jquery.js"></script>
7
    <script type="text/javascript" src="[% interface %]/lib/jquery/jquery.js"></script>
8
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/staff-global.css" />
8
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/staff-global.css" />
9
9
10
</head>
10
</head>
Lines 56-62 Link Here
56
56
57
        [% IF (error_upload_path_not_configured) %]
57
        [% IF (error_upload_path_not_configured) %]
58
          <h2>Configuration error</h2>
58
          <h2>Configuration error</h2>
59
          <p>Configuration variable 'uploadPath' is not configured.</p>
59
          <p>Configuration variable 'upload_path' is not configured.</p>
60
          <p>Please configure it in your koha-conf.xml</p>
60
          <p>Please configure it in your koha-conf.xml</p>
61
        [% ELSE %]
61
        [% ELSE %]
62
          <h2>Please select the file to upload : </h2>
62
          <h2>Please select the file to upload : </h2>
(-)a/t/db_dependent/UploadedFiles.t (-2 / +1 lines)
Lines 20-26 $tcm->upload_file( Link Here
20
my $cgi = $tcm->create_cgi;
20
my $cgi = $tcm->create_cgi;
21
21
22
my $tempdir = tempdir(CLEANUP => 1);
22
my $tempdir = tempdir(CLEANUP => 1);
23
t::lib::Mocks::mock_config('uploadPath', $tempdir);
23
t::lib::Mocks::mock_config('upload_path', $tempdir);
24
24
25
my $testfilename = $cgi->param('testfile');
25
my $testfilename = $cgi->param('testfile');
26
my $testfile_fh = $cgi->upload('testfile');
26
my $testfile_fh = $cgi->upload('testfile');
27
- 

Return to bug 6874