Bug 22605 - Adding the option to modify/edit searches on the staff interface
Summary: Adding the option to modify/edit searches on the staff interface
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on: 28847
Blocks: 17170 27546
  Show dependency treegraph
 
Reported: 2019-03-28 21:05 UTC by Alexandre
Modified: 2021-10-22 11:38 UTC (History)
10 users (show)

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


Attachments
Bug 22605: Add ability to edit a search on staff interface (28.96 KB, patch)
2020-12-29 16:14 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22605: Add ability to edit a search on staff interface (28.96 KB, patch)
2020-12-29 17:47 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22605: Add ability to edit a search on staff interface (29.02 KB, patch)
2020-12-29 19:11 UTC, Kelly McElligott
Details | Diff | Splinter Review
Bug 22605: Add ability to edit a search on staff interface (29.04 KB, patch)
2021-02-22 19:53 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22605: (follow-up) Correct terminology and fix conditionals (3.07 KB, patch)
2021-04-05 13:03 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22605: Add ability to edit a search on staff interface (22.16 KB, patch)
2021-08-12 15:31 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22605: Add ability to edit a search on staff interface (25.24 KB, patch)
2021-08-13 18:04 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22605: Add ability to edit a search on staff interface (25.32 KB, patch)
2021-08-13 19:51 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22605: Add ability to edit a search on staff interface (25.39 KB, patch)
2021-08-18 16:06 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 22605: Add ability to edit a search on staff interface (25.39 KB, patch)
2021-10-22 11:38 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22605: (follow-up) Fix operators (3.53 KB, patch)
2021-10-22 11:38 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22605: Preselect subtype limits and don't allow multiple (18.85 KB, patch)
2021-10-22 11:38 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre 2019-03-28 21:05:27 UTC
Once we did an advanced search in the OPAC, we have have the option to modify the criterias of this last search ("Return to the last advanced search" just on top of the results list). 

But in the "on site" Koha we don't have this option. Wchich can save a lot of time when we have long and precise searches to do allowing to refine the criterias rather than enter all of them again.

Thanks,

Alexandre
Comment 1 Alexandre 2019-03-29 13:32:37 UTC
By "on site" I mean staff interface.

Thanks,

Alexandre
Comment 2 Nick Clemens 2020-12-29 16:14:01 UTC Comment hidden (obsolete)
Comment 3 Andrew Fuerste-Henry 2020-12-29 17:04:17 UTC Comment hidden (obsolete)
Comment 4 Andrew Fuerste-Henry 2020-12-29 17:13:42 UTC Comment hidden (obsolete)
Comment 5 Nick Clemens 2020-12-29 17:47:13 UTC Comment hidden (obsolete)
Comment 6 Kelly McElligott 2020-12-29 19:11:36 UTC Comment hidden (obsolete)
Comment 7 David Cook 2021-01-04 01:30:29 UTC
We've implemented an "edit search" feature for years locally. It'll be interesting to see what this one is like...
Comment 8 Katrin Fischer 2021-02-17 20:29:36 UTC Comment hidden (obsolete)
Comment 9 Nick Clemens 2021-02-22 19:53:12 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2021-04-03 13:31:58 UTC Comment hidden (obsolete)
Comment 11 Katrin Fischer 2021-04-03 13:35:19 UTC Comment hidden (obsolete)
Comment 12 Nick Clemens 2021-04-05 13:03:33 UTC Comment hidden (obsolete)
Comment 13 Nick Clemens 2021-04-05 13:05:26 UTC Comment hidden (obsolete)
Comment 14 Nick Clemens 2021-08-12 15:31:36 UTC
Created attachment 123816 [details] [review]
Bug 22605: Add ability to edit a search on staff interface

This patch adds the ability to parse the current search and populate the advanced search page on the staff side accordingly.
When searching you will now have an 'Edit this search' link underneath your current search terms

A few notes:
1 - Previous selected items appear with a checkbox, unchecking 'disables' them and removes from the search
2 - Facets and unrecognized limits will appear at the end of the form under 'Other limits' - there could be future enhancement to parse there better, but I believe this is sufficient for now
3 - Previously selected branch or group selections will populate the dropdowns, only one is allowed

To test:
1 - Perform a variety of search on the staff interface
2 - Confirm the 'edit search' button appear below your search
3 - Confirm that options are retained and correctly parsed
4 - Test with library groups - you should be able to combine groups after initial search, or remove individual libraries when editing
5 - Test that selecting a goup disables the individual libraries options

QA note: Missing filters on deletion of keys form hash are false positives
Comment 15 Nick Clemens 2021-08-13 18:04:38 UTC
Created attachment 123839 [details] [review]
Bug 22605: Add ability to edit a search on staff interface

This patch adds the ability to parse the current search and populate the advanced search page on the staff side accordingly.
When searching you will now have an 'Edit this search' link underneath your current search terms

A few notes:
1 - Previous selected items appear with a checkbox, unchecking 'disables' them and removes from the search
2 - Facets and unrecognized limits will appear at the end of the form under 'Other limits' - there could be future enhancement to parse there better, but I believe this is sufficient for now
3 - Previously selected branch or group selections will populate the dropdowns, only one is allowed

