Koha-clms/Koha
Nick Clemens f5271d1a74
Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog
This patch alters the code in the ES QueryBuilder. Reflecting
how things are handled in build_query_compat we clean the query,
but not the limits. In Zebra we simply recursivly call buildQuery,
but the ES query structure

This patchset adds a new ability to save searches on the staff client, and display them in the results
page on staff or opac as a new filter.

New filters can be added from the results page after a search, and there is an admin page for updating
deleting and renaming filters

There is a new permission to control management of these filters

New filters can be added that are not displayed along with facets, this allows for building custom links
using these filters to keep URLs shorter

Due to bug 30528 testing in ES is recommended

To test:
 1 - Apply patches and update database and restart all
 2 - Enable new system preference 'SavedSearchFilters'
 3 - As superlibrarian perform a search in staff client, something broad like 'a'
 4 - Note new 'Save search as filter' link on results page
 5 - Click it, save search as new filter, check 'Staff client' visibility
 6 - Perform another search
 7 - Note the filter now appears above facets
 8 - Click to it filter results
 9 - Note results are limited by the new filter, and it is checked in the facets
10 - Confirm click the [x] removes the filter
11 - Go to administration->search filters
12 - Confirm the filter appears
13 - Edit and mark as OPAC visible
14 - Test OPAC to ensure it shows and can be applied/removed
15 - Copy URL with filter applied
16 - In adminsitration mark filter as not visible on staff or opac
17 - Confirm link above still works
18 - Create a new staff with catalogue and search filters permission
19 - Ensure they can access/save filters
20 - Remove filter permission and ensure they cannot
21 - Disable system preference
22 - Confirm links to search filters page are removed from admin home and admin sidebar
23 - Confirm filters do not appear on results and cannot be created
24 - Enable pref
25 - Create a filter
26 - From search filters page, click 'Edit search'
27 - Confirm you are taken to advanced search page letting you know which filter you are editing
28 - Confirm you can change searhc options and save
29 - Confirm you can perform the search from this page

Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/]

