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, |