To test:
1 - Perform a variety of search on the staff interface
2 - Confirm the 'edit search' button appear below your search
3 - Confirm that options are retained and correctly parsed
4 - Test with library groups - you should be able to combine groups after initial search, or remove individual libraries when editing
5 - Test that selecting a goup disables the individual libraries options

QA note: Missing filters on deletion of keys form hash are false positives
Comment 16 Nick Clemens 2021-08-13 19:51:38 UTC
Created attachment 123840 [details] [review]
Bug 22605: Add ability to edit a search on staff interface

This patch adds the ability to parse the current search and populate the advanced search page on the staff side accordingly.
When searching you will now have an 'Edit this search' link underneath your current search terms

A few notes:
1 - Previous selected items appear with a checkbox, unchecking 'disables' them and removes from the search
2 - Facets and unrecognized limits will appear at the end of the form under 'Other limits' - there could be future enhancement to parse there better, but I believe this is sufficient for now
3 - Previously selected branch or group selections will populate the dropdowns, only one is allowed

To test:
1 - Perform a variety of search on the staff interface
2 - Confirm the 'edit search' button appear below your search
3 - Confirm that options are retained and correctly parsed
4 - Test with library groups - you should be able to combine groups after initial search, or remove individual libraries when editing
5 - Test that selecting a goup disables the individual libraries options

QA note: Missing filters on deletion of keys form hash are false positives
Comment 17 Andrew Fuerste-Henry 2021-08-18 16:06:38 UTC
Created attachment 123965 [details] [review]
Bug 22605: Add ability to edit a search on staff interface

This patch adds the ability to parse the current search and populate the advanced search page on the staff side accordingly.
When searching you will now have an 'Edit this search' link underneath your current search terms

A few notes:
1 - Previous selected items appear with a checkbox, unchecking 'disables' them and removes from the search
2 - Facets and unrecognized limits will appear at the end of the form under 'Other limits' - there could be future enhancement to parse there better, but I believe this is sufficient for now
3 - Previously selected branch or group selections will populate the dropdowns, only one is allowed

To test:
1 - Perform a variety of search on the staff interface
2 - Confirm the 'edit search' button appear below your search
3 - Confirm that options are retained and correctly parsed
4 - Test with library groups - you should be able to combine groups after initial search, or remove individual libraries when editing
5 - Test that selecting a goup disables the individual libraries options

QA note: Missing filters on deletion of keys form hash are false positives

https://bugs.koha-community.org/show_bug.cgi?id=26605

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 18 Katrin Fischer 2021-10-20 21:50:27 UTC
Hi Nick,

started retesting this:

1) Boolean opeators are not kept
Starting with the advanced search in 'less options' mode.

* Search for a simple keyword - OK
* Add another keyword on the next input field - OK
* When you return to search, it has switched from 'less' to 'more' - OKish
* Switch the operator from and to not or or
* When you return to serach, the operator has switched back to 'and' - BAD

2) Subtype search

The subtype searches behave in a bit of an unexpected way:

* Search for a set of the 4 subtypes
* Return to serach - checkboxes appear instead of preselected pull-downs

It looks like this will allow to search for more than one of each, but I feel like this might be better as a separate feature with a little more work.

I see an issue in that you can't search multiple right away (or I didn't figure out how to). You have to add one audience... search... return... add another. That makes it a lot of clicks to add 3 options. 

For this feature... could we just go with making the right preselections on the pull downs and rethink the multiple option feature a bit more?
Comment 19 Nick Clemens 2021-10-22 11:38:18 UTC
Created attachment 126746 [details] [review]
Bug 22605: Add ability to edit a search on staff interface

This patch adds the ability to parse the current search and populate the advanced search page on the staff side accordingly.
When searching you will now have an 'Edit this search' link underneath your current search terms

A few notes:
1 - Previous selected items appear with a checkbox, unchecking 'disables' them and removes from the search
2 - Facets and unrecognized limits will appear at the end of the form under 'Other limits' - there could be future enhancement to parse there better, but I believe this is sufficient for now
3 - Previously selected branch or group selections will populate the dropdowns, only one is allowed

To test:
1 - Perform a variety of search on the staff interface
2 - Confirm the 'edit search' button appear below your search
3 - Confirm that options are retained and correctly parsed
4 - Test with library groups - you should be able to combine groups after initial search, or remove individual libraries when editing
5 - Test that selecting a goup disables the individual libraries options

QA note: Missing filters on deletion of keys form hash are false positives

https://bugs.koha-community.org/show_bug.cgi?id=26605

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 20 Nick Clemens 2021-10-22 11:38:22 UTC
Created attachment 126747 [details] [review]
Bug 22605: (follow-up) Fix operators

- Don't add an operator on first loop
- Only add plus option on last loop
- Fix indentation of first search box
- Remove spaces from operators in query_cgi and add to query and query_desc
Comment 21 Nick Clemens 2021-10-22 11:38:27 UTC
Created attachment 126748 [details] [review]
Bug 22605: Preselect subtype limits and don't allow multiple

Dropdowns moved to an include, checked and preseleced