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

(-)a/cataloguing/value_builder/upload.pl (-4 / +8 lines)
Lines 100-109 sub plugin { Link Here
100
        my $fh = $input->upload('uploaded_file');
100
        my $fh = $input->upload('uploaded_file');
101
101
102
        $id = C4::UploadedFiles::UploadFile($uploaded_file, $dir, $fh->handle);
102
        $id = C4::UploadedFiles::UploadFile($uploaded_file, $dir, $fh->handle);
103
        if($id) {
103
        my $OPACBaseURL = C4::Context->preference('OPACBaseURL') // '';
104
            my $OPACBaseURL = C4::Context->preference('OPACBaseURL');
104
        $OPACBaseURL =~ s#/$##;
105
            $OPACBaseURL =~ s#/$##;
105
        if (!$OPACBaseURL) {
106
            my $return = "$OPACBaseURL/cgi-bin/koha/opac-retrieve-file.pl?id=$id";
106
            $template->param(MissingURL => 1);
107
        }
108
        if($id && $OPACBaseURL) {
109
            my $OpacProtocol = C4::Context->preference('OpacProtocol') // 'http://';
110
            my $return = "$OpacProtocol$OPACBaseURL/cgi-bin/koha/opac-retrieve-file.pl?id=$id";
107
            $template->param(
111
            $template->param(
108
                success => 1,
112
                success => 1,
109
                return => $return,
113
                return => $return,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload.tt (-2 / +5 lines)
Lines 56-64 Link Here
56
56
57
[% ELSE %]
57
[% ELSE %]
58
58
59
    [% IF ( error ) %]
59
    [% IF ( MissingURL ) %]
60
        <p>Error: The OPAC system preference OPACBaseURL is not configured.</p>
61
        <p><input type="button" value="close" onclick="window.close();" /></p>
62
    [% ELSIF ( error ) %]
60
        <p>Error: Failed to upload file. See logs for details.</p>
63
        <p>Error: Failed to upload file. See logs for details.</p>
61
        <input type="button" value="close" onclick="window.close();" />
64
        <p><input type="button" value="close" onclick="window.close();" /></p>
62
    [% ELSE %]
65
    [% ELSE %]
63
        [%# This block display recursively a directory tree in variable 'dirs' %]
66
        [%# This block display recursively a directory tree in variable 'dirs' %]
64
        [% BLOCK list_dirs %]
67
        [% BLOCK list_dirs %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload_delete_file.tt (-3 / +5 lines)
Lines 38-45 Link Here
38
38
39
[% ELSE %]
39
[% ELSE %]
40
40
41
    [% IF ( error ) %]
41
    [% IF ( MissingURL ) %]
42
        Error: Unable to delete the file.
42
        <p>Error: The OPAC system preference OPACBaseURL is not configured.</p>
43
        <p><input type="button" value="close" onclick="window.close();" /></p>
44
    [% ELSIF ( error ) %]
45
        <p>Error: Unable to delete the file.</p>
43
        <p><input type="button" value="close" onclick="window.close();" /></p>
46
        <p><input type="button" value="close" onclick="window.close();" /></p>
44
    [% ELSE %]
47
    [% ELSE %]
45
        <h2>File deletion</h2>
48
        <h2>File deletion</h2>
46
- 

Return to bug 6874