Bugzilla – Attachment 89544 Details for
Bug 22508
Add the ability to prefill 856$u with the direct URL of the file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22508: add POD
Bug-22508-add-POD.patch (text/plain), 1.96 KB, created by
Jonathan Druart
on 2019-05-10 12:48:26 UTC
(
hide
)
Description:
Bug 22508: add POD
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-05-10 12:48:26 UTC
Size:
1.96 KB
patch
obsolete
>From bb20d76788458d45a2c99123f7daf16d71348473 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 4 Apr 2019 13:08:42 -0300 >Subject: [PATCH] Bug 22508: add POD > >--- > Koha/UploadedFile.pm | 37 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 37 insertions(+) > >diff --git a/Koha/UploadedFile.pm b/Koha/UploadedFile.pm >index 990c7ebfc8..6a5db5b539 100644 >--- a/Koha/UploadedFile.pm >+++ b/Koha/UploadedFile.pm >@@ -154,6 +154,15 @@ sub httpheaders { > } > } > >+=head3 url >+ >+ my $url = $uploaded_file->url; >+ >+Return the URL of the file, proxied by opac-retrieve-file.pl >+The syspref OPACBaseURL is used to generate this link. >+ >+=cut >+ > sub url { > my ($self) = @_; > my $OPACBaseURL = C4::Context->preference('OPACBaseURL'); >@@ -161,6 +170,16 @@ sub url { > return "$OPACBaseURL/cgi-bin/koha/opac-retrieve-file.pl?id=" . $self->hashvalue; > } > >+=head3 local_public_path >+ >+ my $local_public_path = $uploaded_file->local_public_path >+ >+Return the local public path for the uploaded file. >+It is generated using the upload_public_path config entry. >+Return If this config entry does not exist. >+ >+=cut >+ > sub local_public_path { > my ($self) = @_; > my $upload_public_path = C4::Context->config('upload_public_path'); >@@ -170,12 +189,30 @@ sub local_public_path { > return $filepath; > } > >+ >+=head3 has_local_public_path >+ >+ my $local_public_path = $uploaded_file->local_public_path >+ >+Return the local public path for the uploaded file, if exists. >+ >+=cut >+ > sub has_local_public_path { > my ($self) = @_; > my $filepath = $self->local_public_path; > return $filepath if -e $filepath; > } > >+=head3 direct_url >+ >+ my $direct_url = $uploaded_file->direct_url >+ >+Return the direct url of the file, ie. without using opac-retrieve-file.pl >+The config entry upload_public_url must be defined. >+ >+=cut >+ > sub direct_url { > my ( $self ) = @_; > # TODO It could start with '/' and we prefix with OPACBaseURL >-- >2.11.0
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 22508
:
86583
|
86584
|
86585
|
87272
|
87273
|
87274
|
87430
|
87431
|
87432
|
89540
|
89541
|
89542
|
89543
| 89544 |
89545
|
89617