Bug 36045

Summary: Use DataTables filter for suggestions search
Product: Koha Reporter: Mirjam Vantieghem <mirjam.vantieghem>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: Patch doesn't apply --- QA Contact: Lisette Scheer <lisette>
Severity: enhancement    
Priority: P5 - low CC: david, jonathan.druart, lisette, martin.renvoize
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:
Circulation function:
Attachments: Bug 36045: Use DataTables filter for suggestions search
Bug 36045: Use DataTables filter for suggestions search
Bug 36045: Use DataTables filter for suggestions search
Bug 36045: Use DataTables filter for suggestions search

Description Mirjam Vantieghem 2024-02-08 13:03:50 UTC
The purchase suggestions search in the OPAC patron account only works if the full title, exactly equal to the title of the purchase suggestion, is entered.
I would expect this search to function in the same way as the search in the Staff client suggestions management, i.e. to also search on author's name, title word, note word.

At least it should be made clear on the OPAC that this search only looks at the title and only works if the full title is entered. E.g. by adding the text "Enter full title". But then I don't really see the point of this search option. It is not really helpful if only the full title can be searched (because you need to remember which form of the title you filled in).
Comment 1 Owen Leonard 2024-02-12 16:13:49 UTC Comment hidden (obsolete)
Comment 2 David Nind 2024-04-29 01:12:03 UTC
Created attachment 165714 [details] [review]
Bug 36045: Use DataTables filter for suggestions search

This patch removes the server-side suggestions search form and related
code from the OPAC suggestions page. In its place is a DataTables filter
form and a custom dropdown to replace the "suggested by me/anyone"
option from the old search.

To test you should have some suggestions in your system submitted by
two or more users.

- Apply the patch and rebuild the OPAC CSS.
- Go to Administration -> System preferences and set the
  "OPACViewOthersSuggestions" preference to "Show."
- Log in to the OPAC as one of the users who has submitted suggetions.
- Go to the purchase suggestions page.
  - The initial view should be of "your" suggestions.
  - The dropdown filter at the top should have "Suggested by me"
    selected.
  - The "Clear filter" button should be disabled.
- Test that the "Suggested by me" dropdown works to change what's shown
  in the table.
  - The "Clear filter" button should be enabled when you choose
    "Suggested by anyone."
- The DataTables "Search" field should work correctly with either
  setting of the "Suggested by..." dropdown.

- Go back to Administration in the staff interface and disable the
  "OPACViewOthersSuggestions" preference.
- Return to the suggestions page in the OPAC.
- You should see only your suggestions, and the "Suggested by..."
  dropdown should not be there.
- Confirm that filtering still works correctly.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2024-04-29 01:15:09 UTC
The only thing I noticed, and I wasn't sure whether this it is what is expected or not:

1. Without entering a search term, if I select 'Suggested by anyone' it displays everyone else's suggestions - but not mine.
Comment 4 Owen Leonard 2024-06-17 16:53:23 UTC
Created attachment 167792 [details] [review]
Bug 36045: Use DataTables filter for suggestions search

This patch removes the server-side suggestions search form and related
code from the OPAC suggestions page. In its place is a DataTables filter
form and a custom dropdown to replace the "suggested by me/anyone"
option from the old search.

To test you should have some suggestions in your system submitted by
two or more users.

- Apply the patch and rebuild the OPAC CSS.
- Go to Administration -> System preferences and set the
  "OPACViewOthersSuggestions" preference to "Show."
- Log in to the OPAC as one of the users who has submitted suggetions.
- Go to the purchase suggestions page.
  - The initial view should be of "your" suggestions.
  - The dropdown filter at the top should have "Suggested by me"
    selected.
  - The "Clear filter" button should be disabled.
- Test that the "Suggested by me" dropdown works to change what's shown
  in the table.
  - The "Clear filter" button should be enabled when you choose
    "Suggested by anyone."
- The DataTables "Search" field should work correctly with either
  setting of the "Suggested by..." dropdown.

- Go back to Administration in the staff interface and disable the
  "OPACViewOthersSuggestions" preference.
- Return to the suggestions page in the OPAC.
- You should see only your suggestions, and the "Suggested by..."
  dropdown should not be there.
- Confirm that filtering still works correctly.

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Katrin Fischer 2024-09-02 08:51:33 UTC
I am sorry, this no longer applies cleanly. Can you please rebase?
Comment 6 Owen Leonard 2024-09-03 17:33:39 UTC
Created attachment 170996 [details] [review]
Bug 36045: Use DataTables filter for suggestions search

This patch removes the server-side suggestions search form and related
code from the OPAC suggestions page. In its place is a DataTables filter
form and a custom dropdown to replace the "suggested by me/anyone"
option from the old search.

To test you should have some suggestions in your system submitted by
two or more users.

- Apply the patch and rebuild the OPAC CSS.
- Go to Administration -> System preferences and set the
  "OPACViewOthersSuggestions" preference to "Show."
- Log in to the OPAC as one of the users who has submitted suggetions.
- Go to the purchase suggestions page.
  - The initial view should be of "your" suggestions.
  - The dropdown filter at the top should have "Suggested by me"
    selected.
  - The "Clear filter" button should be disabled.
- Test that the "Suggested by me" dropdown works to change what's shown
  in the table.
  - The "Clear filter" button should be enabled when you choose
    "Suggested by anyone."
- The DataTables "Search" field should work correctly with either
  setting of the "Suggested by..." dropdown.

- Go back to Administration in the staff interface and disable the
  "OPACViewOthersSuggestions" preference.
- Return to the suggestions page in the OPAC.
- You should see only your suggestions, and the "Suggested by..."
  dropdown should not be there.
- Confirm that filtering still works correctly.

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 Jonathan Druart 2025-01-16 11:49:51 UTC
Please redo on top of bug 26553 (because of bug 38255).

I can do when they are pushed if you want me to.
Comment 8 Jonathan Druart 2025-01-16 11:50:58 UTC
And it does not apply btw.

CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt