Summary: | Uploaded files can't be easily browsed via upload.pl | ||
---|---|---|---|
Product: | Koha | Reporter: | David Cook <dcook> |
Component: | Tools | Assignee: | David Cook <dcook> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | andrew, fridolin.somers, m.de.rooy, marjorie.barry-vila, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.05.00,20.11.06
|
|
Circulation function: | |||
Attachments: |
Bug 25476: Add ability to browse file uploads by category
Bug 25476: Add ability to browse file uploads by category Bug 25476: Add ability to browse file uploads by category Bug 25476: Add ability to browse file uploads by category |
Description
David Cook
2020-05-13 06:49:06 UTC
Created attachment 104862 [details] [review] Bug 25476: Add ability to browse file uploads by category This patch adds the ability to search/browse files by category. (Note it doesn't include temporary uploads since they don't have a "category" per se.) Test Plan: 0) Apply patch 1) Go to /cgi-bin/koha/admin/authorised_values.pl 2) Create "UPLOAD" authorized value category 3) Create "test" authorized value in "UPLOAD" category 4) Go to /cgi-bin/koha/tools/upload.pl 5) Note "Search uploads by category" fieldset 6) Upload new file to "test" category 7) Click "Back" 8) Choose "test" category in "Search uploads by category" 9) Click "Search" 10) Note that your file upload is displayed in result list Can this be made to combine both category and term/hash searching in one form? (In reply to Owen Leonard from comment #2) > Can this be made to combine both category and term/hash searching in one > form? Probably although that would be low on my TODO list. Created attachment 115373 [details] [review] Bug 25476: Add ability to browse file uploads by category This patch adds the ability to search/browse files by category. (Note it doesn't include temporary uploads since they don't have a "category" per se.) Test Plan: 0) Apply patch 1) Go to /cgi-bin/koha/admin/authorised_values.pl 2) Create "UPLOAD" authorized value category 3) Create "test" authorized value in "UPLOAD" category 4) Go to /cgi-bin/koha/tools/upload.pl 5) Note "Search uploads by category" fieldset 6) Upload new file to "test" category 7) Click "Back" 8) Choose "test" category in "Search uploads by category" 9) Click "Search" 10) Note that your file upload is displayed in result list Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Created attachment 118882 [details] [review] Bug 25476: Add ability to browse file uploads by category This patch adds the ability to search/browse files by category. (Note it doesn't include temporary uploads since they don't have a "category" per se.) Test Plan: 0) Apply patch 1) Go to /cgi-bin/koha/admin/authorised_values.pl 2) Create "UPLOAD" authorized value category 3) Create "test" authorized value in "UPLOAD" category 4) Go to /cgi-bin/koha/tools/upload.pl 5) Note "Search uploads by category" fieldset 6) Upload new file to "test" category 7) Click "Back" 8) Choose "test" category in "Search uploads by category" 9) Click "Search" 10) Note that your file upload is displayed in result list Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Works, QA tools ok, code looks good but just one question about plugin stuff: Why is [% PROCESS plugin_pars %] needed? And what does $plugin? ( public => 1 ): (), do? (In reply to Victor Grousset/tuxayo from comment #6) > Works, QA tools ok, code looks good but just one question about plugin stuff: > > Why is [% PROCESS plugin_pars %] needed? Honestly, I did that because the other blocks had it. It looks like it's needed so that if you're working with plugins, Koha will know you're still working with plugins when you do a form submit. > And what does $plugin? ( public => 1 ): (), do? This looks like it may have been changed in newer versions of Koha to something like: $plugin? (): ( include_private => 1 ), I am not sure. It's been too long since I wrote this. Might be worth marking as Failed QA, and I probably won't work on fixing it, as I have too many other things on at the moment. > Might be worth marking as Failed QA
Asked for help in koha-devel, to not have this fall into oblivion ^^
Maybe there is nothing to fix.
Having a look right now First impression: The search fields category and term could better have been combined on one search form instead of now two. Victor asked: QUOTE [% PROCESS plugin_pars %] [...] $plugin? ( public => 1 ): () Does this look familiar to anyone? END_QUOTE Yes, it looks familiar ;) I wrote this code once. The plugin variable refers to the use of upload in the cataloguing editor as a plugin for field 856 in MARC21. When you upload files there, it would be useless to add file uploads that are not public, since your OPAC users would not be able to use them. The process directive adds the block defined earlier. The plugin flag adds the extra condition public = 1 to your search. You dont want to add private uploads in field 856. Hope that helps. Created attachment 119343 [details] [review] Bug 25476: Add ability to browse file uploads by category This patch adds the ability to search/browse files by category. (Note it doesn't include temporary uploads since they don't have a "category" per se.) Test Plan: 0) Apply patch 1) Go to /cgi-bin/koha/admin/authorised_values.pl 2) Create "UPLOAD" authorized value category 3) Create "test" authorized value in "UPLOAD" category 4) Go to /cgi-bin/koha/tools/upload.pl 5) Note "Search uploads by category" fieldset 6) Upload new file to "test" category 7) Click "Back" 8) Choose "test" category in "Search uploads by category" 9) Click "Search" 10) Note that your file upload is displayed in result list Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Passed QA with reference to comment10 Pushed to master for 21.05, thanks to everybody involved! Small and very useful enhancement, I choose to backport. Pushed to 20.11.x for 20.11.06 Not backported to 20.05. |