Bug 14322 - Can't link to an item search
Summary: Can't link to an item search
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-03 13:03 UTC by Magnus Enger
Modified: 2024-04-18 16:29 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 14322: Add button to copy link to an item search (4.11 KB, patch)
2024-04-16 21:13 UTC, Brendan Lawlor
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2015-06-03 13:03:55 UTC
The new item search in the staff client is awesome, but a bit too AJAXy for my tastes. The main problem is that it is not possible to link to the results of a search. If you do a search and you want to show the results to a colleague, you have to explain what boxes to check, what to type where, what to select from what pulldown menus etc. If the search criteria were in the URL it could be done with simply copying and pasting the URL.
Comment 1 Katrin Fischer 2019-08-13 06:27:29 UTC
I'd love to see that as it would also help in support.
Comment 2 Lisette Scheer 2021-01-21 18:38:54 UTC
Being able to send an item search link to another staff member or the support team would be very helpful. 
Lisette
Comment 3 Brendan Lawlor 2024-04-16 21:13:07 UTC
Created attachment 164962 [details] [review]
Bug 14322: Add button to copy link to an item search

This work in progress patch adds a button to copy a url with all the parameters for an item search. The button currently works to copy a url with all the item search parameters url encoded, but the url returns 500.To make it work itemsearch.pl needs some updates to handle when the url parameter shareable=1, then it should process all the prameters from the url.

Test plan:
1. Apply patch
2. Do an item search
3. On the results page see a new 'Copy shareable link' button
4. Click the button and confirm that you can paste a url with all parameters from the form url encoded
5. Paste the url in the browser and notice you get a 500 error :(
Comment 4 Brendan Lawlor 2024-04-16 21:26:28 UTC
Posting this patch for feedback.

itemsearch.pl overrides the form submit button and gets an array of objects for all the parameters.

This patch uses the same code that processes the form inputs into an array of objects, which is used in the ajax call to update the #results dataTable.

It takes that array of parameters and uses jquery to parameterize it into a url encoded string.

I think the remaining changes should be pretty minimal the encoded url is just a different way of representing the same data it already processes with the ajax call.