Signed-off-by: Michal Urban <michalurban177@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-21 11:15:18 -03:00
..
Account Bug 31254: Add additional fields for accountlines 2022-09-21 18:58:28 -03:00
Acquisition Bug 15348: (follow-up) Fix filtering results on estimated delivery date 2022-09-16 10:36:57 -03:00
App
…
ArticleRequest
…
Auth Bug 31389: Calculate user permissions in separate function 2022-09-22 08:39:21 -03:00
Authority
…
BackgroundJob Bug 27421: MARC staging/import are long-running tasks 2022-09-19 15:33:56 -03:00
Biblio Bug 29697: Fix t/db_dependent/Exporter/Record.t 2022-07-25 09:30:35 -03:00
BiblioUtils Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
Cache Bug 29623: (QA follow-up) Add POD to Koha::Cache::Lite 2022-06-14 08:26:59 -03:00
Cash Bug 27779: Group payouts by type of debit they're applied against 2022-08-08 13:37:25 -03:00
Charges
…
Checkouts Bug 28854: Improve lost details display for bundle items 2022-07-13 10:35:36 -03:00
Club Bug 29562: Adjust CanItemBeReserved and checkHighHolds to take objects 2022-01-31 21:55:39 -10:00
CodeList/Unimarc Bug 30941: (QA follow-up) Only export what is needed 2022-08-19 11:00:42 -03:00
Config
…
Course
…
Database Bug 31619: add title back to list of OPACSuggestionMandatoryFields options 2022-10-11 10:11:01 -03:00
Edifact Bug 30135: Add EdifactLSQ mapping preference 2022-04-13 15:55:39 +02:00
Exceptions Bug 30650: Prevent pickup to be created on holiday 2022-07-29 15:00:51 -03:00
Exporter Bug 29697: Fix t/db_dependent/Exporter/Record.t 2022-07-25 09:30:35 -03:00
ExternalContent Bug 29686: Adapt Koha to use new fulfillment API for OverDrive 2022-01-28 11:09:06 -10:00
Filter/MARC Bug 15187: Index 880 in Zebra the same as Elasticsearch 2022-07-22 15:09:46 -03:00
Hold Bug 22456: Add Koha::Hold::CancellationRequest(s) class(es) 2022-07-29 15:28:20 -03:00
Illrequest Bug 30484: Implement support for ILL request updates 2022-09-23 09:18:45 -03:00
Import Bug 31569: (QA follow-up) Add missing entries in schema 2022-10-17 18:00:41 -03:00
Indexer
…
Item Bug 31183: Add Koha::Item::Transfers->filter_by_current 2022-08-09 08:26:24 -03:00
Library Bug 29922: Make get_search_groups return results sorted by title 2022-07-18 15:11:35 -03:00
List
…
MetadataRecord
…
Middleware Bug 28955: Add OPAC_BRANCH_DEFAULT 2022-02-24 14:35:36 -10:00
Misc
…
Notice
…
Number
…
OAI/Server Bug 30921: (QA follow-up) Remove unnecessary if 2022-09-12 16:26:35 -03:00
Object
…
Objects Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Old Bug 26648: Prevent explosion in notices on missing item 2022-10-12 09:56:43 -03:00
Patron Bug 31333: (QA follow-up) Simplify code 2022-10-05 16:01:06 -03:00
Patrons Bug 31595: Don't process extended attributes if none are inlcuded in the file 2022-10-14 15:55:56 -03:00
Plugins Bug 31684: Plugin versions starting with a "v" cause unnecessary warnings 2022-10-21 10:01:22 -03:00
REST Bug 17170: Add API route for SearchFilters 2022-10-21 11:15:14 -03:00
RecordProcessor
…
Result
…
SMS
…
SMTP Bug 28416: Delay load of Email::Sender::Transport::SMTP 2022-03-25 11:01:04 -10:00
Schema Bug 17170: Update schema for boolean 2022-10-21 11:15:14 -03:00
SearchEngine Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog 2022-10-21 11:15:18 -03:00
Serial
…
Sitemapper
…
Subscription
…
SuggestionEngine Bug 31069: Remove ExplodedTerms dependency on templates 2022-07-18 12:37:35 -03:00
Tags
…
Template/Plugin Bug 31401: (QA follow-up) Remove Koha.ArePluginsEnabled, it is no longer needed 2022-09-07 13:55:37 -07:00
UI Bug 31154: (QA follow-up) Fix UI form builder 2022-09-16 10:26:26 -03:00
Util Bug 30678: (follow-up) Add oclc_number routine and friends 2022-07-22 14:58:11 -03:00
XSLT
…
Z3950Responder Bug 24295: Remove GetTransfer from Z3950Responder 2022-08-26 15:42:07 -03:00
pdfformat Bug 31257: (QA follow-up) Fix some typos 2022-10-11 10:44:11 -03:00
Account.pm Bug 30458: Include librarian (manager_id) in accountline when using "Payout amount" button 2022-07-21 16:01:08 -03:00
ActionLog.pm
…
ActionLogs.pm
…
AdditionalContent.pm
…
AdditionalContents.pm Bug 29144: Add $contents->find_best_match, $library->opac_info 2022-09-16 09:55:19 -03:00
AdditionalField.pm
…
AdditionalFieldValue.pm
…
AdditionalFieldValues.pm
…
AdditionalFields.pm
…
AdvancedEditorMacro.pm
…
AdvancedEditorMacros.pm
…
ApiKey.pm
…
ApiKeys.pm
…
ArticleRequest.pm Bug 29759: Make cancelling an AR refund 2022-01-31 21:55:39 -10:00
ArticleRequests.pm
…
AudioAlert.pm
…
AudioAlerts.pm Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
AuthUtils.pm Bug 29744: (QA follow-up) Call psgi_env in OO style 2022-09-22 08:11:58 -03:00
AuthorisedValue.pm
…
AuthorisedValueCategories.pm
…
AuthorisedValueCategory.pm
…
AuthorisedValues.pm Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Authorities.pm
…
Authority.pm Bug 29897: Remove 'linkage' leftover 2022-08-09 10:58:48 -03:00
BackgroundJob.pm Bug 30982: (QA follow-up) Spelling 2022-09-23 08:57:50 -03:00
BackgroundJobs.pm Bug 30982: (QA follow-up) No userenv, no jobs 2022-09-23 08:57:51 -03:00
Biblio.pm Bug 29897: Add and fix POD 2022-08-09 10:58:45 -03:00
BiblioFramework.pm
…
BiblioFrameworks.pm
…
BiblioUtils.pm Bug 29697: Don't crash ES reindex if a record is wrong 2022-07-22 15:24:12 -03:00
Biblioitem.pm
…
Biblioitems.pm
…
Biblios.pm
…
Cache.pm
…
Caches.pm
…
Calendar.pm
…
Checkout.pm Bug 30612: Rename other occurrences 2022-08-01 09:59:05 -03:00
Checkouts.pm
…
CirculationRule.pm
…
CirculationRules.pm Bug 25426: (QA follow-up) Small fixes to POD and INSERT IGNORE or datatabase update 2022-10-18 09:14:57 -03:00
Cities.pm
…
City.pm
…
ClassSortRule.pm
…
ClassSortRules.pm
…
ClassSource.pm
…
ClassSources.pm
…
ClassSplitRule.pm
…
ClassSplitRules.pm
…
Club.pm Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Clubs.pm Bug 29844: Simplify Koha::Clubs->get_enrollable 2022-02-09 15:36:23 -10:00
Config.pm
…
CookieManager.pm Bug 31250: (QA follow-up) The future will be easier 2022-09-12 15:34:11 -03:00
Course.pm
…
Courses.pm
…
CoverImage.pm
…
CoverImages.pm
…
CsvProfile.pm
…
CsvProfiles.pm
…
CurbsidePickup.pm Bug 30650: (QA follow-up) Some higher-level methods usage 2022-07-29 15:38:51 -03:00
CurbsidePickupIssue.pm Bug 30650: Add some useful modules and tests 2022-07-29 14:59:57 -03:00
CurbsidePickupIssues.pm Bug 30650: Add some useful modules and tests 2022-07-29 14:59:57 -03:00
CurbsidePickupOpeningSlot.pm Bug 30650: Add some useful modules and tests 2022-07-29 14:59:57 -03:00
CurbsidePickupOpeningSlots.pm Bug 30650: Add some useful modules and tests 2022-07-29 14:59:57 -03:00
CurbsidePickupPolicies.pm Bug 30650: Add some useful modules and tests 2022-07-29 14:59:57 -03:00
CurbsidePickupPolicy.pm Bug 30650: Allow to restrict curbside pickup for waiting holds only 2022-07-29 15:00:31 -03:00
CurbsidePickups.pm Bug 30650: Add filter_by_scheduled_today 2022-07-29 15:00:47 -03:00
Database.pm
…
DateUtils.pm Bug 30717: (QA follow-up) Move to module 2022-05-13 15:41:55 -10:00
Desk.pm
…
Desks.pm
…
EDI.pm Bug 31054: Manual importing for EDIFACT invoices fails with a 500 error page 2022-07-11 18:23:12 -03:00
Edifact.pm
…
Email.pm
…
Encryption.pm Bug 31053: Add Context module to Koha::Encryption 2022-06-27 11:46:22 -03:00
Exception.pm Bug 29857: (QA follow-up) Add license 2022-03-01 22:47:47 -10:00
Exceptions.pm Bug 23681: Move to ::Patron::Restriction::Type(s) 2022-08-25 08:50:35 -03:00
ExternalContent.pm
…
FrameworkPlugin.pm
…
Hold.pm Bug 14783: (QA follow-up) Rename method and move tests 2022-10-17 15:43:22 -03:00
Holds.pm Bug 31183: Use filter_by_current in Koha::Holds->get_items_that_can_fill 2022-08-09 08:26:25 -03:00
I18N.pm Bug 30941: Add cataloguing plugins for 146$bcdef (UNIMARC) 2022-08-19 08:55:09 -03:00
Illcomment.pm
…
Illcomments.pm
…
Illrequest.pm Bug 30484: Implement support for ILL request updates 2022-09-23 09:18:45 -03:00
Illrequestattribute.pm
…
Illrequestattributes.pm
…
Illrequests.pm
…
ImportBatch.pm
…
ImportBatchProfile.pm
…
ImportBatchProfiles.pm
…
ImportBatches.pm
…
Item.pm Bug 31485: Move _item_denied_renewal to Koha::Item 2022-10-11 10:19:20 -03:00
ItemType.pm Bug 29844: Some more uncaught cases 2022-02-09 15:36:23 -10:00
ItemTypes.pm
…
Items.pm Bug 31105: Holds to pull counts items from other branches when independentbranches is active 2022-09-23 09:44:18 -03:00
KeyboardShortcut.pm
…
KeyboardShortcuts.pm
…
Libraries.pm
…
Library.pm Bug 29144: Add $contents->find_best_match, $library->opac_info 2022-09-16 09:55:19 -03:00
Linktracker.pm
…
Localization.pm
…
Localizations.pm
…
Logger.pm Bug 31468: Change interface in Koha::Logger 2022-09-23 09:33:53 -03:00
Manual.pm Bug 31162: (QA follow-up) Use new WRAPPPERs and fix help link 2022-10-18 10:21:03 -03:00
MarcOverlayRule.pm
…
MarcOverlayRules.pm
…
MarcSubfieldStructure.pm
…
MarcSubfieldStructures.pm
…
MessageAttribute.pm
…
MessageAttributes.pm
…
MetaSearcher.pm Bug 30813: (QA follow-up) Adjust three use statements 2022-06-08 11:40:32 -03:00
MetadataIterator.pm
…
MetadataRecord.pm Bug 30813: (follow-up) Correct C4::Breeding call 2022-06-08 11:40:31 -03:00
MoreUtils.pm
…
OAuth.pm
…
OAuthAccessToken.pm
…
OAuthAccessTokens.pm
…
Object.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Objects.pm Bug 29844: Remove use of wantarray from Koha::Objects 2022-02-09 15:36:23 -10:00
Patron.pm Bug 25936: Add option to send password change notices 2022-10-03 14:25:38 -03:00
Patrons.pm Bug 30058: Add Koha::Patrons->filter_by_have_subpermission 2022-03-17 11:22:56 -10:00
Plugins.pm Bug 30180: (follow-up) Add temporary deprecation warning 2022-05-04 14:29:24 -10:00
ProblemReport.pm
…
ProblemReports.pm
…
PseudonymizedTransaction.pm
…
PseudonymizedTransactions.pm
…
Quote.pm
…
Quotes.pm
…
RDF.pm
…
Rating.pm
…
Ratings.pm
…
Recall.pm Bug 30823: Filling recalls uses 'FILL' action in action logs 2022-07-01 16:09:13 -03:00
Recalls.pm Bug 7021: Catch new introductions of UpdateStats 2022-09-22 09:31:28 -03:00
RecordProcessor.pm
…
Report.pm Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
Reports.pm
…
Review.pm
…
Reviews.pm
…
Schema.pm
…
Script.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
SearchEngine.pm
…
SearchField.pm
…
SearchFields.pm
…
SearchFilter.pm Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog 2022-10-21 11:15:18 -03:00
SearchFilters.pm Bug 17170: DB Updates 2022-10-21 11:15:13 -03:00
SearchMarcMap.pm
…
SearchMarcMaps.pm
…
Serial.pm
…
Serials.pm
…
SharedContent.pm
…
SimpleMARC.pm Bug 23873: Enable capture groups in MarcModificationTemplates 2022-02-21 15:15:47 -10:00
Sitemapper.pm
…
Statistic.pm
…
Statistics.pm
…
StockRotationItem.pm Bug 30518: Correct DateTime maths for needs_advancing 2022-04-19 21:25:50 -10:00
StockRotationItems.pm
…
StockRotationRota.pm
…
StockRotationRotas.pm
…
StockRotationStage.pm
…
StockRotationStages.pm
…
Subscription.pm
…
Subscriptions.pm
…
Suggestion.pm Bug 31374: (follow-up) change private note to staff_note and reorder columns 2022-09-07 13:32:51 -07:00
SuggestionEngine.pm
…
Suggestions.pm Bug 30663: Add Koha::Suggestions helper methods 2022-05-05 10:26:41 -03:00
Tag.pm
…
Tags.pm
…
Token.pm Bug 27849: (follow-up) Add test 2022-08-01 09:53:35 -03:00
TrackedLink.pm
…
TrackedLinks.pm
…
UploadedFile.pm Bug 29156: File missing warning in Koha::UploadedFile for permanent files only 2022-01-21 21:34:51 -10:00
UploadedFiles.pm
…
Uploader.pm Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Virtualshelf.pm Bug 29955: Fix method import issues 2022-08-22 13:06:18 -03:00
Virtualshelfcontent.pm
…
Virtualshelfcontents.pm
…
Virtualshelfshare.pm Bug 25498: (QA follow-up) Rename virtualshelfshare->patron 2022-07-19 11:25:26 -03:00
Virtualshelfshares.pm
…
Virtualshelves.pm Bug 31288: (QA follow-up) Check userenv in disown_or_delete 2022-08-03 11:44:07 -03:00
Z3950Responder.pm
…
Z3950Server.pm
…
Z3950Servers.pm
…