https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22508
--- Comment #18 from Jonathan Druart <[email protected]> --- Created attachment 89542 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89542&action=edit Bug 22508: Add the ability to prefill 856$u with the direct URL of the file When uploading a file using the cataloguing plugin, the current value used to fill 856$u (or others) in is OPACBaseURL/cgi-bin/koha/opac-retrieve-file.pl?id=a-big-hash This patch add the ability to define a custom and direct URL to this file. To accomplish that we need 2 new entries in our config file: * upload_public_path * upload_public_url The first one will be the local path where the files will be stored, that will be publicly accessible. The second one is the root of the URL which links to ths public dir path. Test plan: 0. Define the 2 new config entries, like: <upload_public_path>/home/vagrant/kohaclone/koha-tmpl/public_path</upload_public_path> <upload_public_url>http://catalogue.kohadev.org/public_path</upload_public_url> Then restart memcached+plack to take into account the changes 1. Link the cataloguing plugin 'upload.pl' to 856$u 2. Edit a record, 856$u > click the plugin link 3. A new "Use a public path:" appears if the config is set, tick it and upload a file 4. Pick "Choose the direct url" 5. 856$u will be prefilled with http://catalogue.kohadev.org/public_path/$hash_value instead of the usual http://catalogue.kohadev.org/cgi-bin/koha/opac-retrieve-file.pl?id=$hash_value 6. Use the link and confirm that you can access the file. Note: This patch is not ready for inclusion yet and is published to get feedback. There are several things that will block its inclusion: * TODO: "Delete" button must delete the file * See TODO and FIXME in the patch * Tests and POD for new methods are missing * Variable naming is not perfect * In discussion - what about the upload of files from outside of the cataloguing plugin? * TODO: add check to the about page (?) * FIXME: in upload_public_path the files are not suffixed by the filename as it is for upload_path. We certainly want to be consistent here. Signed-off-by: Hugo Agud <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
